1

I need to call methods exposed by a wcf without specifying Action, how can I do? in the old web services services could be done by entering the attribute [SoapDocumentService (RoutingStyle = SoapServiceRoutingStyle.RequestElement)]

Thanks

Angelo
  • 101
  • 1
  • 9

1 Answers1

0

For compatible with the old web service, WCF provides Basichttpbinding, we can use httpclient/httpwebrequest/webclient to build the HTTP request, then add the HTTP header “SOAPAction” to specify action need to be invoked, also we can set a SOAP message directly, if we follow this, the first child element which under the BODY tag in SOAP message will specify the Action. enter image description here

For other WCF bindings, such as Webhttpbinding, you can specify Action in the URL, just like the Web API. In fact, we could generate the client proxy class by adding the service reference, and then use the client proxy class to invoke the service. enter image description here

Besides, you could use the svcutil.exe to generate the client proxy class from metadata documents. https://learn.microsoft.com/en-us/dotnet/framework/wcf/servicemodel-metadata-utility-tool-svcutil-exe

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22
  • I can not change the client call as it is an executable that makes calls without specifying the action, with the classic web service I solved with the date annotation indicated wcf side I have no idea how to do it. thanks for your kind response. – Angelo Nov 13 '18 at 11:32