Client to send SOAP request and receive response

I normally use another way to do the same using System.Xml; using System.Net; using System.IO; public static void CallWebService() { var _url = “http://xxxxxxxxx/Service1.asmx”; var _action = “http://xxxxxxxx/Service1.asmx?op=HelloWorld”; XmlDocument soapEnvelopeXml = CreateSoapEnvelope(); HttpWebRequest webRequest = CreateWebRequest(_url, _action); InsertSoapEnvelopeIntoWebRequest(soapEnvelopeXml, webRequest); // begin async call to web request. IAsyncResult asyncResult = webRequest.BeginGetResponse(null, null); // suspend this thread … Read more

REST / SOAP endpoints for a WCF service

You can expose the service in two different endpoints. the SOAP one can use the binding that support SOAP e.g. basicHttpBinding, the RESTful one can use the webHttpBinding. I assume your REST service will be in JSON, in that case, you need to configure the two endpoints with the following behaviour configuration <endpointBehaviors> <behavior name=”jsonBehavior”> … Read more

Simplest SOAP example

This is the simplest JavaScript SOAP Client I can create. <html> <head> <title>SOAP JavaScript Client Test</title> <script type=”text/javascript”> function soap() { var xmlhttp = new XMLHttpRequest(); xmlhttp.open(‘POST’, ‘https://somesoapurl.com/’, true); // build SOAP request var sr=”<?xml version=”1.0″ encoding=”utf-8″?>” + ‘<soapenv:Envelope ‘ + ‘xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” ‘ + ‘xmlns:api=”http://127.0.0.1/Integrics/Enswitch/API” ‘ + ‘xmlns:xsd=”http://www.w3.org/2001/XMLSchema” ‘ + ‘xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/”>’ + ‘<soapenv:Body>’ + ‘<api:some_api_call … Read more