You are missing the JavaMail classes from your CLASSPATH.  Axis silently
checks for the MIME classes on startup and if it does not find them,
will throw this exception when you try to create a MIME attachment.
Your app server should ship with a copy of the relevant JAR.

-----Original Message-----
From: Kumar Raj [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2003 8:15 AM
To: [EMAIL PROTECTED]
Subject: Support for attachments in wsdl2java ???


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