[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

SOAP Protocol

274

Solutions

406

Contributors

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

Hi Guys,

I'm having good fun doing my first web services and learning java, but I need your help ( again ).

Just to recap what I've done so far
1. using eclipse java ee I created Dynamic Web Project
2. I imported  a wsdl file to the project and generated web services (Top down Java bean ones)
3. I can take parameters from received requests and loaded them to Oracle database, which connection details are stored in config.properties file ( this pretty much works :) )

I've just been asked if it would be possible to grab a SOAP body and load it to an oracle table.

This is my class where web services requests are being consumed

/**
 * BasicHttpBinding_MS_aaa_WMS_ServicesImpl.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package com.bbb.WebServices;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.Statement;

import org.datacontract.schemas._2004._07.Dft_aaa_WebService.WMS_RequestData;
import org.datacontract.schemas._2004._07.Dft_aaa_WebService.WMS_RequestInfo;

public class BasicHttpBinding_MS_aaa_WMS_ServicesImpl implements com.bbb.WebServices.MS_aaa_WMS_Services{
    public com.bbb.WebServices.SendPing_WMSResponse sendPing_WMS(com.bbb.WebServices.SendPing_WMS parameters) throws java.rmi.RemoteException {
try {
			
			Connection con = null;
			

Open in new window

0
OWASP: Avoiding Hacker Tricks
LVL 12
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

I've a problem connecting via an MSSOAP.SoapClient to a web service.

The exact same call works on a different client.

Here is the code - this is in a VBS file:

set h = CreateObject("MSSOAP.SoapClient30")
h.ClientProperty("ServerHTTPRequest") = True 
url = "https://(myserver)/WebService.asmx?wsdl"
h.MSSoapInit(url)

Open in new window


This gets an error:

WSDLReader: WSDLReader:XML Parser failed at linenumber
0, lineposition 0, reason is: The system cannot locate the resource specified.
HRESULT=0x1: Incorrect function.
- WSDLReader:Loading of the WSDL file failed HRESULT=0x80070057: The parameter is incorrect.
- Client:One of the parameters supplied is invalid. HRESULT=0x80070057: The parameter is incorrect.

The same URL loads fine in the browser.

There is a very similar issue described here:
https://stackoverflow.com/questions/3374573/why-can-i-access-a-wsdl-file-from-a-browser-but-not-from-application 

In which the suggested resolution is to compare the traffic between the browser and the app using Fiddler.

However I can't seem to get Fiddler to intercept the traffic.

I've tried with and without this line:
h.ClientProperty("ServerHTTPRequest") = True


I'm on Windows Server 2008 R2
1
I have a strange SoapHeader issue, which requires me to show the actor and mustUnderstand in a security header which is part of my SoapHeader. I have 2 questions, how can i set the value of these 2 attributes and how can i place them in my Security Element which is part of the SoapHeader.

This is what it should look like
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
    <Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" soapenv:actor="" soapenv:mustUnderstand="0">
          <UsernameToken>
              <Username>user</wsse:Username>
              <Password>password</wsse:Password>
          </UsernameToken>
    </Security>
</soapenv:Header> 

Open in new window

0
Recently got frustrated trying wsimport on several old SOAP sites. Found out its all been deprecated so no SOAP sites to run wsimport on.
Can anyone give me a few just to see that wsimport is working as I expect it should?
I would appreciate a chance to test these things also .
So other than web pages processing JAX-RS(Restful) links exactly what if anything is equivalent to WSDLs in the JAX-RS world
I mean put, post, get delete insert? httpd protocol.
Help ASAP
0
I'm using EncryptedXML to decrypt a SOAP message.  I'm loading the certificate manually and trying to decrypt the message.  But I'm getting the following error:

Unable to retrieve the decryption key.

Open in new window


Here is my code:
stream.Position = 0;
var doc = new XmlDocument();
doc.PreserveWhitespace = true;
doc.Load(stream);

var clientCertEnc = new X509Certificate2(@"C:\certificates\xxxxxt.pfx", "xxxxxx");
var privateKeyRSAA = (RSACryptoServiceProvider)clientCertEnc.PrivateKey;

var exml = new EncryptedXml(doc);
exml.AddKeyNameMapping("KeyIdentifier", privateKeyRSAA);
exml.DecryptDocument();

Open in new window


Here is my xml:
<s:Envelope 
        xmlns:s="http://www.w3.org/2003/05/soap-envelope" 
        xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <s:Header>
            <VsDebuggerCausalityData 
                xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo4tYpt6X40FEk+VSAe5mc8MAAAAAP497cBuXfk+uFIOY80O0iuLtIW56q7hLktgVYPhbnHMACQAA
            </VsDebuggerCausalityData>
            <o:Security s:mustUnderstand="1" 
                xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                <o:BinarySecurityToken u:Id="uuid-10490fb0-8ee0-4a4c-a8db-77242c9a3b7f-2" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" 

Open in new window

0
Hi,

I'm in the process of developing an eBay application in Microsoft Access 2016. So far my project has been fine and the API calls I have made have been successful but I have now come to a stumbling block that I need some help with.

The API calls I have used so far are all for single listings so this is easy and I just pass the XML through an HTTP request. I want to make this much more efficient and use eBay's File Transfer API where I can send more than 1 call at a time but I'm really struggling on trying to understand how to build the call.

The data has to be sent as Binary Base64 which I have a converter to do this. I can build the XML that needs to be sent but I just don't understand how to send the XML from a string as apposed to a physical file.

I've read loads on the internet about having to create it as a multipart request with boundaries but really not sure how to start building that. I can provide code if need be so you can see where I am at.

I hope this makes sense.
0
I'm trying to figure out why I can't seem to decrypt an encrypted key from .NET with a X509 Certificate.  

.NET Code
encryptedKey = "jW3VDsUZWIdzfZ1bPN3iKI2Pf9u22kUax0DFnF3A9H+nvcBQuVC2efw1FYGm5/AvnN27kXqA4PyCqcQLp/tguVqHtzdR7mJtkTCyY8TUoAej2Mqzv2uiEKULB/8rlPDl2DOkSMGJqieenAG/7gZjWhlU0eYrlcMi5dtAnPFTfy+LvtJ6bbGEDgy4FhoT49T6sO0kjBJHp5YI0p/CeEuc+WMT/BMGG1YuDPswltj0VzeaE3KbHSLvJPjGCQ3U0YkUWm8h9zM22S/mRvfMhEu1aRdQpojGUiSLKUJyotNu8fRulKeB1TVuE7AlDGrbAUsRtU+y6PdLMcEHW+BRq5Uouw==";

var encryptedKeyByte = Convert.FromBase64String(encryptedKey);

var clientCert = new X509Certificate2(@"C:\certificates\xxxxx.pfx", "xxxx");
var rsa = (RSACryptoServiceProvider)clientCert.PrivateKey;
byte[] key = rsa.Decrypt(encryptedKeyByte, false);

Open in new window


The error I get when I try to run the last line of the code rsa.Decrypt(encryptedKeyByte, false)
The parameter is incorrect.


In SOAP UI the decryption works where I use the same certificate.  I just had to convert the file pfx to a jks file to get it working in SOAP UI.  But other than that the settings look the same to me.
Here is a screen shot of the SOAP UI settings.  I'm guessing the Signature Keystore in the SOAP UI seetings is not used for the decryption process.  The Decrypt Keystore settings in SOAP UI is the one I'm using in .NET.  Only in .NET its a pfx file.  
SOAP UI Settings
I also imported the certificate to my local box to see some of the details.  Here is what I see:
Certificate seen in MMCcertificate_properties_in_mmc_2.pngCertificate seen in MMC
Please let me know if you need me to provide any other information or need me to test something out.  Thanks in advance for your help.
0
I have a soap message that is signed with a x509 Certificate. How do I manually decrypt it. I would think this would be easy but I can't seem to figure it out.

I tried this example but it did not work for me.
https://stackoverflow.com/questions/20743256/how-to-decrypt-raw-soap-response-encrypted-with-x509
0
I'm using C# to call a Java Webservice.  Fiddler gives me a status of 200. So my call to the service is good.  But something in the .NET does not like my MTOM message.  Any ideas?  Here are all the details.  

I'm getting this error:
MTOM messages must have type 'application/xop+xml'.

Open in new window


The stack trace says:
Server stack trace: 
   at System.ServiceModel.Channels.MtomMessageEncoder.MtomBufferedMessageData.TakeXmlReader()
   at System.ServiceModel.Channels.BufferedMessageData.GetMessageReader()
   at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders, Boolean understoodHeadersModified)
   at System.ServiceModel.Channels.MtomMessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager, String contentType)
   at System.ServiceModel.Channels.HttpInput.DecodeBufferedMessage(ArraySegment`1 buffer, Stream inputStream)
   at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)
   at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(HttpRequestMessage httpRequestMessage, Exception& requestException)
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at 

Open in new window

0
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.

private void SendXmlToWebService()
        {            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(@"C:\inetpub\wwwroot\WsSAt\XmlPeticion.xml");
            StringBuilder rawXml = new StringBuilder();
            rawXml.Append(GetXmlString(xmlDoc));
            PostXml("http://10.181.236.3:9094/axis2/services/SISE_IDC?wsdl", rawXml.ToString());
        }

        static string GetXmlString(XmlDocument xmlDoc)
        {
            StringWriter sw = new StringWriter();
            XmlTextWriter xw = new XmlTextWriter(sw);
            xmlDoc.WriteTo(xw);
            return sw.ToString();
        }

        public void PostXml(string url, string xml)
        {
            byte[] bytes = Encoding.UTF8.GetBytes(xml);
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            request.Method = "POST";
            request.ContentLength = bytes.Length;
            request.ContentType = "text/xml; charset=utf-8";
            request.Host = "10.181.236.3:9094";
            request.Accept = "gzip,deflate";

            using (Stream requestStream =
0
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,
Is it possible, in Embarcadero delphi, to be connected to a WEB-Services SOAP (imported with WSDL-Import and with THTTPRIO component ) with a https connection and where the WebServices need a Certificate? How set the certificate?
I need an example.
Thanks,
0
Consuming ASPNET WSDL service using PHP
Hi Experts,
having some serious issues getting this one right. I am writing a PHP web app that needs to post an xml to an ASPNET WSDL service. Upon submitting data via PHP service it gives me an error "SoapFault exception: [s:Client] An error has occurred during service execution halting any further processing."
I then decided to use ReadyAPI and the error it gives is "HTTP/1.1 415 Cannot process the message because the content type 'multipart/related; type="text/xml"; start="<rootpart@soapui.org>"; boundary="----=_Part_0_2905742.1520010170903"' was not the expected type 'text/xml; charset=utf-8'."

Really baffled with this one. Have tried so many different soap codes to submit data and same response. any suggestions?
0
any one can help me for this php code
soap.php
0
I have a username and password for the real estates agent theysaid I have to call the web service and get a response but
How can I integrate to my theme in wordpress if u want to help me will be good or I can hire you too but I like to learn anny I wait for your answer guys thank you
0
Hi my soap client is not sending any xml request to the soap server. I tried sending data with wsdl link.

require_once('../libs/nusoap.php');
$client = new nusoap_client('http://url.com/wsdlfilelink', 'wsdl');

....

$merchantIDStruct = new stdClass();
$merchantIDStruct->name = 'merchant_id';
$merchantIDStruct->value = '1234567';

$detailArray = new stdClass();
$detailArray->item = $merchantIDStruct;

$parameters = new stdClass();
$parameters->details = $detailArray;
$parameters->billerRef = "RB_C1_RECO";
$parameters->payinstrRef = "RB_C1_RECO";

//$param_merchant_id = array( "merchant_id" => "5235437" );
//$parameters = array("Request" => $param_Request, "merchant_id" => $param_merchant_id);
$query = 'php';
 /* create the proxy object */
