on 06-13-2006 6:26 PM
Hi,
I'm a newbie to XI and I have problems in configuring the Receiver mail adapter with the "Use Mail package" option selected. I am trying pickup a file (using file adapter on Sender side, picks up a simple XML file) and after mapping in XI, send the message as an email message to dynamic email addresses.
Everything works fine if I did not select the "Use Mail Package". But when I choose that option it errors out. I followed this blog posted on SDN -
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
The following XML message is my source
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/Somenamespace">
<ns0:Message1>
<ns1:studentlisttest xmlns:ns1="urn:karthiksender_to_karthikreceiver">
<Student>
<studentid>1</studentid>
<lastname>Studentlastname</lastname>
<firstname>Studentfirstname</firstname>
</Student>
<Mail>
<From>abc@abc.com</From>
<To>def@def.com</To>
<Subject>Test mail adapter</Subject>
</Mail>
</ns1:studentlisttest>
</ns0:Message1>
</ns0:Messages>
What I want to accomplish is, I have a simple message mapping where the Studentdetails are mapped to, lets say Customer details. For convenience lets keep it simple, StudentId --> Customerid, (student)Firstname --> (customer)Firstname, (Student)Lastname --> (customer)Lastname
I would like to get the Customer details as an XML attachment or in the body of an email with from, to and subject corresponding to that specified in the <Mail> node.
I followed the instructions posted on the blog and it works fine if I don't map the studentdetails to customerdetails. I did multimapping, with one source message (the xml file I posted above) and two target messages (customerdetails and Mail, which is the external definition posted on the blog). I beleive I'm missing something here. Could somebody please guide me through this?
Thanks
Karthik
hi,
you strcture has to be the same as in my weblog
(exactly)
https://websmp205.sap-ag.de/~sapidb/012006153200000361852004E/ximail30_xsd.txt
you cannot have additional fields ,segments etc
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michal,
Thanks for the quick response. How should I proceed in order to get the mapping working and also mail it to the address in the message? According to my understanding, I would have one source message (the sample I gave above) and 2 target messages (one is the target customerlist message and the other one is the Mail message conforming to your schema). Am I correct? Please let me know if I'm moving in the right direction.
Thanks
Karthik
hi,
I still have not found the solution for this problem. Michal, your blog works fine when my source message has got only the mail details. As per your advice, I tried modified the structure of the xsd file as follows
<xs:schema targetNamespace="http://sap.com/xi/XI/Mail/30"
xmlns:xi="http://sap.com/xi/XI/Mail/30"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!--
-->
<xs:element name="Mail">
<xs:annotation>
<xs:documentation>Mail package for XI - Mail Adapter</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Subject" type="xs:string" minOccurs="0"/>
<xs:element name="From" type="xs:string" minOccurs="0"/>
<xs:element name="To" type="xs:string" minOccurs="0"/>
<xs:element name="Reply_To" type="xs:string" minOccurs="0"/>
<xs:element name="Content_Type" type="xs:string" minOccurs="0"/>
<xs:element name="Date" type="xs:dateTime" minOccurs="0"/>
<xs:element name="Message_ID" type="xs:string" minOccurs="0"/>
<xs:element name="X_Mailer" type="xs:string" minOccurs="0"/>
<xs:element name="Content" minOccurs="0">
<xs:annotation>
<xs:documentation>any type</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="encoding" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="MailReceipt">
<xs:annotation>
<xs:documentation>Mail Receipt for XI - Mail Adaper</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Server" type="xs:string"/>
<xs:element name="Format" type="xs:string"/>
<xs:element name="UseMailPackage" type="xs:boolean"/>
<xs:element name="Encoding" type="xs:string"/>
<xs:element name="Subject" type="xs:string" minOccurs="0"/>
<xs:element name="From" type="xs:dateTime" minOccurs="0"/>
<xs:element name="To" type="xs:string" minOccurs="0"/>
<xs:element name="Date" type="xs:dateTime" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CustomerlistExternal">
<xs:annotation>
<xs:documentation>Customer List</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Customername" type="xs:string"/>
<xs:element name="Customerid" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
My source message will be something like
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:studentlisttest xmlns:ns1="urn:karthiksender_to_karthikreceiver">
<Student>
<studentid>1</studentid>
<lastname>abclname</lastname>
<firstname>abcfname</firstname>
</Student>
<Mail>
<From>abc@gmail.com</From>
<To>abc@gmail.com</To>
<Subject>Testing Mail adapter</Subject>
</Mail>
</ns1:studentlisttest>
</ns0:Message1>
</ns0:Messages>
I have mapped the <student></student> information to customerlist, with customerid --> studentid and customername --> firstname or lastname (for symplicity). This was a multimapping with one source and two target messages. My test mapping output is
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns2:Mail xmlns:ns2="http://sap.com/xi/XI/Mail/30">
<Subject>Testing Mail adapter</Subject>
<From>abc@gmail.com</From>
<To>abc@gmail.com</To>
</ns2:Mail>
</ns0:Message1>
<ns0:Message2>
<ns2:CustomerlistExternal xmlns:ns2="http://sap.com/xi/XI/Mail/30">
<Customername>abclname</Customername>
<Customerid>1</Customerid>
</ns2:CustomerlistExternal>
</ns0:Message2>
</ns0:Messages>
So how would I get this part of the <CustomerlistExternal></CustomerlistExternal> part of the message as an attachment to the mail address specified in the <ns2:Mail></ns2:Mail> tags.
I'm definitely not understanding it right and am missing something. Could you give me step by step instructions to acheive this. I apologize for the trouble..this would be of great help to me.
Thanks
Karthik
Hi Karthik,
Did you get a solution to this problem ? Even i am stuck with a similar situation and the only two choices left to me are either making a custom adapter module or upgrading to SP14. I've tried every other possible way, but it fails.. If you have solved this then please let me know how you did it. You can mail me @ Qadeer786@gmail.com
Regards,
Qadeer
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.