We have the WSDL URL (or XML file) for a SOAP service we wish to call, and we want to know how to code it using Chilkat..

Step 1.

Download and install SoapUI Open Source from here:   https://www.soapui.org/downloads/soapui.html

Step 2.

Start SoapUI and create a New SOAP Project.  We’ll name ours “utah_mfet”  (this is for the State of Utah’s Motor Fuel Excise Tax SOAP Web Service).   When creating the new SOAP project, leave the initial WSDL empty.  Just give the project a name and create, leaving all options at the default values.

Step 3.

Right-click on the project you created (utah_mfet) and select “Add WSDL”.   The WSDL url for the Utah MFET SOAP service is https://tap.tax.utah.gov/efile/MFET/WSDL/   Paste this URL into the WSDL Location

Step 4.

You should now see some SOAP methods listed, such as NewSubmission, SubmissionListByDate, etc.    Expand NewSubmission by clicking on the “+”.   You should see Request1.   Double-click Request1.

Step 5.

You’ll see the following SOAP request body:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fas="http://www.fastenterprises.com">
<soapenv:Header>
<fas:MFETHeader>
<fas:User>?</fas:User>
<fas:Password>?</fas:Password>
<fas:Environment>?</fas:Environment>
</fas:MFETHeader>
</soapenv:Header>
<soapenv:Body>
<fas:SubmissionType>?</fas:SubmissionType>
<fas:ReferenceId>?</fas:ReferenceId>
<fas:File>cid:888300920562</fas:File>
</soapenv:Body>
</soapenv:Envelope>

You can paste the above XML into Chilkat’s online tool at https://tools.chilkat.io/xmlCreate.cshtml  to generate the source code that creates the given XML.  For example, in C# the generated code looks like this:

Chilkat.Xml xml = new Chilkat.Xml();
xml.Tag = "soapenv:Envelope";
xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/");
xml.AddAttribute("xmlns:fas","http://www.fastenterprises.com");
xml.UpdateChildContent("soapenv:Header|fas:MFETHeader|fas:User","?");
xml.UpdateChildContent("soapenv:Header|fas:MFETHeader|fas:Password","?");
xml.UpdateChildContent("soapenv:Header|fas:MFETHeader|fas:Environment","?");
xml.UpdateChildContent("soapenv:Body|fas:SubmissionType","?");
xml.UpdateChildContent("soapenv:Body|fas:ReferenceId","?");
xml.UpdateChildContent("soapenv:Body|fas:File","cid:888300920562");

Step 6.

In the SoapUI Request1 window, you will see a textbox with this URL:  https://txwgtwap5/efile/mfet/WSDL/
Change it to the actual endpoint.  In this case, we’ll use the test endpoint:  https://tapstaging.tax.utah.gov/efile/mfet/WSDL/

Step 7.

Click on the green triangle/arrow (top left of the Request1 windows) to send a POST.   We’re sending a POST with invalid XML, so it will fail, but at this point we’re only interested in examining the request that was sent.

Look at the bottom of the SoapUI window.  You’ll see a row of tab buttons:  SoapUI log, http log, jetty log, etc.

Select http log

Look for the POST.  Here’s what we see:

  • Wed Nov 21 11:15:49 CST 2018:DEBUG:>> “POST /efile/mfet/WSDL/ HTTP/1.1[\r][\n]”
  • Wed Nov 21 11:15:49 CST 2018:DEBUG:>> “Accept-Encoding: gzip,deflate[\r][\n]”
  • Wed Nov 21 11:15:49 CST 2018:DEBUG:>> “Content-Type: text/xml;charset=UTF-8[\r][\n]”
  • Wed Nov 21 11:15:49 CST 2018:DEBUG:>> “SOAPAction: “http://www.fastenterprises.com/MFET/NewSubmission”[\r][\n]”
  • Wed Nov 21 11:15:49 CST 2018:DEBUG:>> “Content-Length: 531[\r][\n]”
  • Wed Nov 21 11:15:49 CST 2018:DEBUG:>> “Host: tapstaging.tax.utah.gov[\r][\n]”
  • Wed Nov 21 11:15:49 CST 2018:DEBUG:>> “Connection: Keep-Alive[\r][\n]”
  • Wed Nov 21 11:15:49 CST 2018:DEBUG:>> “User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]”
  • Wed Nov 21 11:15:49 CST 2018:DEBUG:>> “[\r][\n]”
  • Wed Nov 21 11:15:49 CST 2018:DEBUG:>> “[\r][\n]”

The Content-Type and SOAPAction are the important header fields.   Chilkat will automatically add the Host and Content-Length headers.  The other headers (Accept-Encoding, Connection, User-Agent) are unlikely to be required/needed.

Step 8:

See the Chilkat example here:  SOAP Web Service (HTTP POST)

(links for the same example in other programming languages are shown below)

Make the following changes:

  1. The online example loads the SOAP XML body from a file.  The call to LoadXmlFIle can be replaced with the code snippet (above) that builds the XML.
  2. Change the SOAPAction to “http://www.fastenterprises.com/MFET/NewSubmission”
  3. Change the endPoint to “https://tapstaging.tax.utah.gov/efile/mfet/WSDL/”

That should do it.  Try sending the SOAP request using Chilkat.

 

Here are links for the SOAP example in other programming languages:

Android: SOAP Web Service (HTTP POST)
Classic ASP: SOAP Web Service (HTTP POST)
C: SOAP Web Service (HTTP POST)
Chilkat2-Python: SOAP Web Service (HTTP POST)
C++: SOAP Web Service (HTTP POST)
C#: SOAP Web Service (HTTP POST)
DataFlex: SOAP Web Service (HTTP POST)
Delphi ActiveX: SOAP Web Service (HTTP POST)
Delphi DLL: SOAP Web Service (HTTP POST)
.NET Core C#: SOAP Web Service (HTTP POST)
Excel: SOAP Web Service (HTTP POST)
Visual FoxPro: SOAP Web Service (HTTP POST)
Go: SOAP Web Service (HTTP POST)
Java: SOAP Web Service (HTTP POST)
Mono C#: SOAP Web Service (HTTP POST)
Node.js: SOAP Web Service (HTTP POST)
Objective-C: SOAP Web Service (HTTP POST)
Perl: SOAP Web Service (HTTP POST)
PHP ActiveX: SOAP Web Service (HTTP POST)
PHP Extension: SOAP Web Service (HTTP POST)
PowerBuilder: SOAP Web Service (HTTP POST)
PowerShell: SOAP Web Service (HTTP POST)
PureBasic: SOAP Web Service (HTTP POST)
CkPython: SOAP Web Service (HTTP POST)
Ruby: SOAP Web Service (HTTP POST)
SQL Server: SOAP Web Service (HTTP POST)
Swift 2: SOAP Web Service (HTTP POST)
Swift 3/4: SOAP Web Service (HTTP POST)
Tcl: SOAP Web Service (HTTP POST)
Unicode C: SOAP Web Service (HTTP POST)
Unicode C++: SOAP Web Service (HTTP POST)
Visual Basic 6.0: SOAP Web Service (HTTP POST)
VB.NET: SOAP Web Service (HTTP POST)
VBScript: SOAP Web Service (HTTP POST)
Xojo Plugin: SOAP Web Service (HTTP POST)