You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Tomas Molina <tm...@ncmir.ucsd.edu> on 2006/06/22 02:54:07 UTC

question about WSDL2Java and attachments

Hello all,

I have setup a c++ webservice  in which I obtain a WSDL and run it 
through WSDL2Java
to generate the necessary stub files for dealing with DIME attachments.  
I have found that when I try
to receive the attachment back, at run time I get

"Error: java.lang.ClassCastException: 
org.apache.axis.attachments.AttachmentPart"

with the line
"return (Data) _resp"  Data was my class that was created from the WSDL2Java

 try {java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new 
java.lang.Double(a)});

        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (Data) _resp;
            } catch (java.lang.Exception _exception) {
                return (Data) 
org.apache.axis.utils.JavaUtils.convert(_resp, Data.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}


I was curious to know if anyone else ever received this error?

I am using the Axis1.3F and the activation.jar and mail.jar from 
javamail version 1_4. 

Perhaps someone can suggestion
another activation.jar that I should try with?  I have tried with 
various versions of Axis so I am thinking
it has something to do with the Attachment part of it.  I have gotten to 
work by extracting the _resp
by casting it to org.apache.axis.attachments.AttachmentPart and getting 
at the data that way, but I want
to understand why the generated code doesn't work at runtime.

I appreciate any feedback.

thanks

Tom



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