Skip to Content

In one of the latest articles HowTo – Send Test Messages to the Adapter Engine (to an Integrated Configuration)  Karsten Möhwald has shown an amazing idea on how we can send a message from RWB to any ICO (does not matter what kind of adapter is being used in the ICO).


Where can we use this idea?


a) if we need to test an ICO but we don’t have a working connection with the existing adapter (for example JMS, JDBC, IDOC, etc.)

b) if we want to design regression testing tool which will skip the sender adapter and will always post the data in the same way to PI (via SOAP)

But how can we do the same trick without RWB?

If you have a look at the configuration in Karsten’s blog you will see that in RWB we’re using the URL:


http://<server_host>:<j2ee_port>/XISOAPAdapter/MessageServlet?channel=<party>:<service>:<channel>


to the dummy SOAP channel but where to put the information in case we’d like to do the same with SOAPUI or any other SOAP testing tool ?

If you think that we can try the second standard way of creating the URL for sender soap adapter:

http://<server_host>:<j2ee_port>/XISOAPAdapter/MessageServlet?senderParty=

&senderService=BC_Michal_Krawczyk&receiverParty=&receiverService=

&interface=SI_Michal_Out&interfaceNamespace=urn:michal.krawczyk.com

then this is not going to work as PO will let us know that it’s not possible to use non SOAP channels (for example JDBC) like shown on the screenshot below:


michal_krawczyk_error_info_ICO.png

What do we need to do then? It turns out that we need to create a whole envelope for PO message (with XI header) where we need put:

– sender system

– interface & namespace

but also:

– message ID, timestamp, queueid, etc.



SOAPUI message data

<SOAP:Envelope xmlns:SOAP=’http://schemas.xmlsoap.org/soap/envelope/‘>

<SOAP:Header>

<sap:Main xmlns:sap=’http://sap.com/xi/XI/Message/30‘ versionMajor=’3′ versionMinor=’1′ SOAP:mustUnderstand=’1’>

<sap:MessageClass>ApplicationMessage</sap:MessageClass>

<sap:ProcessingMode>asynchronous</sap:ProcessingMode>

<sap:MessageId>30afd515-99b6-11e3-c37d-000000aecb5b</sap:MessageId>

<sap:TimeSent>2014-02-19T22:35:53Z</sap:TimeSent>

<sap:Sender><sap:Party agency=’http://sap.com/xi/XI‘ scheme=’XIParty’>

</sap:Party><sap:Service>BC_Michal_Krawczyk</sap:Service></sap:Sender>

<sap:Interface namespace=’urn:krawczyk.com’>SI_Michal_Out</sap:Interface></sap:Main>

<sap:ReliableMessaging xmlns:sap=’http://sap.com/xi/XI/Message/30‘ SOAP:mustUnderstand=’1’>

<sap:QualityOfService>ExactlyOnce</sap:QualityOfService>

<sap:QueueId>55555</sap:QueueId></sap:ReliableMessaging>

</SOAP:Header><SOAP:Body>


<ns:MT_data xmlns:ns=”http://michal.krawczyk.com/SDN“>

  <row>

  <name>Michal</name>

  <surname>Krawczyk</surname>

  </row>

</ns:MT_resultset>


</SOAP:Body>

</SOAP:Envelope>


and then if we send it to the dummy SOAP channel like

http://<server_host>:<j2ee_port>/XISOAPAdapter/MessageServlet?channel=<party>:<service>:<channel>

the message will go to the correct service as per the information from the XI header.

If you know any other easier way to do the same thing, please do let me know,

To report this post you need to login first.

17 Comments

