cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SOAP: call failed: java.io.IOException: Cant parse the document; HTTP 200 OK

wu_feng2
Explorer
0 Likes
12,702

Hello Experts,

I’m working on PI dual stack 7.30 , and have a scenaio RFC( ECC ) -> PI -> SOAP.(3rd).

Either in synchronized or asynchronize mode, the SOAP Receiver channel got an error:

SOAP: call failed: java.io.IOException: Cant parse the document; HTTP 200 OK.

The logs as below:

However, 3rd checked that the message had been received and got no error.

I have check that, 3rd response with text/utf-8 format message.

Then ,I tried to use Soap UI tool to call the soap service directly, everything is OK.

Even , I used the provided WSDL to generate client proxy in ECC to test the SOAP service, and with ABAP developers' help to call the service, and all is working fine.

The message by soap ui directly sent look like as below:

So, how could I overcome this error?

Please give me some advice.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

dilipkkp2412
Contributor
0 Likes

Hi Wu Feng,

Use below XSLT Code to "add soap-envelope" in your request message:

<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml"/>
	<xsl:template match="/">
		<soap:Envelope
			xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
			xmlns:ns0="http://tempuri.org/"
			xmlns:a="http://www.w3.org/2005/08/addressing">
			<soap:Header>
				<a:Action soap:mustUnderstand="1">http://tempuri.org/DeviceCategoryInput</a:Action>
			</soap:Header>
			<soap:Body>
				<xsl:copy-of select="."/>
			</soap:Body>
		</soap:Envelope>
	</xsl:template>
</xsl:stylesheet>

Use below XSLT Code to extract body content from soap-envelope of response message:

<xsl:stylesheet version="1.0"
	xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:soap="http://www.w3.org/2003/05/soap-envelope" exclude-result-prefixes="SOAP-ENV">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
	<xsl:template match="soap:Header"></xsl:template>
	<xsl:template match="soap:Body">
		<xsl:copy-of select="child::node()"/>
	</xsl:template>
</xsl:stylesheet>

In operation mapping, Request Mapping Programs's sequence should be like:

  • Request Message Map
  • XSLT Map (to add soap-envelope in request message)

and Request Mapping Programs's should be like:

  • XSLT Map (to extract body content from soap-response)
  • Response Message Map

In soap-receiver channel:

  • check 'Do Not use soap Envelope'
  • In Module Tab, apply transformation of content type using module parameters given in very initial reply

You please cross verify soap-request payload once message been triggered using above config.

Regards,

Dilip

wu_feng2
Explorer
0 Likes

Hi Dilip,

As 3rd system accept soap version 1.1 only, I change the response code:

<xsl:stylesheet version="1.0"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" exclude-result-prefixes="SOAP-ENV">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
    <xsl:template match="soap:Body">
        <xsl:copy-of select="child::node()"/>
    </xsl:template>
</xsl:stylesheet>

Now, I could read the response content

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- XML Validation Inbound Channel Response --> dc
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:DeviceCategoryInputResponse xmlns:ns2="http://tempuri.org/"><out>S</out></ns2:DeviceCategoryInputResponse></soap:Body></soap:Envelope>
0

and got new error

