cancel
Showing results for 
Search instead for 
Did you mean: 

Using unique message ID to avoid duplicate messages

Former Member
0 Kudos

Hi Experts,

we have ascenario SOAP to IDoc (to receive ORDERS), The requirementy is to avoid the duplicate meesages in PI sent by the SOAP client multiple times due to the network issues.

I have found some expaination in SDN

Ensuring Exactly Once Processing 
The SOAP message provided by the SOAP client must contain a unique GUID. This can be provided in a valid XI message header in the SOAP message header or specified in a corresponding query string in the URL.
If the SOAP client then receives an empty SOAP message in HTTP 200 as a response, this means that the message has been successfully persisted and will be processed exactly once.
If the SOAP client receives a SOAP fault or any response not in HTTP 200, it must resend the message until it receives an empty SOAP message in HTTP 200.
 
If the GUID is set by the SOAP client, you must set the Use Encoded Headers and Use Query String indicators.

But can you please explain what config we need to do in PI, where can SOAP client have the GUID and how the process will work.

Thanks in Advance,

MK

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

In the SOAP sender communicatiob channel specify Processing Parameters

Under Quality of Service, specify how the message is to be processed by the Integration Engine

Exactly Once (asynchronous processing)

*If the client sends a GUID, execution is guaranteed exactly once. See also: Ensuring Exactly Once Processing

[http://help.sap.com/saphelp_nw70/helpdata/en/5e/164442c1a1c353e10000000a1550b0/frameset.htm]

former_member200962
Active Contributor
0 Kudos

There are two ways of ensuring EO processing....and the one which you have mentioned is the first.....there is one more which seems to be the normal one...check this link:

http://help.sap.com/saphelp_nw70/helpdata/en/5e/164442c1a1c353e10000000a1550b0/content.htm

Regards,

Abhishek.

Former Member
0 Kudos

Thanks for the reply.

If SOAP client sends the unique message ID (for resending message we use message ID of the Orginal) and if we check the options Use Encoded headers and use query string in the SOAP sender adapter.

can you please explain what happens in PI, when the SOAP client resends a message with same message ID.

I want to know how PI will knows that it is a duplicate message and terminate the process.

former_member200962
Active Contributor
0 Kudos

If there is a conflict of message ID (same MSGID twice) then you will get an error in PI saying Message with ID XYZ already exists .....you can find this error in this thread:

So when two messages are found having the same MSGID (which normally should not occur).....the second message processing runs into error...

However when you delete the message entry from the DB then it may happen that the duplicate message entry is accepted

Regards,

Abhishek.

Former Member
0 Kudos

Thanks Abhishek.

Can you please confirm the below

* PI will create a message with message ID sent by the SOAP client - that means PI will not generate the message ID.
* If the SOAP client sends the message ID in the SOAP header, do we need to perform any mapping or PI will retrieve it automatically if we check the options Use Encoded headers and use query string in the SOAP sender adapter.

former_member200962
Active Contributor
0 Kudos
PI will create a message with message ID sent by the SOAP client - that means PI will not generate the message ID.

Yes, PI will not generate any message ID then....the one sent by the SOAP Client will be used.....

If the SOAP client sends the message ID in the SOAP header, do we need to perform any mapping or PI will retrieve it automatically 
if we check the options Use Encoded headers and use query string in the SOAP sender adapter.

You need not worry about the mapping of this msgID....it will be pulled from the SOAP Header....

You can confirm these things in the below SOAP FAQ Note:

https://service.sap.com/sap/support/notes/856597

From the above note search for:
Q: What are the correct sender options for asynchronous calls?
Q: How to set the message ID from my SOAP client?

both of them will answer all your queries.....and are present under point-2....

Regards,

Abhishek.

Former Member
0 Kudos

Thanks Abhishek.

Can you please suggest what does the below means

the Message ID can be provided in a valid XI message header in the SOAP message header.

As the SOAP client confirmed that they cannot provide the URL parameter.

And also please suggest how to insert the messageID in the SOAP header, as we need to provide the updated WSDL to SOAP client.

Edited by: mk.xi on Jul 8, 2009 4:26 PM

former_member200962
Active Contributor
0 Kudos

valid messgae header means that it has all the required fields....in your case the imp parameter is MSGID....

The url that you want to give to the client has the normal format just that it will have &MessageId parameter added to it.....you can get it verified from the SAP note that i gave in the previous reply.....check out the Q mentioned under the pt-2.....

wont be able to reply as i need to catch a train:)

Regards,

Abhishek.

EOD.

Former Member
0 Kudos

Hi All,

The current SOAP message structure is

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <ORDERS05>
         <IDOC BEGIN="1">
        -----------
        -----------
          </IDOC>
      </ORDERS05>
   </soapenv:Body>
</soapenv:Envelope>

Do we have to change below SOAP message structure, Please confirm if it is valid

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
<MessageID>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx<MessageID/>
<soapenv:Header/>
   <soapenv:Body>
      <ORDERS05>
         <IDOC BEGIN="1">
        -----------
        -----------
          </IDOC>
      </ORDERS05>
   </soapenv:Body>
</soapenv:Envelope>

And also is there any probability that other message interfaces already exist in PI have the same internal message id as specified in SOAP client MessageID.

Please suggest with above.

Many thanks,

MK

Edited by: mk.xi on Jul 9, 2009 12:58 PM

former_member200962
Active Contributor
0 Kudos

i dont think you need to change the SOAP message format while sending from the SOAP clicnt to include the messageID....the MessageId parameter is to be included in the URL which is present in the WSDL file that you give to the sender application.....

And also is there any probability that other message interfaces already exist in PI have the same internal message id as specified in SOAP client MessageID.

the ans can be yes.....other messages wont know about the mesageID generated by the SOAP client....if there is any conflict then you will get an error saying Message with XYZ ID already exists....

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

The SOAP client is unable to support the URL parameters , hence I am looking at inserting the message ID in the SOAP header.

Can you please confirm if the above structure is valid and we can provide it with the WSDL to the SOAP client.

As you said the SOAP adapter will automatically picks the message ID from SOAP header to create the PI message-- NO MAPPING IS REQUIRED, RIGHT?

Thanks,

MK