WCF - cross-platform issue

I have a simple WCF service, my own hosting and .net client. I am creating a proxy using svcutil. When I add a proxy to the client, it asks to add System.ServiceModel.dll. Well, I can add it, as this is a test case, and I work on the .NET platform.

However, suppose I use a machine that does not support .Net, how will this platform compensate for System.ServiceModel?

Could you talk about this?

EDIT: I have an idea. If I create a WCF client, I need to add a ServiceModel. To test this, I added the ASMX client (Add Web Link). My mthod service does not accept any parameters. But I get an error in the client asking me to enter int Result, out bool ResultSpecified. Could you explain why?

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

thanks

Lijo

+1
source share
5 answers

The odd question. If the client is not a .NET application, it obviously will not need System.ServiceModel . Clients can be written using any other SOAP library in any language used by the application.

+2
source

This will be compensated by eliminating the exception. you need a .NET platform to run .NET applications. For a cross platform, you can take a look at Mono .


Sorry, I misunderstood your question. If you discover the endpoint using basicHttpBinding , any client that matches the WS-I 1.1 base profile can use the web service without problems. This is the most compatible binding.

+1
source

I think there are two questions here:

  • If you host the service yourself, but want clients that are not built using .NET to have access to it, perhaps you should consider placing it in IIS. In addition, you will need to make sure that your hosting application also includes metadata bindings (MEX) so that .NET platforms cannot access the WSDL.

  • If you are creating a non-.NET client, then instead you will use a toolbox or framework for this platform. In this case, you would use various proxy creation tools for your service from WSDL.

Hope this helps.

+1
source

To eliminate the need for two external parameters that are generated in the web service proxy, use the [XmlSerializerFormat] attribute in the operation contract. After regenerating the proxy, the method signature should match your definition, and not convert the return type to the Result and ResultSpecified data type, indicating whether the return variable is present.

+1
source

Source: https://habr.com/ru/post/911759/


All Articles