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,718

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.

View Entire Topic
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....