Open RIA Services User Support Troble calling Login method of the AuthenticationService  Viewed 32488 time(s), 5 post(s)., 6/7/2015 7:18:32 PM - by ankuranand

ankuranand 6/8/2015 2:12:32 PM

I have OpenRIA hosted within an website. I have a WPF client that connects to the Authentiction and DomainService. I am having trouble calling the Login method. It basically does not like that the message parameters are not "Wrapped". See the error message below

An unhandled exception of type 'System.InvalidOperationException' occurred in OpenRiaServices.DomainServices.Client.dll

Additional information: Operation 'Login' of contract 'IPatientAuthenticationDomainServiceContract' specifies multiple request body parameters to be serialized without any wrapper elements. At most one body parameter can be serialized without wrapper elements. Either remove the extra body parameters or set the BodyStyle property on the WebGetAttribute/WebInvokeAttribute to Wrapped.

On the client side, The WebHttpBehavior in domainClient.ChannelFactory.Endpoint.EndpointBehaviors has DefaultBodyStyle = Wrapped

The project that's hosting the OpenRIA services has web behavior set to Wrapped.
        <behavior name="web">
          <webHttp defaultBodyStyle="Wrapped"/>

What could I be missing? Has anyone encountered this issue?



This content has not been rated yet. 
35 Reputation 3 Total posts
ankuranand 6/8/2015 11:30:20 PM

Issue resolved. Just wanted to share the fix. I am using SharedCookieContainer that Kyle McClellan wrote for sharing cookie between Auth service and Domain service when not using an in-browser client. See

The SharedCookieBehavior in this code is an extension of WebHttpBehavior. This class needs to have the DefaultBodyStyle set to Wrapped when its newed up. Simpe fix but took me a while to figure out.



This content has not been rated yet. 
35 Reputation 3 Total posts
tomas 8/26/2015 1:14:55 PM

Hi Ankur,

I am converting SL app to WPF and I am now having trouble even with instantiating of AuthenticationContext on application startup.
I am getting this:
An exception of type 'System.ArgumentException' occurred in OpenRiaServices.DomainServices.Client.Web.dll but was not handled in user code
Additional information: The specified service URI is not correctly formatted.

Some detail about this problem are even here:

Obviously, I have now problem how to set up projects in  my solution in order to WPF part comunicate with WCF...

Could you please elaborate more how did you make it work?

Thank you,

This content has not been rated yet. 
16 Reputation 3 Total posts
Daniel-Svensson 9/1/2015 5:10:11 PM


Currently you must always specify absolute adresses for WPF applications, here is an example of how to do so for the authentication service:


WebContext webContext = new WebContext();
webContext.Authentication = new FormsAuthentication()
        DomainContext = new AuthenticationDomainService1(
             new WebDomainClient<AuthenticationDomainService1.IAuthenticationDomainService1Contract>(


This content has not been rated yet. 
338 Reputation 44 Total posts
Daniel-Svensson 2/7/2016 2:28:28 PM

I first beta release of 4.5.0 has been pushed to nuget and a link to a my portable replacement to the WCF client can be found in the description

The release introduces some small changes in how DomainClients gets created (via WcfDomainClientFactorywhich might help with implementing SharedCookieBehavior centrally).
You should be able to specify your base Uri at Application startup and then just use relative Uri's (using default constructor).

This content has not been rated yet. 
338 Reputation 44 Total posts