cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP to SAP R3 - input data taken as a "xml string"

Former Member
0 Kudos

Hi Experts,

There is requirement where input data taken as a "xml string"  needs to be parsed in PI and the generated parameters are to be mapped to the parameters of RFC.

At the input side of mapping we have a single parameter containing xml string that is coming from SOAP sender  and at the outboud side we want the parsed i.e. separated fields that can be passed in the RFC import parameters, so that the Purchase order can be generated in SAP.


Technically  : Wants it to be a SOAP to RFC scenario


Attached is the xml data  that is being passed as a string in the webservice by the client.(SOAP Sender)

Please suugest solution of the problem .

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You basically need to do parsing the xml string using java mapping. If you are looking for a standard example for coding please look at this example. Here the xml string is declared inside the method but in your case read the inputstream and parse the desired tag elements from this.

http://www.java2s.com/Code/Java/XML/ParseanXMLstringUsingDOMandaStringReader.htm

Answers (4)

Answers (4)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Anshul,

                 If you are receiving entire input as a string this can be also parsed and converted to target XML. You need a java mapping to this. Please check my response to this thread where I converted a string coming within XML tags into an output XML, The same technique you need to apply for entire string.   Specially note the code for lines 32-37. Hope this solves your problem.

Regards

Anupam

Former Member
0 Kudos

Hi Anshul,

I would tackle this with a Java mapping (parsing or CDATA parsing on XI). There should be some examples of this here on SCN.

Regards, Trevor

<Edit: Or you can just follow the other user's advice - this PI forum is a mine field for user's with a slow internet connection )

Message was edited by: Trevor Naidoo

iaki_vila
Active Contributor
0 Kudos

Hi Anshul,

I think the best and easy way is the Greg way, because you can do a normal scenario.

I have seen that you have three or four different namespaces, and it's difficult to build an xsd with all the namespaces. You can delete all the namespace with an xsl or with anonimyzer module and construct and easy XSD with a free tool like http://www.freeformatter.com/xsd-generator.html

Regards.

former_member184681
Active Contributor
0 Kudos

Hi,

I believe you have some strong reasons to receive all the input in one string field, instead of building the sender structure in PI normally? If you do, the best way would be to parse the xml string in a Java mapping and use it to produce the output structure. But if not, I would recommend developing the scenario as usually, which means changing your sender structure.

Regards,

Greg