SOAP Protocol





Simple Object Access Protocol (SOAP) is a protocol specification for exchanging structured information in the implementation of web services. It uses the XML Information Set for its message format and uses other protocols, notably Hypertext Transfer Protocol (HTTP) and the Simple Mail Transfer Protocol (SMTP) for message transmission.

Share tech news, updates, or what's on your mind.

Sign up to Post


I generated soap web services using Eclipse JEE, which then I deployed ( .war) on Tomcat 7.0 on Centos 7 -  this works fine.
The aim is to insert a data received in an xml and insert it to an Oracle table.

I've added the below code to a java class file, which meant to do some insert statement ( which is valid ) , with hardcoded values, just to prove I can do it.

    public void InsertValue(String MessageId, String value){

    	Connection con=null;

    	con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xxx", "xxx","xxx");
    	Statement s = con.createStatement();

    	s.execute("INSERT INTO ping_message (message_id,dstamp) VALUES ('1',To_char(SYSDATE))");
    	}catch(Exception e){
    	System.out.println("ERROR: "+e.getMessage());

Open in new window

Unfortunately, this does not work. I wonder if this is because of the java code or Tomcat needs some db drivers in order to establish a connection the database ?

btw, my java skills are being developed as I type this :)
Become a Microsoft Certified Solutions Expert
LVL 12
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Hi all, hoping one of you Gurus can assist please.

I have been using a payment system for many years but they have now changed one of their SOAP calls to an external URL. For the life of me I'm unable to connect without the following error:

"cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None). "

these are the binding info from their App.config file if it helps
        <binding name="BasicHttpBinding_IPortalService">
          <!-- Transport security is only required when the portal service is running under https, for http this should be set to None -->
          <security mode="Transport" />

Open in new window

I'm using PHP7 and have free run on the server to implement any of your suggestions. Previously I used cURL to simply create the SOAP XML, post if off and grab the response but having no luck here.

I cant post all the login details etc as it's payment and site specific but I'm after being initially able to at least connect to the SOAP URL below, and get a more valid error (for example, invalid user logon) etc.

Ok, here's the details:

Action required is "Invoke" for which I believe the following should be the right XML to be sent:

Open in new window

Hi Guys,

I wonder if anyone has any experience in calling an oracle procedure/function using APIs ?
I've been reading about JDeveloper, APEX and Oracle App server and I'm a little bit confused with all my findings and the best approach.
What I need is
1. receive a SOAP API call
2. Trigger an oracle function
3. Send a response back

I have already a web server running ( hosted web app - Apache-HttpClient). However, an oracle is on a different box.
I was sending XML in SOAP envelope to a web consuming server here at Lone Star. The Web consuming service has now switched from XML to JSON. Does the SOAP envelope change? If so in what way? I'm attaching the actual output to the Web Service. Using Krengeltech's RPG-XML to generate the XML data formatted and wrapping it in the SOAP envelope. Krengeltech also has a JSON api to perform the data mapping in JSON instead of XML. I need help creating the 'wrapped' soap statements

Given the below soapclient - how can I a) check the version of tls that it is using, and b set it to 1.2 if it is not using that already?  I had assumed the browser I was using would control that side of things, but just want to double check!

$url = "https://www.SOMEURL/interface/api/report.asmx?wsdl";
//Create the client
$client = new SoapClient($url);
$datetimestamp = date("YmdHis");
$reportname = "report".$datetimestamp;

Open in new window

your help is very much appreciated!

In attempting to consume a PHP Zend AutoDiscover SOAP Service in a .Net client using a WebRequest, I'm getting this error:

    Procedure 'ProAddRq' not present

    class Program
        static void Main(string[] args)
            FileStream fileStream = new FileStream(@"C:\wamp\www\PT\Request.xml", FileMode.Open, FileAccess.Read);
            byte[] buffer = new byte[fileStream.Length];
            int count = fileStream.Read(buffer, 0, buffer.Length);
            WebRequest myWebRequest = WebRequest.Create(@"http://localhost/PT/PTradersvc.php#ProAddRq");
            // If I change the request URL to this, I get the same error
            // WebRequest myWebRequest = WebRequest.Create(@"http://localhost/PT/PTradersvc.php");
            // If I change the request URL to this, I get the WSDL returned
            // and no error.
            // WebRequest myWebRequest = WebRequest.Create(@"http://localhost/PT/PTradersvc.php?wsdl");
            myWebRequest.ContentLength = buffer.Length;
            myWebRequest.ContentType = "application/xml";
            myWebRequest.Method = "POST";

            Stream stream = 

Open in new window

I am making SOAP request with POST method which is having authentication added in the request header and request payload is being passed as XML String.

Below is the reference code:

package org.test.integration;




