Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    Jul 31, 2012 at 01:35 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 31, 2012 at 07:34 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 31, 2012 at 07:47 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 31, 2012 at 01:27 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 31, 2012 at 07:48 AM

    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

    Add comment
    10|10000 characters needed characters exceeded