Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use WCF service without proxy client

I have an application which can just send SOAP messages and parse responses. My WCF service works fine if i use proxy client, but i need to have ability just send POST request in SOAP format as it was in old ASMX services. Is there any possibility to do it?

I tried copy SOAP request from debug wcf client and send it as POST request with Content-Type text/xml but it doesn't give me a correct result.

like image 672
Yaroslav Avatar asked Feb 19 '23 01:02

Yaroslav


2 Answers

Yes, you can call them using a "plain" HTTP request - after all, as far as the server is concerned all it receives are bytes in a TCP connection. Depending on the binding which you're using, you may also need to set some HTTP header - if you're using BasicHttpBinding on your service, you'll also need to set the SOAPAction header. Try sending your request, and your request from a client using a WCF proxy, and compare them in a tool such as Fiddler. If the requests are the same, the server will respond them the same as well.

like image 168
carlosfigueira Avatar answered Feb 26 '23 20:02

carlosfigueira


When I need to pass the full soap message by http web request, I use SoapUI. You can give it a WSDL and it does what the proxy does for code, but instead generates soap xml. And as @carlosfigueira mentioned you will want to look in the HTTP Headers section and set them appropriately.

www.soapui.org

like image 22
trouta Avatar answered Feb 26 '23 21:02

trouta