Results 1 to 2 of 2
  1. #1
    chotto is offline Member
    Join Date
    Oct 2010
    Posts
    1
    Rep Power
    0

    Thumbs up how to get mime boundary

    i also having the same issue!!

    i am using axis 1.2 and my code as below:

    MessageFactory messageFactory = MessageFactory.newInstance();
    SOAPMessage message = messageFactory.createMessage();
    //Create objects for the message parts
    SOAPPart soapPart = message.getSOAPPart();
    SOAPEnvelope envelope = soapPart.getEnvelope();
    SOAPBody body = envelope.getBody();
    //Populate the body
    //Create the main element and namespace
    String reconRep = "40637781|44084597|110|20091019141048|121|||\n " +
    "77371568|44084597|120|20091019141050|121|||\n " +
    "66432343|44084597|130|20091019141059|121|41111111 11111111||\n" +
    "TOT. REC : 3 TOT. AMT : 360";

    //Populate the body
    //Create the main element and namespace
    SOAPBodyElement ops = body.addBodyElement(envelope.createName("ReconRepo rt" ,"ns1","http://paymentGateway.celcom.com"));
    SOAPElement rrtelement1 = ops.addChildElement("ns1:login").addTextNode("eonb ");
    SOAPElement rrtelement2 = ops.addChildElement("ns1:pass").addTextNode("eonb" );
    SOAPElement rrtelement3 = ops.addChildElement("ns1:filename").addTextNode("2 0101013.txt");
    SOAPElement rrtelement4 = ops.addChildElement("ns1:desc").addTextNode("Recon ciliation report");
    SOAPElement rrtelement5 = ops.addChildElement(envelope.createName("attachmen t" ,"ns1","http://www.w3.org/2005/05/xmlmime"));
    rrtelement5.addAttribute(envelope.createName("cont entType","ns2","text/plain"),"text/plain");
    rrtelement5 = ops.addChildElement("xop","");
    SOAPElement att = rrtelement5.addChildElement(envelope.createName("I nclude" ,"xop","http://www.w3.org/2004/08/xop/include"));
    att.addAttribute(envelope.createName("href"), "cid:" + "1.urn:uuid:363C4A73A8CE5D13101255934202526@apache .org");


    AttachmentPart attachment = message.createAttachmentPart();
    attachment.addMimeHeader("Content-Type","Multipart/Related; boundary=MIME_boundary; \n" +
    " type=\"application/xop+xml\"; start=\"1.urn:uuid:363C4A73A8CE5D13101255934202526 @apache.org\"");
    attachment.setContent(reconRep,"text/plain");
    attachment.setContentId("1.urn:uuid:363C4A73A8CE5D 13101255934202526@apache.org");
    message.addAttachmentPart(attachment);
    //Save the message
    message.saveChanges();


    The result is :
    ------=_Part_0_26083064.1287029047655
    Content-Type: text/xml; charset=utf-8
    Content-Transfer-Encoding: 8bit
    Content-ID: __WLS__1287029047693__SOAP__

    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Body>
    <ns1:ReconReport xmlns:ns1="http://paymentGateway.celcom.com">
    <ns1:login>eonb</ns1:login>
    <ns1:pass>eonb</ns1:pass>
    <ns1:filename>20101013.txt</ns1:filename>
    <ns1:desc>Reconciliation report</ns1:desc>
    <ns1:attachment ns1:xmlns="http://www.w3.org/2005/05/xmlmime" ns1:contentType="text/plain">
    <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:1.urn:uuid:363C4A73A8CE5D131012559342025 26@apache.org">
    </xop:Include>
    </ns1:attachment>
    </ns1:ReconReport>
    </env:Body>
    </env:Envelope>
    ------=_Part_0_26083064.1287029047655
    Content-Type: text/plain
    Content-Id: 1.urn:uuid:363C4A73A8CE5D13101255934202526@apache. org

    40637781|44084597|110|20091019141048|121|||
    77371568|44084597|120|20091019141050|121|||
    66432343|44084597|130|20091019141059|121|411111111 1111111||
    TOT. REC : 3 TOT. AMT : 360
    ------=_Part_0_26083064.1287029047655--


    how to get mime boundary

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Replies: 1
    Last Post: 03-05-2010, 03:05 AM
  2. Creating a boundary line in java
    By Riz in forum New To Java
    Replies: 2
    Last Post: 09-03-2009, 01:54 AM
  3. getting the default browser+MIME data
    By waleed_cs2000 in forum Networking
    Replies: 1
    Last Post: 04-08-2008, 02:31 PM
  4. Mime type of a file from web
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-03-2008, 06:20 PM
  5. Mime type of a file
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-03-2008, 06:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •