cancel
Showing results for 
Search instead for 
Did you mean: 

XI Soap Adapter: problems in parsing XML

Former Member
0 Kudos
153

Hallo,

I call a Web Service using XMLSpy and this is the response (note tag <File>):

<SOAPSDK4:ExpBaselineResponse xmlns:SOAPSDK4="http://tempuri.org/PRWBS_PRIMAVERA/message/">

<RESULT>OK</RESULT>

<File>&lt;?xml version=&apos;1.0&apos; encoding=&apos;UTF-8&apos;?&gt;

&lt;Dati:Parametri xmlns:Dati=&quot;Schema&quot;&gt;

&lt;ELSAG xmlns=&quot;Schema&quot;&gt;

&lt;proj_id&gt;4623&lt;/proj_id&gt;

&lt;BS_short_name&gt;FS0084AAAA01 - B1&lt;/BS_short_name&gt;

&lt;BS_proj_id&gt;1302&lt;/BS_proj_id&gt;

&lt;TARGET_START&gt;2004-04-01&lt;/TARGET_START&gt;

....etc...

If I call the same Web Service from XI, this is the response:

<SOAPSDK4:ExpBaselineResponse xmlns:SOAPSDK4="http://tempuri.org/PRWBS_PRIMAVERA/message/" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema">

<RESULT>OK</RESULT>

<File>&#60;?xml version="1.0" standalone="yes"?&#62;

&#60;Dati:Parametri xmlns:Dati="Schema"&#62;

&#60;ELSAG xmlns="Schema"&#62;

&#60;proj_id&#62;4623&#60;/proj_id&#62;

&#60;BS_short_name&#62;FS0084AAAA01 - B1&#60;/BS_short_name&#62;

&#60;BS_proj_id&#62;1302&#60;/BS_proj_id&#62;

&#60;TARGET_START&#62;2004-04-01&#60;/TARGET_START&#62;

....etc....

In my flow, I use a java mapping to parse the content of tag <File> into a message.

My mapping works correctly only with the first option.

Is it possible to change XI Soap Adapter encoding for HTML?

My java mapping uses this parser:

public void execute(InputStream MyInputStream, OutputStream MyOutputStream)

throws StreamTransformationException {

SAXReader reader = new SAXReader();

Document document;

try {

document = reader.read(MyInputStream);

...

this instruction generates an Exception only with XI message.

Can anybody help me??

Thanks;-)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

get your inputstream into a string and try replacing &#60; with proper xml notations.

&amp; for &#38;

&lt; for &#60;

&gt; for &#62;

&quot; for &#34;

&apos; for &#39;

See any xml reference guide for fullset of notations

Its worth a try

bhavesh_kantilal
Active Contributor
0 Kudos

JI,

the following characters are special characters of XML, that need special attention.

< , > , &, ' ," . Like mentioned by Jay, in your Input STream , do a scearch and replace to replace the encoded values with the escape sequence and then parse the XML using DOM or SAX parser.

Regards,

Bhavesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I would suggest you go through this Pdf for the SOAP Adapter configuration:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/40728f7b-0401-0010-d9bc-8c7...

And also have a glance on the info for webservices given below,

Just go through these links and they will surely help you learn more about Webservices:

<a href="/people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi Webservices using SAPXI</a>

<a href="/people/siva.maranani/blog/2005/05/23/communication-between-sap-system-webservice-using-proxies between SAP System & Webservice Using Proxies</a>

You can Go through these links to get some info about accessing Webservices:

http://help.sap.com/saphelp_nw04/helpdata/en/d6/f9bc3d52f39d33e10000000a11405a/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/b7/d7baaf1481a349ab723e3acd7334b3/content.htm

Go through these links which will surely help you find an answer to your problem.....

Regards,

Abhy