axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Fichtenholtz <greg_fichtenho...@yahoo.com>
Subject [Axis2] to to send multipart/related message
Date Mon, 21 Aug 2006 05:52:20 GMT
Hello,
my goal is to send multipart/related message (SOAP envelope with attachments).
 
My client code looks like this:
 
 public static void main(String[] args)
  throws Exception
 {
     EndpointReference targetEPR = new EndpointReference("http://localhost:8080/axis2/services/AttachService");
     Options options = new Options();
        options.setTo(targetEPR);
        options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
  OMFactory factory = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = factory.createOMNamespace(
                "http://example1.org/example1", "example1");

        OMElement method = factory.createOMElement("echo", omNs);
        OMElement value = factory.createOMElement("image", omNs);
  String inputImageFileName = "C:\\TEMP\\ALSB.jpl";
        Image image = new ImageIO().loadImage(new FileInputStream(inputImageFileName));
        ImageDataSource ds = new ImageDataSource("ALSB.jpl",image);
        DataHandler dh = new DataHandler(ds);
        OMText textData = factory.createOMText(dh, true);
        value.addChild(textData);
        method.addChild(value);

        //Blocking invocation
        ServiceClient sender = new ServiceClient();
        sender.setOptions(options);
        OMElement result = sender.sendReceive(method);
        System.out.println(result);
 }

 
for some reason when I send this, both SOAP Monitor and network sniffer show that the actual
data sent on the wire looks like this:
 
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header />
  <soapenv:Body>
    <example1:echo xmlns:example1="http://example1.org/example1">
      <example1:image>/9j/4AAQSkZJRgABAgAAAQABAAD/2w...</example1:image>
    </example1:echo>
  </soapenv:Body>
</soapenv:Envelope>
 
(I shortened the contents of the image element for brevity)
 
This is not what I expected and not what I want. Could some one please help figure out why
multipart/related MIME message is not used in this case?
 
Thanks in advance
Greg

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message