Question on Response Message Contract

May 15, 2009 at 3:36 PM

All,

I have more than one field in the Response Message Contract for a operation. But when i try to add service reference in Silverlight Client, am not able to get the response object after calling the function.

Instead it is returning different properties for each field. But when i have only one field in Response message contract, am able to get the return type as Response Message contract in Silverlight.

I think it is due to proxy file generation in silverlight. I need to manually alter the proxy reference.cs file after updating service reference every time.

Any ideas how to resolve this?

 

Thanks,

Naveen.

May 15, 2009 at 5:37 PM

Try making your response message contract wraped

 

regards

Juan Pablo Schmiede

May 15, 2009 at 5:42 PM

Juan,

I did wrap the message contract. Otherwise, WSSF wont even allow me to build the solution.

May 15, 2009 at 6:55 PM

Naveen , there is a protect on Codeplex (http://wizdl.codeplex.com/) that alows you to test a service, I'd have find that the generated proxys some time are smarter than we need.

It may help to select "Always generate message contracts" on the proxy generation wizard

Mar 1, 2010 at 10:51 PM

Hi,


I am having the same problem!  Response Message is wrapped - and I can't seem to find/be priviledged to see/whatever it is, an option for "Always generate message contracts".  Your asisstance is greatly appreciated :)

 

 

 

Developer
Mar 2, 2010 at 11:01 AM

Hi,

Are you also wrapping the Request message? This post will tell you that: http://www.codeplex.com/servicefactory/Thread/View.aspx?ThreadId=21981

Mar 2, 2010 at 2:00 PM

Yes, I'm wrapping both Request and Response.  And this behavior I am getting is not consistent.  Sometimes it will produce the out variables, sometimes the Response object.

I have a Host project for the service - I'm trying to figure out how to find the option for it to "Always Generate message contracts".  If I add a Service Reference to my project, I can see where I can set this.  I'm I do not see how to get to this option for my MyServices.Host project that contains the .svc definition for my WCF service.  Do you know where I can get to this, or if it is available to me?

 

Thanks tons!

Developer
Mar 2, 2010 at 8:12 PM

The "Always generate..."option is only available from the VS menu option. Regarding the inconsistent behavior, I'm not sure which kind of change you might be inbtrodicing that triggers different results from the same model.

You can also try to us the VS oprion (Add Service ref...) after you generate the service and deploy it to your host project and checked that is running fine.

Mar 2, 2010 at 8:23 PM

The only change I'm introducing is adding a new Part to the Response message.  The part is a new Data Contract item I modeled out on th e Data Contract, then generated code from.