Multipart message in Webservice.

Hello,
I am calling a webservice which is having multipart message as follows:
- <wsdl:message name="PricingAndAvailabilityRequest">
  <wsdl:part name="PricingAndAvailabilityRequestBody" element="pa:PricingAndAvailability" />
  <wsdl:part name="header" element="ebxml:MessageHeader" />
  </wsdl:message>
- <wsdl:message name="PricingAndAvailabilityResponse">
  <wsdl:part name="PricingAndAvailabilityResponseBody" element="par:PricingAndAvailabilityResponse" />
  <wsdl:part name="header" element="ebxml:MessageHeader" />
  </wsdl:message>
- <wsdl:portType name="PricingAndAvailabilityServicePort">
- <wsdl:operation name="PricingAndAvailability">
  <wsdl:input message="avl:PricingAndAvailabilityRequest" />
  <wsdl:output message="avl:PricingAndAvailabilityResponse" />
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="PricingAndAvailabilityServiceBinding" type="avl:PricingAndAvailabilityServicePort">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="PricingAndAvailability">
  <soap:operation soapAction="" />
- <wsdl:input>
  <soap:body parts="PricingAndAvailabilityRequestBody" use="literal" />
- <soap:header message="avl:PricingAndAvailabilityRequest" part="header" use="literal">
  <soap:headerfault use="literal" part="header" message="avl:PricingAndAvailabilityRequest" />
  </soap:header>
  </wsdl:input>
- <wsdl:output>
  <soap:body parts="PricingAndAvailabilityResponseBody" use="literal" />
- <soap:header message="avl:PricingAndAvailabilityResponse" part="header" use="literal">
  <soap:headerfault use="literal" part="header" message="avl:PricingAndAvailabilityResponse" />
  </soap:header>
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
When i am sending the message to Webservice, After mapping,Request message is having Header and body together.
I would like to know whether  xi soap receiver adapter able to include Header in SOAP-HEADER and Body in SOAP-BODY as shown in wsdl definiton and will it support multipart messages.
Thanks in Advace.
Regards,
Sreenivas.

I would like to know whether xi soap receiver adapter able to include Header in SOAP-HEADER
and Body in SOAP-BODY as shown in wsdl definiton and will it support multipart messages
there is a piece of information given in SAP note for this....check if you can get some lead from it:
https://service.sap.com/sap/support/notes/856597
From the SAP note:
My web service expects a SOAP with multiple elements in the SOAP body. How can I create such SOAP message?
Regards,
Abhishek.

