Webservice with attachment problem

Need some help to make webservice work.

I’ve been worked on 1 week but cant get it done yet.

I was testing webservice using Eclipse 3.3.1

what I need to do is make a simple webservice with attachment.

It’s first time to try with attachment, so I not sure what’s wrong on

my setting.


version : IS 7.1.2

flow has only one field = ‘FILENAME’

WSD Setting : attachment enabled = true
Binder Setting :
SOAP version = 1.2
SOAP binding style = document
SOAP binding use = literal
SOAP binding transport = [URL]http://schemas.xmlsoap.org/soap/http[/URL]


java version : 1.5

library jars :
axis.jar
commons-discovert-0.2.jar
jaxrpc.jar
saaj.jar
wsdl4j-1.5.1.jar
org.apache.commons.logging_1.0.4.c200706111724.jar
activation1.0.1.jar
mail.jar

java Client code

WSDLattatchment requestParam = new WSDLattatchment();
requestParam.setFileName(“test”);
java.io.File file = new java.io.File(“d:\string.class”);
DataHandler dh = new DataHandler(new FileDataSource(file));

stub.addAttachment(dh);

WSDLattatchmentResponse response = response=stub.WSDLattatchment(requestParam);


it works fine without line

  • stub.addAttachment(dh);

but with the line, it occurs error below

[ISC.0088.9328E] MTOM Attachments Processing Failed: Cannot de-serialize the input MIME Stream; value of the ‘type’ parameter of the ‘Content-Type’ header of the MIME message is not equal to ‘application/xop+xml’

please help… :confused:

I think the problem was version library mismatch.

After downloaded Axis lib package from [URL]http://ws.apache.org/axis/[/URL] no more same error.

but on the server side, there’s still error message shows

[ISC.0088.9335E] MTOM Attachments Processing Failed: Cannot de-serialize the input MIME Stream; input stream is not a valid MIME stream

on client side:

  • java.io.IOException:
    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/octet-stream

how can I send valid webservice data with attatchment?