I have OpenRIA hosted within an asp.net 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 asp.net project that's hosting the OpenRIA services has web behavior set to Wrapped.
What could I be missing? Has anyone encountered this issue?
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 http://blogs.msdn.com/b/kylemc/archive/2010/05/14/ria-services-authentication-out-of-browser.aspx
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.
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?
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 =
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).