Axis2
  1. Axis2
  2. AXIS2-5067

content-type header is not generated with SAAJ API

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.5.6, 1.6.1, 1.7.0
    • Component/s: saaj
    • Labels:
      None

      Description

      In the scenario below :
      SOAPMessage msg = MessageFactory.newInstance().createMessage();
      SOAPPart sp = msg.getSOAPPart();
      SOAPEnvelope envelope = sp.getEnvelope();
      SOAPBody bdy = envelope.getBody();
      SOAPBodyElement sbe = bdy.addBodyElement(envelope.createName("Body1", "ns1", "http://www.helloworld.org"));
      sbe.addChildElement(envelope.createName("c1", "ns1", "http://www.helloworld.org")).addTextNode("HelloWorld");

      URL url = new File("D:\\opensource\\axis2\\axis2\\axis2-1.5\\modules\\saaj
      pom.xml").toURI().toURL();
      AttachmentPart attachmentPart = msg.createAttachmentPart(new DataHandler(url));
      attachmentPart.setContentType("text/xml");
      msg.addAttachmentPart(attachmentPart);
      msg.saveChanges();

      If we use SOAPMessage.writeTo method to write to the message to an servlet outputstream, those boundary, content-id values are generated on the fly. And for the client applications, there is no way to get the corresponding content-type header.

      1. AXIS2-5067.patch
        13 kB
        Ivan
      2. AXIS2-5067-01.patch
        17 kB
        Ivan

        Activity

          People

          • Assignee:
            Andreas Veithen
            Reporter:
            Ivan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development