$proxyclientwsdl = $client->getProxy();
$result = $proxyclientwsdl->RECOstep1($parameters);


WSDL:

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:typens="urn:PaymentServer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="RECOstep1" targetNamespace="urn:PaymentServer">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:p="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="urn:PaymentServer">
<xsd:element name="Request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="billerRef" minOccurs="1" maxOccurs="1">
<xsd:simpleType>
0
I had this question after viewing New to SOAP and need some direction.
0
I need a step by step instruction how to build a soap web service using PowerBuilder 12.6 or 2017 in Classic.
0
Trying to consume webservice using wcf client, getting following error

The content type multipart/related; boundary=MIMEBoundaryurn_uuid_B50EC784A204DC07C91495512014914; type="text/xml"; start="<0.urn:uuid:B50EC784A204DC07C91495512014915@apache.org>"; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the  . The first 1024 bytes of the response were ...

Fiddler is showing the complete response but wcf is not able to deserialize the complete response. Response contains Japanese characters.
0
Example for WinRM  API using SOAP
0
Exploring ASP.NET Core: Fundamentals
LVL 12
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Here is my code :


import java.io.StringReader;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.springframework.ws.client.WebServiceIOException;
import org.springframework.ws.client.core.WebServiceTemplate;
import org.springframework.ws.soap.client.SoapFaultClientException;
import org.springframework.ws.soap.client.core.SoapActionCallback;

