Hi All! I am new to Axis (v1.4) and I need your help to solve my problem: I used wsdl2java to generate axis code for my web application which runs on Glassfish v2 server. Here is a snippet of my problematic code:
public com.work.MyServiceResponse MyService( com.work.MyServiceRequest MyServiceRequest) throws java.rmi.RemoteException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[0]); _call.setUseSOAPAction(true); _call.setSOAPActionURI("/MyService"); _call.setEncodingStyle(null); _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("http://InputMessageNamespace", "MyService")); setRequestHeaders(_call); setAttachments(_call); try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {MyServiceRequest}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return ( com.work.MyServiceResponse) _resp; } catch (java.lang.Exception _exception) { return ( com.work.MyServiceResponse) org.apache.axis.utils.JavaUtils.convert(_resp, com.work.MyService.class); } } } catch (org.apache.axis.AxisFault axisFaultException) { throw axisFaultException; } } When I deploy and run this code an AxisFault exception is thrown at the first line of the try block (in bold). The trace is: Caused by: java.lang.ClassCastException: org.apache.axis.attachments.AttachmentsImpl cannot be cast to org.apache.axis.attachments.Attachments at org.apache.axis.Message.setup(Message.java:352) at org.apache.axis.Message.<init>(Message.java:246) at org.apache.axis.client.Call.invoke(Call.java:2425) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) ... 61 more |#] I have no attachments to attach but the problem occurs. I tried to comment out setAttachments(_call); but it didn't help. Could You help me, please? Thanks in advance, Ivanhou -- View this message in context: http://www.nabble.com/java.lang.ClassCastException%3A-org.apache.axis.attachments.AttachmentsImpl-cannot-be-cast-to-org.apache.axis.attachments.Attachments-tp25959859p25959859.html Sent from the Axis - User mailing list archive at Nabble.com.