You must be Logged on to comment or reply to a post.

  1. Suseelan Hari

    Hi Michal,

    I am still updating in SAP PO skills and not that much familiarize. I believe this blog is definitely help whenever we required to send messages directly to AEX (ICO). Thanks for sharing valuable information. Keep posting. 😎

    Regards,

    Hari Suseelan

    (0) 
    1. Michal Krawczyk Post author

      Hi Hari,

      >>> I believe this blog is definitely help whenever we required to send messages directly to AEX (ICO).

      I’ve added a section on where can we use this idea to the blog – thanks for the suggestion,

      Regards,

      Michal Krawczyk

      (0) 
      1. Suseelan Hari

        Hi Michal,

        I was following you for long time and I was amazed to see your PI updates. Keep posting new updates and it will be very useful for me for upcoming PI projects. Thanks.

        Regards,

        Hari Suseelan

        (0) 
  2. Dingjun Jia

    Hi Michal,

    thanks for sharing this.

    I have one question for adding message ID, timestamp, queueid etc. in SOAP header. Can we put some dummy values in those fields or we need to keep some rules?

    Thanks & regards

    Dingjun

    (0) 
    1. Michal Krawczyk Post author

      hi,

      >>>>Can we put some dummy values in those fields or we need to keep some rules?

      rules are rules – you cannot use dummy values …

      unless you’re like Neo  πŸ™‚

      Regards,

      Michal Krawczyk

      (0) 
      1. Dingjun Jia

        Hi Michal,

        But how can we make sure that the value for <SAP:MessageId>in the SOAP header is unique, because this value is normally internal generated by PI.

        Regards

        Dingjun

        (0) 
        1. Michal Krawczyk Post author

          Hi Djingjun,

          >>>>But how can we make sure that the value for <SAP:MessageId>in the SOAP header is unique, because this value is normally internal generated by PI

          I’m glad you’ve asked that πŸ™‚   fortunately there’s “SAP to the rescue” we can generate the message ID on our own with API com.sap.guid and it will be as unique as the one generated by PI, 

          hope that clarifies,

          Regards,

          Michal Krawczyk

          (0) 
      1. Robert den Hoedt

        Hi Michal,

        Good to hear that there are ways to test ICO’s but to me these still look like workarounds.

        We used to have proper testing tools in the Integration Directory (Test Configuration) and from the RWB as well.

        From a developer point of view it is definitely a step back that all these options are no longer there.

        Do you (or anyone else) know if it is on the roadmap of SAP to bring better testing tools (back) to PI? I feel they should be there.

        Kind regards, and thx for all your valuable comments on the PI side of life.

        Robert

        (0) 
  3. Sanjeev Shekhar Singh

    Hi Michal,

    Just happened to find a slightly different variation of this, which will not require creation of a new test ICO. Instead I used details of an iFlow which had sender as a SAP ECC system. Since, this interface had a sender channel with message protocol XI 3.0, all I had to do was to ensure that the SOAP message was created exactly as SAP creates for proxy messages. So my SOAP body looks like:

        <SAP:Manifest wsu:Id=”wsuid-main-92FFF13F5C59777FE1ABE00000A1551F7″ xmlns:wsu=”http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd” xmlns:xlink=”http://www.w3.org/1999/xlink” xmlns:SAP=”http://sap.com/xi/XI/Message/30“>

             <SAP:Payload xlink:href=”cid:ASN_SampleXML.xml“>

                <SAP:Name>MainDocument</SAP:Name>

                <SAP:Description/>

                <SAP:Type>Application</SAP:Type>

             </SAP:Payload>

    where payload file was included as attachment and file name provided in Payload field(highlighted). Hope its useful for others.

    Regards,

    Sanjeev.

    (0) 
    1. Katan Patel

      Hi Sanjeev,

      I had an issue where the payload is just ignored using the approach Michal described above.  We are running in PO 7.31 AEX Only.


      I’ve had to do exactly the same thing as you.  I used Karsten’s approach via the RWB to get the correct SOAP format with attachments (in the message monitor) and then setup SOAPUI to use attachments like you said and updating the SOAP body. 

      Sadly I wish I read your comment before doing all this, as it would have saved me a lot of time, but I ended up working it out the hard way. 


      I’m now editting my HTTP Client to build requests in the same way and I should be good now the payload is being picked up correctly.

       

      Michal – Might be worth updating your blog to include this tip from Sanjeev.  Or maybe Sanjeev writing your own blow to supplement this one. 

      Either way great blogs from both of you.

      Cheers,

      Katan

      (0) 

Leave a Reply