Während des XSLT-Mappings XLST_03CA8_SWTDGLXT2ERP_SBFL_Return 
(http://test.org/NMMDM, 7dac07b0-3c70-11e8-cc02-d7560a808f6d, -1) 
ist eine TransformerException aufgetreten.

And how could I remove the unexpected characters?

dilipkkp2412
Contributor
0 Likes

Hi Wu Feng,

Sorry, I was not able to access my profile due to privacy profile settings.

Its awesome!! finally you nailed it…..please find below comments for new issue:

In above case (with modified xsl at response side), output is like:

<ns2:DeviceCategoryInputResponse
	xmlns:ns2="http://tempuri.org/"
	xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	<out>S</out>
</ns2:DeviceCategoryInputResponse><br>

Reason of error in pi is due to soap namespace:

Here we need one more XSL to remove all extra namespaces, below xsl-code can be referred for same:

<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" indent="no"/>
	<xsl:template match="/|comment()|processing-instruction()">
		<xsl:copy>
			<xsl:apply-templates/>
		</xsl:copy>
	</xsl:template>
	<xsl:template match="*">
		<xsl:element name="{local-name()}">
			<xsl:apply-templates select="@*|node()"/>
		</xsl:element>
	</xsl:template>
	<xsl:template match="@*">
		<xsl:attribute name="{local-name()}">
			<xsl:value-of select="."/>
		</xsl:attribute>
	</xsl:template>
</xsl:stylesheet><br>

which provides output as:

<DeviceCategoryInputResponse>
    <out>S</out>
</DeviceCategoryInputResponse><br>

In operation mapping, Response-Tab Mapping Programs should be like:

  1. XSLT Map (to extract body content from soap-response)
  2. XSLT Map (to remove extra namesapce)
  3. Response Message Map

Hope above helps you.

Thanks and regards,

Dilip

wu_feng2
Explorer
0 Likes

Hi Dilip,

The new error caused by extracting body content from soap-response.

The reason is there is "dc" before the soap content and "0" in the end of the soap content; and 3rd developers said that these two string would change as the message type changing.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:DeviceCategoryInputResponse xmlns:ns2="http://tempuri.org/"><out>S</out></ns2:DeviceCategoryInputResponse></soap:Body></soap:Envelope>

dilipkkp2412
Contributor
0 Likes

Hi Wu Feng,

So, in that case at response side, instead of using XSLT code use JavaMap to extract Soap:Body part.

Because, XSLT Code's 1st pre-requisites is well-formed xml structure only.

In JavaMap, you can read incoming response message as a string and apply logic to extract content between <soap:Body> ....</soap:Body>

Thanks & Regards,

Dilip

wu_feng2
Explorer

Hi Dilip,

Thank you very much.

I have done that, and it is working.

dilipkkp2412
Contributor
0 Likes

Hi Wu Feng,

  • Happy to help you.
  • One favour, if possible, please summarize your final config and put it here, because we had explored so many options, any one can get confused if they look for help this page for error "SOAP: call failed: java.io.IOException: Cant parse the document; HTTP 200 OK"

Thanks & Regards,

Dilip

wu_feng2
Explorer
0 Likes

1、Use below XSLT Code to "add soap-envelope" in request message:

<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       <xsl:outputmethod="xml"/><xsl:template match="/"><soap:Envelope
			xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
			xmlns:ns0="http://tempuri.org/"
	      <soap:Body><xsl:copy-ofselect="."/></soap:Body>
            </soap:Envelope>
      </xsl:template>
</xsl:stylesheet>

2、In operation mapping, Request Mapping :

  • Request Message Map
  • XSLT Map (to add soap-envelope in request message)

and Response Mapping Program:

  • Java Map (to extract body content from not well-formated soap-response)
  • Response Message Mapping

3、In soap-receiver channel:

  • check 'Do Not use soap Envelope' (here assuming, in request payload, soap envelope is already attached)
  • and transformation of content type using module parameters
dilipkkp2412
Contributor
0 Likes

Nice, thanks....

Answers (3)

Answers (3)

dilipkkp2412
Contributor
0 Likes

Hi Wu Feng,

By looking in to your request payloads

[1] I got the reason of soap-fault message saying invalid namespace [when option unchecked "Do Not use soap Envelope"], that is,

  • its due to namespace given in element "DeviceCategoryInput" of your sxmb_moni request input
  • and here at this time no soap envelope is present in your payload
  • To follow this suggested config (which is also in our live sys), you need to do below:
  • In Soap-Receiver Comm Channel:
  • check 'Do Not use soap Envelope' (here assuming, in request payload, soap envelope is already attached)
  • and apply transformation of content type using module parameters given in very initial reply
  • Soap-Request format
<soapenv:Envelope
	xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:tem="http://tempuri.org/"
	xmlns:a="http://www.w3.org/2005/08/addressing">
	<soap:Header>
		<a:Action soap:mustUnderstand="1">http://tempuri.org/DeviceCategoryInput</a:Action>
	</soap:Header>
	<soapenv:Body>
		<tem:DeviceCategoryInput>
			<DeviceCategorys>
				<!--1 or more repetitions:-->
				<DeviceCategory>
					<CLASS>P001</CLASS>
					<KSCHL>test</KSCHL>
					<P_CLASS>H01</P_CLASS>
					<P_KSCHL>Furnace</P_KSCHL>
					<STATU>Approved</STATU>
					<ADATU>20180522</ADATU>
					<VDATU>20180522</VDATU>
				</DeviceCategory>
			</DeviceCategorys>
		</tem:DeviceCategoryInput>
	</soapenv:Body>
</soapenv:Envelope>

[2] With option "un-check", its good that, you have confirmation of soap-request receipts at 3rd party end is been sent successfully.

  • Its very true that, you have parsing issue in response side,
  • but one point here to note, is, even that response message is not entering in soap-channels during response
  • and no clue, what went wrong.
  • some how, from 3rd party, can you get, what response they are sending, or you can attach soap-response from soap-ui tool.

Meanwhile, can you try config type [1] all suggested steps in PI ? Here too may come same error while response receipts.

Thanks & Regards,

Dilip

dilipkkp2412
Contributor
0 Likes

Hi,

I got soap-response from log, no need to re-attach.

Mean while, please try type [1] config, if possible.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:DeviceCategoryInputResponse xmlns:ns2="http://tempuri.org/"><out>S</out></ns2:DeviceCategoryInputResponse></soap:Body></soap:Envelope>
dilipkkp2412
Contributor
0 Likes

Hi Wu Feng,

When working with "uncheck" option for "Do Not use soap Envelope", in response mapping, do you have logic to extract element "DeviceCategoryInputResponse" soap-envelope response ?

You need that too, this can be tried out in both config types, can be achieved using XSLT.

dilipkkp2412
Contributor
0 Likes

Hi,

In your config, in Receiver Agreement, please do like below, and trigger payload.

This stops any validation checks

wu_feng2
Explorer
0 Likes

Hi Dilip,

I'm not familiar with XSLT MAPPING.

If generating the Soap-Request format, do I need to change the target message type?

And the Mapping code like below?

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="XML" indent="YES" />
    <xsl:template match="/">
        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                          xmlns:tem="http://tempuri.org/" 
                          xmlns:a="http://www.w3.org/2005/08/addressing">
            <soap:Header>
                <a:Action soap:mustUnderstand="1">http://tempuri.org/DeviceCategoryInput</a:Action>
            </soap:Header>
            <soapenv:Body>
                <tem:DeviceCategoryInput>
                    <DeviceCategorys>
                        <xsl:for-each select="Z_PM_MASTERDATA_SBFLTX_SEND/IT_CLAS_ATTRIBS/item">
                            <DeviceCategory>
                                <xsl:variable name="CLASS" select="CLASS" />
                                <xsl:variable name="KSCHL" select="KSCHL" />
                                <xsl:variable name="P_CLASS" select="P_CLASS" />
                                <xsl:variable name="P_KSCHL" select="P_KSCHL" />
                                <xsl:variable name="STATU" select="STATU" />
                                <xsl:variable name="ADATU" select="ADATU" />
                                <xsl:variable name="VDATU" select="VDATU" />
                            </DeviceCategory>
                        </xsl:for-each>
                    </DeviceCategorys>
                </tem:DeviceCategoryInput>
            </soapenv:Body>
        </soapenv:Envelope>
    </xsl:template>
</xsl:stylesheet>


dilipkkp2412
Contributor
0 Likes

Hi,

One more observation, in soap-ui's response payload, there is no header present.

As per wsdl too, your response payload should be like below, please ask 3rd part team for this.

<soap:Envelope
	xmlns:a="http://www.w3.org/2005/08/addressing"
	xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	<soap:Header>
		<a:Action s:mustUnderstand="1">http://tempuri.org/DeviceCategoryInput</a:Action>
	</soap:Header>
	<soap:Body>
		<ns2:DeviceCategoryInputResponse
			xmlns:ns2="http://tempuri.org/">
			<out>S</out>
		</ns2:DeviceCategoryInputResponse>
	</soap:Body>
</soap:Envelope>

At our side too, when my service works with soap-action, it returns that info in header of soap-response.

wu_feng2
Explorer
0 Likes

Hi Dilip,

It is not resolved yet.

1、The request payload and soap ui message of using the option "Do Not use soap Envelope" has been attached now , see attachments:

paload-1657dc38-5036html000016.txt

soapui-message.txt

the service definition and http logs in SOAP UI tool when calling the service are:

soap-ui-http-logs.txt

wsdl.txt

2、“uncheck the option "Do Not use soap Envelope" 3rd system receive messages successfully" , it is confirmed by 3rd system developers. They found messages saved in database, and the receiving time is the same as sending message.

However, I could not find out the response payload by SXMb_Moni, but error message "

com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: Can't parse the document; HTTP 200 OK"

?In my last reply, the figure logs is got by path Configuration and Monitoring Home -> Monitoring -> Adapter Engine -> Message MOnitor.

I think, the error is generated when parsing the response message.


3、WSDL document is not RPC-style , when using RPC-style, message types can't be displayed.

dilipkkp2412
Contributor
0 Likes

Hi Wu Feng,

In PI's SXMB_Moni, check below:

[1st]

  • XML Original Message -> Inbound Message ( CENTRAL ) -> XML Validation Outbound Channel Request -> Payloads -> MainAttachment ( text/xml;charset=utf-8 )
  • compare this with your SOAP-UI's request message

[2nd]

  • Response Msg ID -> Inbound Message ( CENTRAL ) -> Payloads -> MainAttachment ( text/xml;charset=utf-8 )
  • compare this with your SOAP-UI's response

Also cross verify in SOAP Receiver channel:

  • check 'Do Not use soap Envelope' (here assuming, in request payload, soap envelope is already attached)
  • and transformation of content type using module parameters

Hope above helps you

Thanks & Regards

Dilip

wu_feng2
Explorer
0 Likes

Hi Dilip,

Thank your reply.

I configured the soap receive channel as you advised, it don't work.

From monitor tool, I could see the message sent to receiver channel is the same as soap UI called the service directly.

When I checked 'Do Not use soap Envelope' option, it got error as below shown.( OT_return is an element of response message in sender side)

But if not checked 'Do Not use soap Envelope' option, the result is the same error as before.

dilipkkp2412
Contributor
0 Likes

Hi Wu Feng,

Just provide inputs for below queries:

  • Are you including Soap-envelope in request message ? if yes...you have to "uncheck" the option "Do Not use soap Envelope"
  • I guess, map "MM_MASTER_DATA_SBFL_RETURN" is response message mapping, right ?....then it means you are getting service response and its mapping failed while converting to RFC format....can you show its "Inbound Message" -> "Payload" ?
  • Are you using any Soap Action too ?
  • Any specifc header ?...just corss cehck from SOAP-UI-TOOL

Regards,

Dilip

wu_feng2
Explorer
0 Likes

Hi Dilip,

"MM_MASTER_DATA_SBFL_RETURN" is the response message mapping.

When checked the option "Do Not use soap Envelope", the inbound payload like this:

"DeviceCategoryInput" Is the request message name, and "http://tempuri.org/" is the namespace of "DeviceCategoryInput".

I have checked that, the payload in the path Original Message -> Adapter Call -> payload consist of the content :

<?xml version="1.0" encoding="UTF-8" ?><ns1:DeviceCategoryInput xmlns:ns1="http://tempuri.org/">

And some time later,review the message, the response node do not present, looks like as below:

The service has attribute soapAction, no other header attributes.

Another thing, from the communicate channel monitor, the receiver channel, has the following logs, and the message not received by 3rd system.

SOAP: request message entering the adapter with user J2EE_GUEST

SOAP: completed the processing

SOAP: continuing to response message d4c5eb36-5e62-11e8-a912-00000076e6de23.05.2018

MP: processing local module localejbs/AF_Modules/MessageTransformBean

Message delivered to the application using connection SOAP_http://sap.com/xi/XI/System23.05.2018

Message status set to DLVD

dilipkkp2412
Contributor
0 Likes

Hi Wu Feng,

  • In Config, you have to "uncheck" the option "Do Not use soap Envelope", you are on right path
  • Next, if soap fault is been returned, it means your soap request is not in proper format.
  • You may be matching your ready PI-soap-request with soap-ui payload, but soap-ui also using soap-action in its header, then you should frame your pi-soap-request like below and try
  • Above format you can try in soap-ui too, do not forget to remove soap-action from default soap-ui places
  • Reason of response map (MM_MASTER_DATA_SBFL_RETURN) is soap fault message.

Thanks & Regards,

Dilip

dilipkkp2412
Contributor
0 Likes

Hi Wu Feng,

When you received soap:fault message in response, it's about soap:version mismatch and invalid namespace in request, to cross verify, can you provide request payloads of "Soap-UI" and "SXMB_MONI of SAP-PI", need to compare.

And about other test case,

  • where "If you uncheck the option "Do Not use soap Envelope" 3rd system receive messages successfully,
  • how you are assured ?,
  • Are you able to see response from service in SXMb_Moni ?,
  • if yes, then provide it with its content-type. There may be some some unparsable char in payload
  • There may be one more check, can you verify that your WSDL document is RPC-style ?
  • if yes, then try below settings:
  • If you get it resolved, please let me know, I'm too interested for this type of error resolution.

Regards,

Dilip