axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Fichtenholtz <>
Subject [Axis2] to to send multipart/related message
Date Mon, 21 Aug 2006 05:52:20 GMT
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();
  OMFactory factory = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = factory.createOMNamespace(
                "", "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);

        //Blocking invocation
        ServiceClient sender = new ServiceClient();
        OMElement result = sender.sendReceive(method);

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="">
  <soapenv:Header />
    <example1:echo xmlns:example1="">
(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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message