Hi All !

I'm trying to add an attachment in the stubs created using wsdl2java tool.
How do I add an attachment for stubs created using wsdl2java
Here is my client code .

 org.apache.axis.client.Stub s = (Stub) service;
 :
 :
 AttachmentPart ap = new AttachmentPart();
 ap.setContent(new ByteArrayInputStream(image), "image/jpeg");
 ap.setMimeHeader("Ordinal", String.valueOf(counter));
 ap.setContentId("attachment");

 s.addAttachment(ap);

when I invoke the method it gives the following exception.

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.RuntimeException: No support for attachments
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace: java.lang.RuntimeException:
No
support for attachments
        at org.apache.axis.client.Call.setRequestMessage(Call.java:1998)
        at org.apache.axis.client.Call.invoke(Call.java:2243)
        at org.apache.axis.client.Call.invoke(Call.java:2171)
        at org.apache.axis.client.Call.invoke(Call.java:1691)

Any pointer will be great help.

Thanks in advance
Kumar Raj

Reply via email to