public class SoapRequestTest2 {
    public static void main(String args[]) throws MalformedURLException,
    IOException {

    //Code to make a webservice HTTP request
    String responseString = "";
    String outputString = "";
    String wsURL = "";
    URL url = new URL(wsURL);
    URLConnection connection = url.openConnection();
    HttpsURLConnection httpConn = (HttpsURLConnection)connection;
    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    String xmlInput =
            "<soap:Envelope xmlns:soap=\"\">"
                     +"<ns1:findItem xmlns:ns1=\"\">"
                     + "<ns1:findCriteria xmlns:ns2=\"\">"

Open in new window

I have a Zend SOAP server and in my client, I set the version using this code:
    $options = array();
    $options['cache_wsdl'] = false;
    $options['soap_version'] = SOAP_1_2;
    $client = new Zend\Soap\Client("", $options);

Open in new window

I get this exception:    
SoapFault exception: [VersionMismatch] Wrong Version

I have tried with SOAP_1_1 and SOAP_1_2 and still get the same exception.
What am I missing here?

The service is installed on a CentOS 6.9 VirtualBox with PHP 5.6.36 installed to mock our production environment. Please do not suggest that I update to PHP7+, I have no control over the production server, I'm just building a mockup for testing.

From my PHP.ini:
    Soap Client                  enabled
    Soap Server                  enabled
    Directive                    Local Value                Master Value
    soap.wsdl_cache                    1                        1
    soap.wsdl_cache_dir          /var/lib/php/wsdlcache        /tmp
    soap.wsdl_cache_enabled            1                        1
    soap.wsdl_cache_limit              5                        5
    soap.wsdl_cache_ttl             86400                     86400

Open in new window

I'm trying to make a SOAP connection to a remote server that is enforcing TLS 1.2.  I'm getting a "SECURITY VIOLATION" error, which is due to the connection not going over TLS (according to the remote host).  

I tried adding SSLContext, but that doesn't seem to do the trick.  Can anyone point me in the right direction?

    private static void callSoapWebService(String soapEndpointUrl, String soapAction) {
        try {
            SSLContext sc = SSLContext.getInstance("TLSv1.2");
            sc.init(null, null, new;
            // Create SOAP Connection
            SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
            SOAPConnection soapConnection = soapConnectionFactory.createConnection();

            // Send SOAP Message to SOAP Server
            SOAPMessage soapResponse =, soapEndpointUrl);

            // Print the SOAP Response
            System.out.println("Response SOAP Message:");

        } catch (Exception e) {
            System.err.println("\nError occurred while sending SOAP Request to Server!\nMake sure you have the correct endpoint URL and SOAPAction!\n");
When communicating with SSAS msmdpump via SOAP requests Analysis services returns with Content-Types that are compressed and in binary XML (Content_type: xs+xpress).

We would like to include an extra layer of abstraction between the client and Analysis services and would like to know if there is a way to have Analysis services send back plain XML or how to read the xs+xpress content-types.
Introduction to R
LVL 12
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.


I need to use a SOAP interface of the Dogana in Italy.
I develop some code in delphi (berlin) using SOAPHTTPClient, but i become always this error:

"Impossibile passare dalla codifica corrente a quella specificata.
Line: 1
<?xml version="1.0" encoding="utf-8"?><s."

I try
HTTPRIO.Converter.Encoding := 'UTF-8';

Thank you for the help.

I'm trying to build a server for another soap server to call and give back a soap response in PHP and NuSoap.

The soap service that will be sending the request is here
Now, this service will send me a request that I'm supposed to parse, then query some data and send back a response.

I have built a simple server and client for testing but I'm getting nowhere, nothing but errors from NuSoap. I am also seeing this as an error:
wsdl error: Bad path to WSDL file ://IBMSSimpleTypes.xsd

I cannot find IBMSSimpleTypes in any file on my local web server.

Not sure what the problem is as I have never written this in PHP before.

Can anyone help out here?

require_once "./lib/nusoap.php";

$server = new soap_server('InventoryOptionsService.wsdl'); // contains a local copy of the wsdl from the service


    function SubmitInventory($request) {
        echo $request;

Open in new window

require_once "./lib/nusoap.php";
$client = new nusoap_client("InventoryOptionsService.wsdl", true);

$error = $client->getError();
if ($error) {
    echo "<h2>Constructor error</h2><pre>" . $error . "</pre>";
$request = file_get_contents("RequestExample.xml");

$result = $client->call("SubmitInventory", $request);

if ($client->fault) {
    echo "<h2>Fault</h2><pre>";

Open in new window

I have the following JavaScript making a call to a PHP page:

	function callPhpAPI(youdata) {
		$.post( "", { mes: youdata } );

Open in new window

PHP page:



    $emailto = '';
    $toname = 'Tom';
    $emailfrom = '';
    $fromname = 'xxx';
    $subject = 'activity on xxx detected:  ' + $mes;
    $messagebody = 'There was a page hit on xxx:  ' + $mes;
    $headers = 
        'Return-Path: ' . $emailfrom . "\r\n" . 
        'From: ' . $fromname . ' <' . $emailfrom . '>' . "\r\n" . 
        'X-Priority: 3' . "\r\n" . 
        'X-Mailer: PHP ' . phpversion() .  "\r\n" . 
        'Reply-To: ' . $fromname . ' <' . $emailfrom . '>' . "\r\n" .
        'MIME-Version: 1.0' . "\r\n" . 
        'Content-Transfer-Encoding: 8bit' . "\r\n" . 
        'Content-Type: text/plain; charset=UTF-8' . "\r\n";
    $params = '-f ' . $emailfrom;
    $test = mail($emailto, $subject, $messagebody, $headers, $params);
    // $test should be TRUE if the mail function is called correctly



Open in new window

The email IS being sent, but the PHP variable $mes that I am attempting to make use of has a problem.

The email when it arrives looks like this:


What I expected was to see the following subject and message body:

subject: 'activity on xxx detected:  content of param passed in
message body: 'There was a page hit on xxx:  content of param passed in

If I remove the $mes PHP variable I am trying to append to the end of the subject and message body (above) -- the subject and message body come through GREAT, minus the custom message(which is the entire point of all this)

I am requesting a web service through an xml, I verify the answer with the Fiddler tool and it returns an Http 200, but the answer as such does not return the information that the web service should send me but it returns the wsdl of the same. I do not know if you are making any mistakes in the programming, please help me.
Our company is moving some components to our internal cloud and I am working in a project and one of the task is to expose an existing legacy java class as soap web service. Can anyone please help me stir in the right direction? How can  I write a soap Producer on existing new class and methods? Should I write a new class and extend this class or should I write a subclass? What is the best  way  to approach  this?I  am new  to integration projects. The company is using  Mule  Esb as an integration solution? Also how Mule esb fitst together  with all this?I am new to  Mule  esb.
with the help of experts on this exchange i managed to cobble together this code
it does work almost, but it produces a text file and not an xml document file, or i am not smart enough to load the xml document.
So any help would be appreciated

Sub plireader()
'On Error Resume Next

'CEMgetattendance -  CLETracker
'DEV_getattendance -152413

Dim strrequest As String
Dim objhttp As Object
    strXmlToSend = "<company>CLETracker</company>"
    '    strXmlToSend = "<company>CLETracker</company>"

webserviceurl = ""

 Set objhttp = CreateObject("Msxml2.XMLHTTP.6.0")
MsgBox "send now"
  strrequest = "<?xml version=""1.0"" encoding=""utf-8""?>" _
               & "<soap:Envelope xmlns:xsi="""" xmlns:xsd="""" xmlns:soap="""">" _
               & "<soap:Body>" _
               & "<CEMgetAttendence xmlns="""">" _
               & "<company>CLETracker</company>" _
               & "</CEMgetAttendence>" _
               & "</soap:Body>" _
               & "</soap:Envelope>"
Dim resp As String

MsgBox strrequest
objhttp.Open "POST", webserviceurl, False
objhttp.setRequestHeader "SOAPAction", ""

objhttp.setRequestHeader "Content-Type", "text/xml"
objhttp.send (strrequest)
  ' resp = http.HttpGetText(url)
I am trying to get XML validation working for a SOAP server but I've run into a couple of issues.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns=""
  <xsd:element name="Alive">
          - Alive is sent periodically to verify the connection status

Open in new window

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="" xmlns:soap-enc="" xmlns:xsd="" xmlns:xsi="">

Open in new window

First Issue:
SOAP elements are not being recognized.
Validator Output: Cannot Find The Declaration Of Element 'soap:Envelope'., Line '1', Column '225'.
I found a Stack Overflow thread describing the same issue but the described solutions do not work for me.

Second Issue:
Even if I remove the SOAP elements, I still have a namespace issue.
Validator Output: Cannot Find The Declaration Of Element 'Event'., Line '1', Column '8'.

I have a webservice that I,m trying to apply a custome security, when I try to call the service it display the following error:">a:FailedAuthentication

At least one security token in the message could not be validated.

To add the security I modify the service config file:

[b][b]<services> <service name = "WcfService1.Service1"> <endpoint address="" binding="customBinding" bindingConfiguration="customBindingOasis" contract="WcfService1.IService1"> <headers> <wsse:Security xmlns:wsse=""> <wsse:UsernameToken> <wsse:Username>USERNAME</wsse:Username> <wsse:Password Type="">PASSWORD</wsse:Password> </wsse:UsernameToken> </wsse:Security> </headers> </endpoint> </service> </services> <bindings> <customBinding> <binding name ="customBindingOasis"> <security authenticationMode="UserNameOverTransport" includeTimestamp="false" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> <secureConversationBootstrap /> </security> <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap12" writeEncoding="utf-8"> <readerQuotas maxDepth="32"

I have this WCF service that works fine using soap1. I'm trying to change it to run in soap1.2 but I have not been able.

I have try changin diferents things in the webconfig.

First I change the basicHttpBinding for wsHttpBinding.  I also change the protocol , remove the soap1.1 and add the soap 1.2

How I can made that my WCF web service run in soap1.2?
Exploring SharePoint 2016
LVL 12
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

I am part of a development for a SOAP web services client on WCF/.NET. After a session of sending request, team for server side left feedback "extend someAction from schema i am mentioning below", and mentioned an URL. In this context, what does it mean to extend from schema?
I'm trying to use a webservice (.net if it matters).
Using the code directly below I get a response.
$options = array(
	'username' => "myusername",
	'password' => "mypassword"


$url = "";

$client = new SoapClient($url);
$fcs = $client->__getFunctions();

Open in new window

I get a return so thinking something is working (shortened below):
array:145 [▼
  0 => "UNKNOWN ActivityChange(UNKNOWN $par)"
  1 => "UNKNOWN Admin(UNKNOWN $par)"
  2 => "UNKNOWN DirectIntefaceTest3(UNKNOWN $par)"
  3 => "UNKNOWN DirectIntefaceTest(UNKNOWN $par)"
  4 => "UNKNOWN LogEntryGet(UNKNOWN $par)"
  5 => "UNKNOWN LogEntryDetails(UNKNOWN $par)"
  6 => "UNKNOWN SystemUploads(UNKNOWN $par)"
  7 => "UNKNOWN TestUpload(UNKNOWN $par)"
  8 => "UNKNOWN AppointmentGet(UNKNOWN $par)"

Open in new window

I'm trying to use the AppointmentGet. Trying below:
$params = array(
	'AppointmentSince'  =>'2017-07-11T07:00:00',
	'AppointmentUntil'  =>'2017-07-11T012:00:00',
	'SerialNumber'		=> '9999'

$response = $client->__soapCall('AppointmentGet', $params);
$response = $client->AppointmentGet($params);

Open in new window

Regardless same error:

SoapFault in TestController.php line 70: Internal Server Error
(line 70 being the $response line)

The company that provides the service has some documentation:

Any ideas?
we are in need of technical help to achieve secure comms using secure Soap (certificated) to a government web-service.
We have to send and receive encrypted SHA256 xml content as the payload using SSL transport.
Is this an area in which you have expertise?
If so, we are prepared to pay for consulting/help if a working result can be achieved.
If you have expertise here, and are able to offer guidance, then we can send real code and proper full description of our problems.
Justin Graham.
New Zealand (GMT + 12)
How do I retrieve the values of the SOAP Fault message to display to the user by using classical asp?
I am sending an xml document and they use SOAP authentication.
I have attached a snapshot of the message, and its a valid error message.
 I just need to retrieve and display the SOAP FAULT values.

After researching, I know I need to extract the child nodes but I can not quite it right.
I know its XML and I should be able to extract the fault string, actor and message I couldn't find what was the best way .
I am thinking in the savdoc I should  try to extract the  child node <faultstring>.
Any help appreciated.
Below is my code for sending/receiving XML etc. It works fine.
    url = ""
    Set objXMLHTTP = server.Createobject("MSXML2.ServerXMLHTTP")
    objXMLHTTP.Open "POST", url, false
    objXMLHTTP.setRequestHeader "Content-Type", "text/xml" 
    objXMLHTTP.send xmlmsg

   strResult= objXMLHTTP.ResponseText
   strStatus = objXMLHTTP.StatusText
   savdoc = objXMLHTTP.ResponseText


Open in new window


There is also helpful tutorials on for JMeter, you don't have to use BlazeMeter but they do allow you to import your JMeter .jmx file and run tests if that is a route you want to go.

I am reading as above. I wonder what are difference between JMeter Vs BlazeMeter, advantages, disadvantages, practical uses.Please advise
If you're using SOAP to send authentication (username and password) and data from one site to another, is the authentication details secure? Can it be intercepted? In particular I'm authenticating and sending the data to SharePoint 2013.

SOAP Protocol





Simple Object Access Protocol (SOAP) is a protocol specification for exchanging structured information in the implementation of web services. It uses the XML Information Set for its message format and uses other protocols, notably Hypertext Transfer Protocol (HTTP) and the Simple Mail Transfer Protocol (SMTP) for message transmission.

Top Experts In
SOAP Protocol

No Top Experts for this time period. Answer questions to earn the title!