public class SpringWSClientSample {

      private static final String MESSAGE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope\" xmlns:web=\"http://www.webserviceX.NET\">"
                  + "<soapenv:Header>"
                  + "</soapenv:Header>"
                  + "<soapenv:Body>"
                  + "<web:ChangeMetricWeightUnit>"
                  + "<web:MetricWeightValue>40000</web:MetricWeightValue>"
                  + "<web:fromMetricWeightUnit>milligram</web:fromMetricWeightUnit>"
                  + "<web:toMetricWeightUnit>gram</web:toMetricWeightUnit>"
                  + "</web:ChangeMetricWeightUnit>"
                  + "</soapenv:Body>"
                  + "</soapenv:Envelope>";

      private final WebServiceTemplate webServiceTemplate = new WebServiceTemplate();

      public static void main(String[] args) throws Exception {

            SpringWSClientSample client = new SpringWSClientSample();
            client.simpleSendAndReceive();
      }

      public void simpleSendAndReceive() {
            try {
                  StreamSource source = new StreamSource(new StringReader(
                              MESSAGE.toString()));
                  StreamResult result = new StreamResult(System.out);
                  
0
I am using CXF, my question is two folds:

1) How can I generate a custom soap header for an outgoing response?

2) How can I inject some value from the implementation function?
0
When I run gSOAP client it gives me error :

"Validation constraint violation: tag name or namespace mismatch in element 'com.at.ecbs.CI19.GetOrderDetailsOutput'" Detail: [no detail]

But below is RECV.log :

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
                   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xmlns:typens="http://si.nat.at.com/WSAI/STAA/type/"
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
   <ns1:getOrderDetailsResponse xmlns:ns1="com.at.ecbs.CI19.CustomerInformation">
    <com.at.ecbs.CI19.GetOrderDetailsOutput>
      <supplCode>I25101</supplCode>
      <supplText>Order details extract successful</supplText>
      <pck>PCK&lt;01069FSGetOrderDetls3OSD1234567892017777777102126820072FlowStream123456</pck>
    </com.at.ecbs.CI19.GetOrderDetailsOutput>
   </ns1:getOrderDetailsResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Client code option set :

soap_mode iomode(SOAP_IO_KEEPALIVE| SOAP_XML_STRICT | SOAP_XML_TREE | SOAP_XML_IGNORENS);
 soap_mode omode(SOAP_IO_KEEPALIVE | SOAP_XML_TREE | SOAP_XML_DEFAULTNS );
 SOAP_CMAC::com_x002ebt_x002eecbs_x002eCI19_x002eCustomerInformationSoapBindingProxy …
0
I have a Drools Rule file which processes some business logic based on input from a java file and gives back output back to Java.

I need to get the response in a web service request and response format by passing data in SOAP format and snd get SOAP response. How can we do that?
0
Hi,
I am trying to create a SOAP Request xml from xpath map using membrane-soa api. If I try to set more than 10 values for unbound list I am not able to generate the tags for the values that are set beyond size of 10. Can any tried this? Can you please help?

Dharma
0
I am calling webservice to see next and coming up games for a certain soccer club ( it is Icelandic :) ).  I have working fla file where I call for status in a tournament,  with one variable in the request ( the number of tournament)
The code from that file:
import alducente.services.WebService;
import flash.events.*;

