cancel
Showing results for 
Search instead for 
Did you mean: 

Generating SOAP Envelope when DO NOT USE ENVELOPE option is marked

former_member737583
Participant
0 Kudos

My scenario: SPROXY => XI => 3rdParty WebService. Communication is synchronous. I've a problem with soap envelope. It is required by webservice, but when I use standard soap envelope generated by SAP I've a problem with receiving response from webservice.

So I want to create my own envelope. For this reason I've used DO NOT USE SOAP ENVELOPE option. Now the challenge comes. How can I create my own soap envelope?

Do you have any working example? Soap envelope should be added to message send from XI to 3rdParty WebService.

Helping answers => a lot of points

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

You can do this with xslt, which you put after your mapping:

<?xml version="1.0" encoding="UTF-8" ?> 
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <xsl:template match="/">
 <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP:Header /> 
 <SOAP:Body>
  <xsl:copy-of select="*" /> 
  </SOAP:Body>
  </SOAP:Envelope>
  </xsl:template>
  </xsl:stylesheet>

Does the response of the webservice not have an envelope?

Regards

Stefan

Answers (2)

Answers (2)

former_member737583
Participant
0 Kudos

It was general problem with webservice

Former Member
0 Kudos

Hi Tomasz,

hmmm... very strange requirement.. First, I think, the problem will be somewhere else. How do you know, the web service works with "other type" of soap envelope? Did you try it?

You can create another root tag (envelope in this case) by creating a target message with this tag. But in this case you can't use the definition from the WSDL. So create a new message type and use it in mapping.

I don't think there will be an option of creating tags in other namespaces, than the "original" one, so create am XSD of your message type, add additional namespace (or change them completely) and import this XSD to message mapping and use it in it.

(This is not an exact guide, just an idea, how it could be achieved).

Peter

former_member737583
Participant
0 Kudos

@Stefan Grube:

Response from WebService contains soap envelope

@ Peter Jarunek:

I spend a lot of time investigating what is going one and I'm almost 100% sure that html header used during soap request when DO NOT USE SOAP ENVELOPE is unchecked is a reason of HTTP 411 error. One of test which proof my idea is a situation when I use DO NOT USE SOAP ENVELOPE option and the I try to communicate with WebService. Generated HTML header during communication is different (some data in header are not filled - specially info about attachments) and I got response from WebService that send request do not contain valid data (soap envelope is missing).

So my idea is a generate SOAP envelope manually and just let XI to generate all the mappings and other stuff. If constructed such way request will fail, then I will know that problem is on my side

stefan_grube
Active Contributor
0 Kudos

Are there any specific fields missing in the standard SOAP header?

Then you can put this in the XSLT which I have provided.

Maybe you have a template for the required SOAP header to discuss.

Or do you mean: HTTP header? Then post a template for this.

Regards

Stefan

Former Member
0 Kudos

I think he meant HTTP header - 411 HTTP response.

http://www.checkupdown.com/status/E411.html

I just don't understand, wht would XI produce different HTTP header for these 2 cases.

Tomasz, can you send us a complete headers for both cases?

Peter

Edited by: Peter Jarunek on May 29, 2008 3:17 PM

former_member737583
Participant
0 Kudos

I'm talking about HTTP header.

When I'm sending SOAP request from SAP my whole message looks like when I use soap envelope


