cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver Mail adapter Content type issue

Former Member
0 Kudos

Hello,


I am formatting the body of the receiver mail. The body of the email  should look like below.


Dear PI User,

The following Interface has been successfully processed by the middleware PI system.

Please do not reply to this email. If you need more information please contact the Super User.

Regards,

SAP PI Team

The mapping looks fine and My source MT looks like this:

<?xml version="1.0" encoding="UTF-8" ?>

- <ns1:MT_Mail_Reply xmlns:ns1="http://test.com/Mail/Reply">

- <Reply>  [0..unbounded]

- <Item> [0..unbounded]

<MESSAGE>Dear Business User, </MESSAGE>   [0..1]

/Item>

- <Item>

<MESSAGE>The following Interface has been successfully processed by the middleware PI system.</MESSAGE> [0..1]

</Item>

- <Item>

<MESSAGE>Please do not reply to this email. If you need more information please contact the Super User.</MESSAGE> [0..1]

</Item>

- <Item>

<MESSAGE>Regards,</MESSAGE> [0..1]

</Item>

- <Item>

<MESSAGE>SAP PI Team </MESSAGE>  [0..1]

</Item>

</Reply>

</ns1:MT_Mail_Reply>


The mapping works fine without errors and I get the target message as below after mapping-


<?xml version="1.0" encoding="UTF-8" ?>

- <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">

<Subject>ISAP PI Interface Status</Subject>

<From>piteam@test.com</From>

<To>piusers@test.com</To>

<Content>Dear Business User</Content>

<Content>The following Interface has been successfully processed by the middleware PI system.</Content>

<Content>Please do not reply to this email. If you need more information please contact the Super User</Content>
  <Content>Regards,</Content>
  <Content>SAP PI Team</Content>

</ns1:Mail>

t

The context of MESSAGE has been changed to Reply.

In the adapter I still get the following error.       

Delivery of the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.sdk.xi.srt.BubbleException: Failed to call the endpoint  [null "null"]; nested exception caused by: com.sap.aii.af.sdk.xi.util.XMLScanException: expecting end tag: {http://sap.com/xi/XI/Mail/30}Mail, but found {}Content at state 1


Please advise !!


Thanks,


Teresa



**I changed the receiver mail adapter to not use Mail package and I receive an email without errors with the Content as mentioned above. **

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Teresa,

I think the problem is that you are using multiple "Content" tags. Have you tried to use only one?, you can concatenate all your text.

Check the page 3 of this document to know how introduce new-line character http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0964d7c-e66e-2910-24bb-ac535e4a5...

Regards.

Former Member
0 Kudos

Thank you for pointing me in the right direction. The Content tag in the target is 0...unbounded.

As you mentioned I tried to concatenate all my text in one Message but the document does not mention what the new line charcter would be ? I tried putting \n between the first and second line.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Use Java util scanner class as mentioned below. Try the simple udf to handle this..

http://www.tutorialspoint.com/java/util/scanner_nextline.htm

Answers (0)