var ws:WebService = new WebService();
ws.addEventListener(Event.CONNECT, connected);
ws.connect("http://www2.ksi.is/vefthjonustur/mot.asmx?WSDL");
ws.cacheResults = true;
var initTime:Number;
function connected(evt:Event):void{
	ws.MotStada(done, "33903");	//called for "MotStada"(status in the tournament)"number of tournament",  
}
function done(serviceResponse:XML):void{
	namespace soap = "http://schemas.xmlsoap.org/soap/envelope/";
	namespace unnamed = "http://www2.ksi.is/vefthjonustur/mot/";
	use namespace soap;
	use namespace unnamed; 
	trace("\nWeb Service Result: ");
	trace(serviceResponse);
}

Open in new window


But for this I need to put in more, as shown in the example http://www2.ksi.is/vefthjonustur/mot.asmx?op=FelogLeikir 
How is that done?
Here is what I have done so far:

import alducente.services.WebService;
import flash.events.*;
var ws:WebService = new WebService();
ws.addEventListener(Event.CONNECT, connected);
ws.connect("http://www2.ksi.is/vefthjonustur/mot.asmx?WSDL");
//more info at http://www2.ksi.is/vefthjonustur/mot.asmx?op=FelogLeikir
//Call for games coming up for a club

ws.cacheResults = true;
var initTime:Number;
function connected(evt:Event):void{
	ws.FelogLeikir(done,"107"); /*<FelagNumer>String=107, <VollurNumer>String=All/not defined,<FlokkurNumer>String=111,<DagsFra>String=date from today, <DagsTil>String=date after ca 2months */
}
function done(serviceResponse:XML):void{ 
	trace("\nWeb Service Result: ");
	trace(serviceResponse);
}

Open in new window

0

SOAP Protocol

274

Solutions

406

Contributors

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
<
Monthly
>