Skip to Content
Author's profile photo Michal Krawczyk

Michal’s PO tips: How to send messages directly to AEX (ICO) – adapter independent – SOAPUI version

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,

Assigned Tags

      17 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Praveen Gujjeti
      Praveen Gujjeti

      Hi Michal,

      Nice tweaking of HowTo - Send Test Messages to the Adapter Engine (to an Integrated Configuration) Karsten Möhwald . I did something similar in the past to post dynamic headers to XI (SAP XI/PI: Testing Scenarios involving Dynamic Configuration). Thanks for sharing your ideas.

      Best Regards,

      Praveen Gujjeti

      Author's profile photo Michal Krawczyk
      Michal Krawczyk
      Blog Post Author

      now we need to wait for the tweak of the tweak to be able to do the same thing in even a simpler way maybe  πŸ™‚

      Regards,

      Michal Krawczyk

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Michal Krawczyk
      Michal Krawczyk
      Blog 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

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Michal Krawczyk
      Michal Krawczyk
      Blog 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

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Michal Krawczyk
      Michal Krawczyk
      Blog 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

      Author's profile photo Former Member
      Former Member

      Thanks for the quick reply.

      Regards

      Dingjun

      Author's profile photo Thorsten Lyby
      Thorsten Lyby

      Hi Michal,

      Works like a charm on PO 7.4, thanks for sharing!

      Regards

      Thorsten

      Author's profile photo Michal Krawczyk
      Michal Krawczyk
      Blog Post Author

      Hi Thorsten,

      >>>Works like a charm on PO 7.4, thanks for sharing!

      a promise is a promise πŸ™‚

      Regards,

      Michal Krawczyk

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Jan Trobitius
      Jan Trobitius

      Hi Robert,

      not sure if your question is still unanswered, but at least the "Send Test Message" tool was enhanced in the meantime to support sending messages to an ICO as well, including value help support.

      Details and version information are given in the following note: http://service.sap.com/sap/support/notes/1964909

      HTH and kind regards,

      Jan

      Author's profile photo Sanjeev Shekhar Singh
      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.

      Author's profile photo Katan Patel
      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

      Author's profile photo Sanjeev Shekhar Singh
      Sanjeev Shekhar Singh

      Glad it helped! πŸ™‚

      Regards,

      Sanjeev.