Issue in SOAP message generated by Embarcadero - soap

I have created an application developped by Embarcadero XE5 C++. I use THTTPRio to consume a web service.
I have a problem with the request message generated by our application. It seems that namespaces are missing in the soap message for NS1, NS2 and NS3.
I think there's a bug in the Embarcadero.
Here the SOAP request message generated by Embarcadero:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<G110Request xmlns="urn:wsdltypes.nmvs.eu:v1.0">
<Header xmlns="urn:types.nmvs.eu:v1.0">
<Auth>
<ClientLoginId>xxx</ClientLoginId>
<UserId>xxx</UserId>
<Password>xxx</Password>
</Auth>
<UserSoftware NS1:name="xxxxx" NS2:supplier="xxxx"/>
</Header>
<Body xmlns="urn:types.nmvs.eu:v1.0">
<Product>
<ProductCode NS3:scheme="GTIN">1234567891234</ProductCode>
</Product>
</Body>
</G110Request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Thanks for your help

Related

How to retrieve Sabre profile using SOAP API

I'm trying to use the Sabre SOAP API to retrieve a profile. I'm using the SOAP template here (https://developer.sabre.com/guides/travel-agency/developer-guides/soap-apis-request-format) with the specifics here (https://developer.sabre.com/sabre_hospitality/apis/soap_apis/hotel/profile/read_profile). I'm able to get a BinarySession token ok using the SessionCreateRQ request ok. It starts with the text "Shared/IDL:IceSess/SessMgr".
My request looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Header>
<eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="1.0">
<eb:From>
<eb:PartyId />
</eb:From>
<eb:To>
<eb:PartyId />
</eb:To>
<eb:CPAId>ipcc</eb:CPAId>
<eb:ConversationId>conversationID</eb:ConversationId>
<eb:Service>OTA_ReadRQ</eb:Service>
<eb:Action>OTA_ReadRQ</eb:Action>
<eb:MessageData>
<eb:MessageId>mid:20001209-133003-2333#clientofsabre.com</eb:MessageId>
<eb:Timestamp>2001-02-15T11:15:12Z</eb:Timestamp>
<eb:TimeToLive>2001-02-15T11:15:12Z</eb:TimeToLive>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">MY SECURITY TOKEN GOES HERE</wsse:BinarySecurityToken>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<eb:SoapAPIServiceActionCode>
<OTA_ReadRQ Version="1" EchoToken="1122" PrimaryLangID="en" xmlns="http://www.opentravel.org/OTA/2003/05">
<ReadRequests>
<ProfileReadRequest>
<UniqueID Type="1" ID="14EF985B2C" ID_Context="crs">
<CompanyName CodeContext="hotel" Code="10001"/>
</UniqueID>
</ProfileReadRequest>
</ReadRequests>
</OTA_ReadRQ>
</eb:SoapAPIServiceActionCode>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
But when I do this I get the error:
<soap-env:Fault>
<faultcode>soap-env:Client.InvalidAction</faultcode>
<faultstring>Action specified in EbxmlMessage does not exist.</faultstring>
<detail>
<StackTrace>com.sabre.universalservices.base.exception.ApplicationException: errors.xml.USG_INVALID_ACTION</StackTrace>
</detail>
</soap-env:Fault>
Can anyone advise where I'm going wrong?
Try to use <eb:Action>OTA_ProfileReadRQ</eb:Action> instead.
Sabre responds with OTA_ProfileReadRS, so I suppose the Action code may contain "ProfileRead" as well.
First of all you must have permission in your iPCC/EPR the authorization to use this service.
The faultstring="Action specified in EbxmlMessage does not exist." error was in <eb:Action>OTA_ReadRQ</eb:Action>.
You can read more details about the hospitallity services in:
https://github.com/SabreDevStudio/get-hotel-avail-v2-sample-nodejs
https://github.com/SabreDevStudio/get-hotel-details-sample-nodejs
https://github.com/SabreDevStudio/hotel-price-check-v2-sample-nodejs

Version mismatch from SOAP API

I am calling SOAP API from postman with following request.
<?xml version="2.0" ?>
<Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<get xmlns:S="http://xml.abc.com/cde/2.xsd" xmlns:S="http://ws.abc.com/cde.2">
<sid>2</sid>
</get>
</Body>
</Envelope>
But, it is giving following response.
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
<faultcode>S:VersionMismatch</faultcode>
<faultstring>Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got </faultstring>
</S:Fault>
</S:Body>
</S:Envelope>
Can someone help me, what am I doing wrong.
Your Soap Envelope namespace is incorrect, your request should be something like--
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
<ns1:get xmlns:ns1="http://ws.abc.com/cde.2">
<ns1:sid>2</ns1:sid>
</ns1:get>
</soap:Body>
</soap:Envelope>
It is related to the SOAP version. SOAP 1.2 uses http://www.w3.org/2003/05/soap-envelope for the namespace and SOAP 1.1 uses http://schemas.xmlsoap.org/soap/envelope/.
For reference, see http://www.w3.org/TR/soap/ and look at the envelope section in the different version specs.

How to remove soap namespace from Envelope using Apache CXF

I am trying to access a 3rd party web service using Apache CXF 3.1. When I call the service with the wsdl2java generated code or curl the service returns an exception indicating the message is not a valid SOAP message. See the message below.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<connectivityTest xmlns="urn:cdc:iisb:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="connectivityTest">
<echoBack>Hello IIS!</echoBack>
</connectivityTest>
</soap:Body>
</soap:Envelope>
When I remove the namespace (soap:) and call the service using curl the service works. See working message below.
<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
<Body>
<connectivityTest xmlns="urn:cdc:iisb:2011" xmlns:ns2="http://www.w3.org/2003/05/soap-envelope">
<echoBack>Hello IIS V2!</echoBack>
</connectivityTest>
</Body>
How do I remove the namespace from the Envelope and Body elements of my SOAP message before it sent? Based on searching the web it looks like I may need to create an interceptor. If some one can provide an example of an interceptor to remove the namespace from the Envelope and Body elements it would be much appreciated.
Thanks in advance!
JR
No Interceptor is required for this. You can configure the namespace in your jaxws properties.
<jaxws:properties>
<entry key="soap.env.ns.map">
<map>
<entry key="" value="http://schemas.xmlsoap.org/soap/envelope/"/>
</map>
</entry>
<entry key="disable.outputstream.optimization" value="true"/>
</jaxws:properties>

coldfusion publish webservice using SOAP

I am trying to create a web service that can be consumed with SOAP. I were exercising with normal webservices that returns any values, but know i want to check which elements in the SOAP:BODY are needed and return them with a response. I found the methods
GetSoapRequest()
and
AddSoapResponse()
in the livedoc from adobe, but don't understand how to use them.
I saw the explenation of a request and response on w3school.com
i tried to solve the Problem with the tags "cfsavecontent"
<cffunction
name="soap"
access="remote"
returntype="any"
output="false">
<cfsavecontent variable="soapMessage">
<?xml version="1.0">
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
</soap:Header>
<soap:Body>
<m:GetPriveResponse xmlns:m="namespace">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
</soap:Envelope>
</cfsavecontent>
but it only works, if the cffunction has returntype="any". The type "xml" occurs an error.
thx for helf
The easiest way to create a web service in CF, see
Creating components for web services http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec13a13-7fe2.html
Publishing web services
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-78b7.html
I just installed the soapUI eclipse addon and called the WSDL that includes an argument of a complexe type. After testing the methods of my web service with the addon, I got the SOAP-Message I was searching all the time. Maybe it will help anybody, i just where searching long time for this solution.
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:com="http://components.conner.somebody">
<soapenv:Header/>
<soapenv:Body>
<com:echoAddress soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<input xsi:type="com:Address">
<City xsi:type="xsd:string">?</City>
<Country xsi:type="xsd:string">?</Country>
<State xsi:type="xsd:string">?</State>
<Street xsi:type="xsd:string">?</Street>
</input>
</com:echoAddress>
</soapenv:Body>
</soapenv:Envelope>
Here is the method of the coldfusion component that will be called
<cffunction
name="echoAddress"
returnType="address"
output="false"
access="remote">
<cfargument
name="input"
type="address">
<cfreturn #arguments.input#>
</cffunction>

PHP SOAP server is sending back a partial response

I've written a SOAP service so my Silverlight application can add entires into my database. The server is written in PHP, and in order to test everything, I've written a PHP client.
My client seems to be sending its request correctly. This is what is generated when I call _getLastRequest():
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:blogPosts"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:saveBlogPost>
<userId xsi:type="xsd:int">1</userId>
<catId xsi:type="xsd:int">1</catId>
<subCatId xsi:type="xsd:int">1</subCatId>
<title xsi:type="xsd:string">Web Service Test</title>
<blogPost xsi:type="xsd:string">Testing</blogPost>
</ns1:saveBlogPost>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
However, when the server responds, only a partial message appears:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:blogPosts"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:saveBlogPostRe
The error message I receive is "looks like we got no XML document".
Any help you could provide would be greatly appreciated.
My solution: forget SOAP and use REST :)