POST / HTTP/1.0
Accept: */*
Host: 192.168.132.179:54000
User-Agent: SAP-Messaging-com.sap.aii.messaging/1.0505
Content-ID: <soap-02cce7702b1a11dd9902000c29ee261e[at]sap.com>
Content-Type: text/xml; charset=utf-8
Content-Disposition: attachment;filename="soap-02cce7702b1a11dd9902000c29ee261e[at]sap.com.xml"
Content-Description: SOAP
Content-Length: 259
SOAPACTION: 
<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'><SOAP:Header/><SOAP:Body><ns0:Sd2Ids_SzfExport xmlns:ns0='http://www.dat.de/sdii/ids/Sd2SOAP.wsdl'><arg1>1234567899-0</arg1><arg2>1</arg2></ns0:Sd2Ids_SzfExport></SOAP:Body></SOAP:Envelope>

Always after such request I got and HTTP 411 error.

In opposite, when I'm sending request from e.g. Altova or SoapUI, my message looks:


POST / HTTP/1.1
Content-Type: text/xml; Charset=UTF-8
User-Agent: XML Spy
Host: 192.168.132.179:54000
Content-Length: 489
Connection: Keep-Alive
Cache-Control: no-cache
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<SOAP-ENV:Body>
		<m:Sd2Ids_SzfExport xmlns:m="http://www.dat.de/sdii/ids/Sd2SOAP.wsdl">
			<arg1 xsi:type="xsd:string">1234567899-0</arg1>
			<arg2 xsi:type="xsd:string">1</arg2>
		</m:Sd2Ids_SzfExport>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

After that request WebService response is correct.

You can find such differences (except Content-length which is a result of XML message formatting) in those two headers:

- for first is used HTTP 1.0 protocol for later 1.1

- in SAP header an info about attachment is added

After a lot of test I thing that those attachment info in header of HTTP is causing a problem. So I want to use DO NOT USE SOAP ENVELOPE option to generate HTTP header without Content-Disposition and generate SOAP Envelope manually.

stefan_grube
Active Contributor
0 Kudos

If the additional HTTP headers are really the reason for the behavior of the web service (which I doubt) then the "do not use SOAP envelope" option would not help here, because the http headers would be similar.

Could you try the plain HTTP adapter instead? You have to create the SOAP envelope in this case also.

Regards

Stefan

former_member737583
Participant
0 Kudos

nI do not understand to why SAP generates completely different headers for both situation.

Here is full request with headers for message WITH SOAP ENV


POST  HTTP/1.0
Accept: */*
Host: 192.168.132.179:54000
User-Agent: SAP-Messaging-com.sap.aii.messaging/1.0505
Content-ID: <soap-d00e76302d8211dd95d0000c29ee261e[at]sap.com>
Content-Type: text/xml; charset=utf-8
Content-Disposition: attachment;filename="soap-d00e76302d8211dd95d0000c29ee261e[at]sap.com.xml"
Content-Description: SOAP
Content-Length: 259
SOAPACTION: 
<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'><SOAP:Header/><SOAP:Body><ns0:Sd2Ids_SzfExport xmlns:ns0='http://www.dat.de/sdii/ids/Sd2SOAP.wsdl'><arg1>1234567899-0</arg1><arg2>2</arg2></ns0:Sd2Ids_SzfExport></SOAP:Body></SOAP:Envelope>

Here is full request with headers for message WITHOUT SOAP ENV


POST  HTTP/1.0
Accept: */*
Host: 192.168.132.179:54000
User-Agent: SAP-Messaging-com.sap.aii.messaging/1.0505
content-id: payload-DD2D832DFC2AB3F1AF180002A547E483[at]sap.com
Content-Type: text/xml
Content-Length: 175
SOAPACTION: 
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Sd2Ids_SzfExport xmlns:ns0="http://www.dat.de/sdii/ids/Sd2SOAP.wsdl"><arg1>1234567899-0</arg1><arg2>2</arg2></ns0:Sd2Ids_SzfExport>

Former Member
0 Kudos

Tomasz,

I still don't think that unchecking the box will generate HTTP header as you need.

I noticed there is no value in the header afetr SOAPACTION. What value is in the WSDL and what value have you provided in the soap receiver CC?

Peter

Edited by: Peter Jarunek on May 29, 2008 3:29 PM

former_member737583
Participant
0 Kudos

I did an additional test and I used XSLT transformation and DO NOT USE SOAP ENVELOPE option to generate soap request exactly which I like to have. So my request looks like:


POST  HTTP/1.0
Accept: */*
Host: 192.168.132.179:54000
User-Agent: SAP-Messaging-com.sap.aii.messaging/1.0505
content-id: payload-DD32F56C4CF793F1AF180002A547E483[at]sap.com
Content-Type: text/xml; charset="UTF-8"
Content-Length: 500
SOAPACTION: 

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><m:Sd2Ids_SzfExport xmlns:m="http://www.dat.de/sdii/ids/Sd2SOAP.wsdl"><arg1 xsi:type="xsd:string">1234567899-0</arg1><arg2 xsi:type="xsd:string">1</arg2></m:Sd2Ids_SzfExport></SOAP-ENV:Body></SOAP-ENV:Envelope>

The funniest thing is that I got now a little bit different error:

HTTP/1.1 500 No return from SD2SOAP server

stefan_grube
Active Contributor
0 Kudos

HTTP 500 means the the message is sent to the server correctly.

The server cannot interpret the content of the message. This is not a technical issue.

I am puzzled about the namespace:

xmlns:m="http://www.dat.de/sdii/ids/Sd2SOAP.wsdl"

Could you check, if this is correct?

Regards

Stefan