tags:

views:

127

answers:

4

Hi Team,

I have a simple WCF service, self hosting and a .net client. I am generating a proxy using svcutil. When I add the proxy to the client it asks me to add System.ServiceModel.dll. Well, I can add it since it is a test scenario and I am working in .Net platform.

However, suppose I am using a machine that does not support .Net, how that platform would compensate for the System.ServiceModel?

Could you please put some light on it?

EDIT: I got somewhat an idea. If I am creating WCF client I need to add ServiceModel. To Test it I added a ASMX client (Add Web Reference). My service mthod does not take any params. But i get an error in client asking me to enter out int Result, out bool ResultSpecified. Could you please exlain why?

EDIT: Could you please point me to an example - how and what to set true on "DataContractSerializer"

Thanks

Lijo

+1  A: 

It would compensate by throwing an exception. You need .NET framework installed to run .NET applications. For cross platform you may take a look at Mono.


Sorry I misunderstood your question. If you expose an endpoint using basicHttpBinding any client that conforms to the WS-I Basic Profile 1.1 will be able to consume the web service without problems. This is the most interoperable binding.

Darin Dimitrov
I am already using binding="basicHttpBinding", still the client asks me to add SYstem.ServiceModel.
Lijo
What client are you using? What language/platform? If it is a .NET client generated with `svcutil` of course that it will ask you for `System.ServiceModel` (see my answer before the edit). If it is a machine that has only .NET 2.0 installed and not .NET 3.0 or later you could use `wsdl.exe` to generate a client proxy.
Darin Dimitrov
I got somewhat an idea. If I am creating WCF client I need to add ServiceModel. To Test it I added a ASMX client (Add Web Reference). My service mthod does not take any params. But i get an error in client asking me to enter out int <methodname>Result, out bool <methodname>ResultSpecified. Could you please exlain why?
Lijo
Yes those are properties that are automatically added for value type parameters when using `DataContractSerializer` on the server side. You need to set them to `true` when you specify a value for the corresponding parameter. If you don't want those you could switch the service to using `XmlSerializer` by adding the `[XmlSerializerFormat]` attribute to your service contract. Then regenerate the client proxy (Add Web Reference) and those will disappear.
Darin Dimitrov
Thanks. Could you please point me to an example - how and what to set true on "DataContractSerializer"
Lijo
Set the `xxxSpecified` parameters to true on the client side when invoking the service.
Darin Dimitrov
+1  A: 

What bindings do you use?!

See also http://stackoverflow.com/questions/856368/is-wcf-platform-independent

Web Services Protocols Interoperability Guide

WSIT For Web Services Interoperability Technologies

salgo60
I am using binding="basicHttpBinding"
Lijo
+2  A: 

Odd question. If the client isn't a .NET application, it obviously wouldn't need System.ServiceModel. Clients can be written using any other SOAP library in whatever language the application is using.

Thorarin
+1  A: 

I think there are two issues here:

  1. If you're self hosting a service, but you want clients not built using .NET to have access to it, then maybe you should consider hosting it within IIS instead. Alternatively, you would need to ensure that your hosting application also includes the metadata bindings (MEX) so that non .NET platforms can access the WSDL.

  2. If you're building a non .NET client, then you'd be using a set of tools or a framework for that platform instead. That being the case, you would use different tools to create a proxy for your service from the WSDL instead.

Hope that helps.

Tim Roberts