Similar Messages

  • Error during saving a multipart message

    Hi All,
                 We are currently integrating third party system with SAP ECC as a part of our FICA implementation.
    We have configured soap adapter initially at the sender side and IDoc adapter at the reciever intially. After looking at the performnace of the soap adapter, we thought of using HTTP sender instead of a soap sender, so that the webservice makes a direct call to PI integration engine instead of Adapter engine.
    Now my scenario looks like.
    Java/J2EE client -> webservice call > XI pipeline>SAP.
    So here , i havent used http adapter at the source side.
    My problem is when i call the XI pipleine url as suggested by the below blog
    <a href="/people/stefan.grube/blog/2006/09/21/using-the-soap-inbound-channel-of-the-integration-engine Soap Inbound channel of the Integration engine</a>
    I am getting the follwoing error as seen below
    <b>May 31, 2007 6:05:50 PM com.sun.xml.messaging.saaj.soap.MessageImpl saveChanges
    </b>
    <b>SEVERE: SAAJ0540: Error during saving a multipart message</b>
    But for my scenario, i havent used any soap with attachments to pass through PI.
    My soap message is a simple soap envelope with soap part-message.(body).
    Please do help me out in resolving this issue.
    Thanks & Regards,
    Dhana
    null

    Hi Steve,
                   My Soap Action is already applied and I traced out few options after googling it up and added few jars (xalan.jar and saxon8.jar). Even now I am getting the same error.
    Please do tell me what to do in this regard.
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Header>
    </SOAP:Header>
    <SOAP:Body>
    <SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>SOAP:Client</faultcode><faultstring>Error during conversion of XI message</faultstring><faultactor>http://sap.com/xi/XI/Message/30</faultactor><detail><SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1"><SAP:Category>XIProtocol</SAP:Category><SAP:Code area="PARSER">UNEXPECTED_VALUE</SAP:Code><SAP:P1>Main/@versionMajor</SAP:P1><SAP:P2>000</SAP:P2><SAP:P3>003</SAP:P3><SAP:P4/><SAP:AdditionalText/><SAP:ApplicationFaultMessage namespace=""/><SAP:Stack>XML tag Main/@versionMajor has incorrect value 000; expected value is 003
    </SAP:Stack></SAP:Error></detail></SOAP:Fault>
    </SOAP:Body>
    </SOAP:Envelope>
    Soap Error message:Error during conversion of XI message
    Thanks,
    Dhana

  • Mail adapter multipart message problem

    Hello everyone.
    I'm experiencing problem with receiver mail adapter. In XIPAYLOAD mode (keeping attachments, use mail package, content encoding - none) messages that has multipart mime type (multipart/alternative exactly) are processing strange way (messages are made from MS Outlook). XI keeps service information and change  some symbols words become  unreadable. For example.
    --_000_135E4C842D542241894122FD84C52E1D4134A33A81mail2itransit_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello world! This is text of multipart message! --_000_135E4C842D542241894122FD84C52E1D4134A33A81mail2itransit_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
    Hello world! T= his is text of multipart message!
    000135E4C842D542241894122FD84C52E1D4134A33A81mail2itransit_
    You can see T= his instead of This. And also why in main payload (<Content> field) it keeps info about all parts of  whole message.
    Attachments are kept correctly.
    Any suggestions how to avoid this problem and keep just useful info (just text with correct symbols)?
    I'm running XI 7.0 SP18.
    Thanks in advance.
    Edited by: Yaroslav Isachenko on Mar 24, 2010 2:31 PM
    Edited by: Yaroslav Isachenko on Mar 24, 2010 2:42 PM

    An OSS would not help, as this is an Outlook issue.
    As far as i know, multipart/mixed works with all mail systems. maybe you give a try?
    Could you post the first lines of your entries in Content tag and the entry and content-type also?

  • Multipart message has "text/plain" content type.

    Hi all,
    I am developing an application which can send and receive email messages including attachments.Because i dont have easy access to real mail servers at the moment, i am using my laptop to test everything("localhost"). my code so far have been able to send,receive and display text messages. it can also send email messages with attachments. The problem comes when i want to retrieve the attachment messages from the "multipart" message. message.isMimeType("multipart/*") returns false and getContentType() method on the message returns "text/plain". as a result my code can not start retreiving the attachments.
    I saved the email message after Transport.Sent(mymsg). Content of the file looks like bellow.
    From: user1@localhost
    To: user2@localhost, user1@localhost
    Message-ID: <22643639.0.1212046661890.JavaMail.user1@localhost>
    Subject: test
    MIME-Version: 1.0
    Thu May 29 10:37:41 EAT 2008: Thu May 29 10:37:41 EAT 2008
    Date: Thu, 29 May 2008 10:37:42 +0300 (EAT)
    ------=_Part_1_30831739.1212046661890
    This is text body part.
    ------=_Part_1_30831739.1212046661890
    Content-Disposition: attachment; filename=testfile1.txt
    content of testfile1.txt
    ------=_Part_1_30831739.1212046661890
    Content-Disposition: attachment; filename=card1.pub
    content of card1.pub
    ------=_Part_1_30831739.1212046661890
    I can also see the received messages in the inbox( JAMES mail server is in my local machine). when opened using notpad, content of these messages is same as the content of the sent messages.
    I am a biginner to java mail(using 1.4.1). so any kind of help would be appreciated. can this problem be linked to using my local machine as mail server or what? I have uninstalled AVG antivirus thinking that it can be interfering. but to no vail. am really stuck at the moment.
    Regards

    Are you sure you're using JavaMail 1.4.1? It looks like you're running into
    an issue that existed back in JavaMail 1.2. How are you saving the message
    to the file?
    Try call msg.saveChanges() before sending the message.
    Also, try using the demo programs that come with JavaMail to see if they're
    working correctly, e.g., msgmultisendsample.java.

  • Receiver Soap Adapter and multipart messages

    Dear SAP XI experts.
    I have a scenario where I should create multipart message in an integration process and send it to a receiver using soap adapter. Is it possible to have two message types, one for main payload and one for attachment?
    In my case I know I have to switch on 'Do Not Use Soap Envelope' and 'Keep Attachments' parameters in communication channel configurations. Anything else needed in this side? For example in Adapter Module configurations?
    Is this scenario: To create multipart message in an integration process and to send it using receiver soap adapter, possible at all?

    Hi,
    >>>>In my case I know I have to switch on 'Do Not Use Soap Envelope' and 'Keep Attachments' parameters in communication channel configurations. Anything else needed in this side? For example in Adapter Module configurations?
    check question:
    My web service expects a SOAP with multiple elements in the SOAP body. How can I create such SOAP message?
    from SAP note: 856597
    and you will know everything
    Regards,
    michal

  • Xi 2.0 http multipart message format

    I'm hoping someone can remember xi 2.0. I am looking for the http that xi 2.0 accepts with a multipart message. Below is a generic multipart message but i need the format xi2.0 receives from any outside request.
    Thanks
    POST /cgi-bin/qtest HTTP/1.1
    Host: aram
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Referer: http://aram/~martind/banner.htm
    Content-Type: multipart/form-data; boundary=----
    287032381131322
    Content-Length: 582

    Hi,
    Press "enter" button when you see the message "query strings are not allowed".
    Then you will be able to save your destination successfully.
    Do a test connection and you will get a reply like the following for e.g.:
      HEADER NAME                HEADER VALUE
    ~response_line               HTTP/1.0 500 Empty HTTP request received
    ~server_protocol             HTTP/1.0
    ~status_code                 500
    ~status_reason               Empty HTTP request received
    content-type                 text/xml
    content-length               814
    content-id                   <[email protected]
    soapaction                   'http://sap.com/xi/XI/Message/30'
    server                       SAP Web Application Server (1.0;640)
      HTTP BODY
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">#<
    SOAP:Header>#</SOAP:Header>#<SOAP:Body>#<SOAP:Fault xmlns:SOAP="http://s
    chemas.xmlsoap.org/soap/envelope/"><faultcode>SOAP:Client</faultcode><fa
    ultstring>Empty HTTP request received</faultstring><faultactor>http://sa
    p.com/xi/XI/Message/30</faultactor><detail><SAP:Error xmlns:SAP="http://
    sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/en
    velope/" SOAP:mustUnderstand="1"><SAP:Category>XIProtocol</SAP:Category>
    <SAP:Code area="MESSAGE">EMPTY_HTTP_REQUEST_RECEIVED</SAP:Code><SAP:P1/>
    <SAP:P2/><SAP:P3/><SAP:P4/><SAP:AdditionalText/><SAP:ApplicationFaultMes
    sage namespace=""/><SAP:Stack>Empty HTTP query received. No message proc
    essing possible##</SAP:Stack></SAP:Error></detail></SOAP:Fault>#</SOAP:B
    ody>#</SOAP:Envelope>#
    Also note that the query string given in the documentation has wrong syntax.
    The path prefix shld be: /sap/xi/engine?type=entry
    Regards,
    Sridhar

  • Incorrect display of MIME Multipart message

    I have non critical, yet annoying problems.
    My problem is similar to:
    https://support.mozilla.org/en-US/questions/992656?esab=a&as=aaq
    I have a single sender who email's do not display the proper Mime attachment inline. What I have found is that the order of the mime parts seems to be important. In my case, the "HTML" content is listed first in the message, and the "text" content is second. In this case, the "text" is the body part that is displayed.
    I have access to the source message. I simply reversed the order of the body parts in the source message, then the HTML version is displayed.
    I did installed the addon https://support.mozilla.org/en-US/kb/viewing-all-body-parts
    I am able to see both parts when I set the correct settings.
    My questions seem to be, (why) does Thunderbird care what order the body parts are in? If I choose view "original html", shouldn't thunderbird display the HTML if it exists?
    I can post the source message if you think it will help. However as I said, simply re-order the body parts, I get the HTML when it is the 2nd / last body part.

    It is standard practice for the body parts to be Text then HTML.
    I think the RFC explains the situation fairly well
    http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
    To quote
    As a very simple example, the following multipart message has two parts, both of them plain text, one of them explicitly typed and one of them implicitly typed:
    From: Nathaniel Borenstein <[email protected]>
    To: Ned Freed <[email protected]>
    Subject: Sample message
    MIME-Version: 1.0
    Content-type: multipart/mixed; boundary="simple
    boundary"
    This is the preamble. It is to be ignored, though it
    is a handy place for mail composers to include an
    explanatory note to non-MIME compliant readers.
    --simple boundary
    This is implicitly typed plain ASCII text.
    It does NOT end with a linebreak.
    --simple boundary
    Content-type: text/plain; charset=us-ascii
    This is explicitly typed plain ASCII text.
    It DOES end with a linebreak.
    --simple boundary--
    This is the epilogue. It is also to be ignored.
    The use of a Content-Type of multipart in a body part within another multipart entity is explicitly allowed. In such cases, for obvious reasons, care must be taken to ensure that each nested multipart entity must use a different boundary delimiter. See Appendix C for an example of nested multipart entities.
    The use of the multipart Content-Type with only a single body part may be useful in certain contexts, and is explicitly permitted.

  • Message style webservice WLS6.1SP5

    Hi there,
    I have implemented a message style webservice that sends data to a soap client.
    In my tests, the java client works fine, but the .NET client looses messages.
    On the client side I invoke receive on both clients, but the .NET client seems
    to close the connection between subsequent calls and looses the message (This
    is my guess because the number of subscribers is increasing with subseq. calls).
    What am I missing?
    Thanks
    Juerg

    I did some more investigation and have analyzed what a .NET clients sends and what
    a Java Client sends:
    Here are the results:
    JAVA CLIENT
    =========
    POST /WebServices/serverPush HTTP/1.1
    SOAPAction: "urn:receive"
    Content-Type: text/xml; charset=utf-8
    User-Agent: Java1.3.1_01
    Host: localhost:8080
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alive
    Content-length: 490
    <?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'><SOAP-ENV:Body><ns1:receive xmlns:ns1='urn:serverPushWS'
    SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml http://schemas.xmlsoap.org/soap/encoding/'></ns1:receive></SOAP-ENV:Body></SOAP-ENV:Envelope>
    JAVA CLIENT HEADER
    ===============
    <HTTPHeaders><authorization>Basic bnVsbDpudWxs</authorization><user-agent>Java1.3.1_01</user-agent><host>localhost:8080</host><accept>text/html,
    image/gif, image/jpeg, *; q=.2, */*; q=.2</accept><connection>keep-alive</connection></HTTPHeaders>
    .NET CLIENT MESSAGE
    ===============
    <?xml version="1.0" encoding="utf-8" ?>
    - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:tns="urn:local" xmlns:types="urn:local/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <q1:receive xmlns:q1="urn:serverPushWS" />
    </soap:Body>
    </soap:Envelope>
    .NET CLIENT HEADER
    ==============
    - <HTTPHeaders>
    <user-agent>Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol
    1.0.3705.0)</user-agent>
    <content-type>text/xml; charset=utf-8</content-type>
    <soapaction>"urn:receive"</soapaction>
    <content-length>468</content-length>
    <expect>100-continue</expect>
    <connection>Keep-Alive</connection>
    <host>localhost</host>
    </HTTPHeaders>
    The only maor difference that I see, is that the Java client also sends a HTTP
    header. Could this make the difference?
    Please help
    Juerg
    "Juerg Staub" <[email protected]> wrote:
    >
    Hi there,
    I have implemented a message style webservice that sends data to a soap
    client.
    In my tests, the java client works fine, but the .NET client looses
    messages.
    On the client side I invoke receive on both clients, but the .NET client
    seems
    to close the connection between subsequent calls and looses the message
    (This
    is my guess because the number of subscribers is increasing with subseq.
    calls).
    What am I missing?
    Thanks
    Juerg

  • Really stuck with multipart message...

    I post below the essence of my code... I read a lot of pages on the internet but my multipart message doesn't want to work :
    With Outlook the mailer says that the encoding is unsupported and it attaches the multipart as a text file...
    In outlook express the message is ok but the images used as datasources are attached a second time, as regular files. I have checked everything several times...
    Thanks for any hint, I lost my day :-(
    I use javamail API 1.3, jaf 1.0.2, jdk 1.3.1
    I have an ArrayList for the datasources, one for their headers, another one for the urls to the fiels to attach and a last one for the file names. I have 3 datasources (gif images) and 2 attachments (xml and pdf). The multipart message code is snipped at the bottom.
    Barbara
    // creates mail session and mime message
    this.mailSession = javax.mail.Session.getDefaultInstance(this.props, null);
    this.msg = new MimeMessage(mailSession);
    MimeBodyPart mbp1 = new MimeBodyPart();
    Multipart mmp = new MimeMultipart();
    //set from, to and cc fields ok
    try{
    this.msg.setSubject(this.subject,this.mimeCharSet);
    this.msg.setSentDate(new java.util.Date());
    catch(Exception e){}
    // html ?
    try{
    if(html){
    mbp1.setContent(this.body,"text/html");
    mbp1.addHeaderLine("Content-Type: text/html;charset=" + this.mimeCharSet +"\"");
    mbp1.addHeaderLine("Content-Transfer-Encoding: quoted-printable");
    else{
    mbp1.setContent(this.body, "text/plain");
    mbp1.addHeaderLine("Content-Type: text/plain;charset=" + this.mimeCharSet +"\"");
    mbp1.addHeaderLine("Content-Transfer-Encoding: 8bit");
    mmp.addBodyPart(mbp1);
    catch(Exception e){System.out.println("bug with content : " + e);}
    // datasources and headers
    try{
    if(this.dataSources != null){
    for(int j=0;j < this.dataSources.size();j++){
    BodyPart mbp2 = new MimeBodyPart();
    javax.activation.DataSource aSource = new URLDataSource(new URL((String) this.dataSources.get(j)));
    mbp2.setDataHandler(new DataHandler(aSource));
    mbp2.setHeader("Content-ID",(String) dsHeaders.get(j));
    System.out.println("added datasource : " + this.dataSources.get(j));
    mmp.addBodyPart(mbp2);
    catch(Exception e){
    System.out.println("bug with add datasources " + e);
    // other attachments
    try{
    if(this.file != null){
    for(int j=0;j < this.file.size();j++){
    BodyPart mbp2 = new MimeBodyPart();
    javax.activation.DataSource aSource = new URLDataSource(new URL((String) this.file.get(j)));
    mbp2.setDataHandler(new DataHandler(aSource));
    System.out.println("attached file : " + this.file.get(j));
    try{
    mbp2.setFileName((String) fileName.get(j));
    catch(Exception e){// no filename
    mmp.addBodyPart(mbp2);
    this.msg.setContent(mmp);
    catch(Exception e){
    System.out.println("bug with add files " + e);
    try{
    javax.mail.Transport.send(this.msg);
    catch(Exception e){
    System.out.println("send mail failed : " + e);
    Now the multipart message :
    Received: from <snip> with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21)
         id P63WS3KF; Mon, 9 Sep 2002 16:57:07 +0200
    Message-ID: <4650852.1031581670610.JavaMail.[snip]>
    Date: Mon, 9 Sep 2002 16:27:49 +0200 (CEST)
    From: =?iso-8859-1?Q?Barbara=A0Post?= <[snip]>
    To: <snip>
    Subject: Some subject
    Mime-Version: 1.0
    Content-Type: multipart/mixed; boundary="----=_Part_0_8194658.1031581669238"
    ------=_Part_0_8194658.1031581669238
    Content-Type: text/html;charset=iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <snip of html code>
    ------=_Part_0_8194658.1031581669238
    Content-Type: image/gif
    Content-Transfer-Encoding: base64
    Content-ID: 69zzz@pc01
    <snip of first included image code>
    ------=_Part_0_8194658.1031581669238
    Content-Type: image/gif
    Content-Transfer-Encoding: base64
    Content-ID: 69zzz@pc00
    R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAQAICRAEAOw==
    ------=_Part_0_8194658.1031581669238
    Content-Type: image/gif
    Content-Transfer-Encoding: base64
    Content-ID: 69zzz@pc02
    <snip of third included image code>
    ------=_Part_0_8194658.1031581669238
    Content-Type: text/xml; name=nop41.xml; charset=Cp1252
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: attachment; filename=nop41.xml
    <snip of xml attachement code>
    ------=_Part_0_8194658.1031581669238
    Content-Type: application/pdf; name=nop41lt.pdf
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename=nop41lt.pdf
    <snip of pdf attachement code>
    ------=_Part_0_8194658.1031581669238--

    Basic message structure required is
    *{HEADERS}
    *{MULTIPART MIME MESSAGE (RELATED)}
    *>>>{PART 1 MULTIPART PART (ALTERNATIVE)}
    *>>>>>>{PLAIN TEXT PART}
    *>>>>>>{HTML TEXT PART}
    *>>>{END PART 1 MULTIPART PART (ALTERNATIVE)}
    *>>>{PART 2 INLINE IMAGE FILE (GIF/JPEG etc}
    *>>>......
    *>>>{PART n     }
    *{END MULTIPART MIME MESSAGE (RELATED}
    Snippet of code I use, but be aware all the html references to images etc are converted to cid:xxxxxxxxxxxx format outside of this code. No point in sending the image in the message if you refer to it by a url like http://www.foo.org/image1.gif
    SH
    <Code Snippet>
    // create a message
    msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(from));
    msg.setSubject(subject);
    // create and fill the first message part with the Title and plain text
    MimeBodyPart mbpa1 = new MimeBodyPart();
    mbpa1.setText(ho.getTitle() + "\n" + ho.getText());
    mbpa1.addHeaderLine("Content-Type: text/plain; charset=\"iso-8859-1\"");
    mbpa1.addHeaderLine("Content-Transfer-Encoding: quoted-printable");
    // Create and fill the second message part with the HTML code
    MimeBodyPart mbpa2 = new MimeBodyPart();
    mbpa2.setText(ho.getHTMLCode());
    mbpa2.addHeaderLine("Content-Type: text/html; charset=\"iso-8859-1\"");
    mbpa2.addHeaderLine("Content-Transfer-Encoding: quoted-printable");
    // create the Multipart and its parts to it
    Multipart mp = new MimeMultipart("related");
    Multipart mp2 = new MimeMultipart("alternative");
    mp2.addBodyPart(mbpa1);
    mp2.addBodyPart(mbpa2);
    MimeBodyPart mbp1 = new MimeBodyPart();
    mbp1.setContent(mp2);
    mp.addBodyPart(mbp1);
    if (inline) {
    // Enumerate the Image Names and add them to the message
    for (Enumeration e = ho.getImageNames(); e.hasMoreElements();) {
    String str = e.nextElement().toString();
    MimeBodyPart mpi;
    URL url2;
    String fullStr = ho.getImageUrl(str);
    if (inlineAll || ho.isImageLocal(fullStr)) {
    if (debug)
    System.out.println("Adding: " + fullStr);
    url2 = new URL(fullStr);
    mpi = new MimeBodyPart();
    URLDataSource fds2 = new URLDataSource(url2);
    mpi.setDataHandler(new DataHandler(fds2));
    // mpi.addHeaderLine("Content-Location: " + fullStr);
    if (ho.getCidValue(str).length() > 0)
    mpi.setHeader("Content-ID", ho.getCidValue(str));
    mp.addBodyPart(mpi);
    // add the Multipart to the message
    msg.setContent(mp);
    // set the Date: header note that the java.sql package also defines date
    msg.setSentDate(new java.util.Date());
    </Code Snippet>

  • MultiPart message parts extraction help

    http://fisheye5.cenqua.com/browse/~raw,r=1.2/glassfish/mail/src/java/demo/msgshow.java
    This is a demo of multipart message handling, and i see the recursion (implemented exactly like this) not to fit in this particular case (mine), and i seek another solution.
    In general i have 2 questions. Is it a typical case when the message has nested mutiparts ?
    and: can i introduce a method which translates the "nested" mutipart tree into a sequential list which is returned, and then processed by the main handler method, or i must make use of the depth levels ?
    Thanks.

    Well.. Is it an error if i dont handle all parts ?Depends on your application. What will your application do if it encounters a message it can't
    handle? Ignore it? Is that ok with you?
    What are these mime types, multipart/mixed, mutipart/alternative etc. why do i need them ?
    What is the minimum i need to implement in order to handle the basic case, as for example in the typical web-mail sites (some text, and some attachments)? what mechanism i need to use for reporting the not supporting of any "advanced" features.
    In what case does the nested thing arise ?You have much to learn!
    I'd suggest one of the books referenced here:
    [http://java.sun.com/products/javamail/community/books/index.html|http://java.sun.com/products/javamail/community/books/index.html]
    or the online resources here:
    [http://java.sun.com/products/javamail/community/links/index.html|http://java.sun.com/products/javamail/community/links/index.html]
    You'll also find the JavaMail specification helpful. (It's included in your JavaMail download bundle.)
    Common causes of nested multiparts are:
    A message with both plain and html alternate bodies, and also an attachment.
    Signed or encrypted messages with attachments.
    A forwarded message that contains attachments.

  • How to properly store multipart messages

    Hello all !
    How can I properly store a multipart message ?
    For example in a database, is it proper to use a structure like that:
    (pseudocode)
    class Part {
          Set<Part> children;   //  (for multipart message the field is set, else is null)
          [fields of the part or]
          byte[] content;
    }or should I stick to the simple case where i have a text message with several attachments ?
    in case the message is HTML newsletter how to handle "embedded" images or content, and how is the general case of manipulating such messages ?
    Thank you
    Edited by: javaUserMuser on Jul 24, 2008 10:18 AM

    OMG.... That I DIDNT THINK OF !!!!!!
    Man, thats so original, and very simple anyway... and very functional ! Its very good approach I am considering.
    But anyway...
    If i want to implement efficient search functionality I shall implemement a respective custom word/component index as opposed to native database indices (for the blob). Is this correct ?
    Anyway, can u suggest a/the correct way of storing the (plain/nested) parts/data as an alternative of the approach u suggest. THANKS ! :)))

  • How to create multipart message manually in wcf consumptions

    Hi,
    My purpose is to consume simple wcf service through biztalk and I am also able to do this for doing this i have following steps
    step 1)  add -->generated itmes -->consume wcf service      
    through this wizard  i got one .odx file two binding xml  files and some schemas
    step 2) in oxd file i created 3 messages 
    1-msgIn which is a simple type of mesage which is accepting input from our request schema
    2-msgWcfReq- by this message we are sending a request to wcf (but when we are selecting the messagetype for this message we are selecting it form "multipart message type node" inside this node there are some automatically generated schemas when
    we used wcf wizard)
    3-similarly for response message also we are selecting messagetype from "multipart message type node".
    and rest of the mapping we are doing and we deployed the solution and we importing the binding file which was genrated by wcf wizrad.
    so it automatically fill everything for WCF port like pipeline/wcf url/soap action header
    Now My question is if i am deleteing the automatically generated odx file then we don't have those aotogenrated port and schemas which are comming under "multipart message type node" 
    so now how we can achieve the same thing means now i am trying to create same 3 type of message which i discussed above,because if i am trying to create multipart message manually then we don't have any schema type of things inside "multipart message
    type node".
    if this problem is resolved the everything will work for me  because in administration console still i want the same "bindinginformation.xml " file for wcf port bindings.
    Please help me
    Thx
    Manoj

    Hi Manoj,
    You should not delete the auto generated orchestration even do not modify it, as it is stated in msdn.
    The BizTalk WCF Service Consuming Wizard creates in your BizTalk project the BizTalk schemas and types necessary to consume WCF services. The BizTalk types such as port types and multipart message types are created in an orchestration. We recommend
    that you do not modify the orchestration that the wizard creates. Instead, you can add new orchestrations in the BizTalk project for your purposes.
    --------- MSDN
    For Refernce
    In your solution, if you are seperating your schemas project from orchestration project, in that case i personally advise to generate wcf endpoint in your schema project and after adding schema reference in orchestration
    project you manually create the multipart message and a request response port as it will not display in existing port.
    Regards

  • E-mail receiver QPAC crashes when receiving MIME/multipart messages with various subparts

    Hi,
    does the E-Mail receiver currently support MIME/multipart messages which contain various subparts?
    When receiving a mime message like
    message 34
    over here, E-Mail receiver stalls and throws the following exception:
    Exception occurred - explicitly stalling action. Exception:com.adobe.workflow.pat.PATRuntimeException: The attachment null could not be retrieved because its type cannot be handled by this qpac. Type: class javax.mail.internet.MimeMultipart
    Does e-mail receiver currently support mime/multipart messages containing various subparts or not?
    Is there anyone out there to clarify this?
    Steve

    Hmm. No unfortunately I cannot send you the original message because I didn't keep it.
    But never mind. We managed to implement a simple workaround: the Email server reformats emails before forwarding them to the workflow server. Which is quite good a solution since the workflow doesn't care about message-bodies but about attachments. So, it's safe to reformat the message body (or even throw it away).
    Steve

  • Message style WebService

    Using weblogic webservicesExamples for the Message style web service I'm not able to see the Message Receive web service on the examples console messageexample web service comes
    Why is so
    Regards
    Shalini
    [att1.html]
    [tech.gif]

    Problem solved when I set the timeout in the wsgen generated ear/war/web.xml. Setting
    the timeout via console was the problem.
    Thanks
    Juerg
    "Juerg Staub" <[email protected]> wrote:
    >
    Hello,
    I am successfully using message style webservices on WLS6.1SP5 with .NET
    clients.
    One remaining problem I have is, that even when I shutdown all of my
    clients,
    the servlet sessions on the server never disapear (which is causing an
    OutOfMemory
    exeception finally). I have set the session timeout to 1 minute via the
    console,
    with no success.
    Thanks
    Juerg

  • What is the difference between message and multipart message?

    Does the multipart message type provides the flexibility that the schema assigned to it can be changed later on?
    Suppose if a message is assigned with the schema directly, can it not be changed(adding, deleting elements,etc)
    once deployed.
    If the receive port is set to message box, should the receive shape be assigned with multi part message type or just with a message where a schema is assigned directly.
    what should be done if the input schema which is not a multipart message type changes after deployed?

    Thread Question: Technically, there is no difference.  All messages are multi-part.  The 'single part' type in the Orchestration Designer is just a convenience offered by the Orchestration Designer, the underlying type is the same for both.
    First Question: The difference you see is that the Orchestration Designer does not enforce the Body part Type on Port bindings because it it abstracted by the Multi-Part Type, which, yes, means you can change Body Part Type without having to unhook the Port
    and Receive/Send Shapes.
    Second Question: You can make any change to a Schema, except the Root Node Name and Namespace, without affecting the Message variables or Port types at all.  So yes, you can add/remove/change elements without even opening an Orchestration.
    Third Question: There's really no difference because outside of the Orchestration Designer, there is no difference between the 'single' and Multi-Part Message type.  You will always get a filter on the Body part MessageType.

Maybe you are looking for

  • Office 2013 Pro-Plus installation problem on Windows 8

    Downloaded OfficeProfessionalPlus_x86_en-us.img from TechNet on my brand new Dell PC. When double clicked, Windows complains 'Sorry, There was a problem mounting the file". Used 7Zip and saw a Setup.exe When I ran Setup.exe it complains "The specifie

  • Safari quit unexpectedly while using the SystemConfiguration plug-in

    Hi everyone, When I try to launch Safari, I get this message: Safari quit unexpectedly while using the SystemConfiguration plug-in. Any idea how to solve this problem? Thanks so much! Below is all relevant information: Process:         Safari [5745]

  • Processing a text file.

    I have this project where I have a number of reports as input to my application. Each report is about a patient, which contains information like patient's Date of birth, name, test date, bp, cholesterol, etc... and also at the end of the report it ha

  • HT1420 if i sold a computer and forgot to unauthorize itunes what i should do next

    if i sold a computer and forgot to deauthorize the itunes, itunes wont let me authorize my new computer. what should I do? I have no ways of getting the computers back, some are sold some hit the garbage. thanks

  • Connection problem in Linux systems: redhat and suse

    I install Sun Java System Application Server Platform Edition 9.0 in RedHat and SuSE linux in my intranet with wondows XP. The servers run correctly in both RedHat and SuSE systems. That means in each system, I can use: http://localhost:8080 or their