RE: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception
Anne I have tracked my ongoing 'SimpleDeserializer' SAX exception down to my 'wrapped/literal' web service's handling of an expected Vector-type value in the invoked web service 'addUser' method's parameter, which is of type 'HashMap'. Is there a known problem at AXIS 1.1 when 'wrapped/literal' web services have to handle Vector-type values within HashMap's ? If you could take a look at the attached 'tcpmon' trace of a request/response between the original RPC/Encoded client/service ('TSMAdapter RPC Enc addUser.log ') you will see that there is an item representing a Vector defined thus: item key xsi:type=xsd:stringalias/key value href=#id2/ /item multiRef id=id2 soapenc:root=0 soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xsi:type=ns3:Vector xmlns:ns3=http://xml.apache.org/xml-soap; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; item xsi:type=xsd:string[EMAIL PROTECTED]/item item xsi:type=xsd:string[EMAIL PROTECTED]/item /multiRef If you then take a look at the attached 'tcpmon' trace of a request/response between the converted Wrapped/literal client/service ('TSMAdapter Wrapped Lit addUser.log') you will see that the equivalent item representing a Vector is defined thus: item keyalias/key value item[EMAIL PROTECTED]/item item[EMAIL PROTECTED]/item /value /item You will also then see the exception being returned in this trace. I have checked that removal of this all other such Vector-type values from the 'hUserDtls' HashMap passed as a parameter by the client on the 'addUser' invocation prevents the 'SimpleDeserializer' SAX exception. Could you guide me as to what I need to do to get my 'wrapped/literal' web service to handle such Vector-type values ? Many Thanks, Tim -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 13:23 To: Timothy Thorpe; axis-user@ws.apache.org Subject: Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Tim, The operation parameters you've specified in your WSDD are wrong. In wrapped mode, your input parameters are the same as the operation name. Anne On 4/19/05, Timothy Thorpe [EMAIL PROTECTED] wrote: Anne I have read your blogger article the wiki reference. Thank you for the new WSDL. I have supplied it to the AXIS 1.1 version of 'WSDLToJava' generate my client stub code, via the following command: java org.apache.axis.wsdl.WSDL2Java \Tomcat\jakarta-tomcat-4.1.30\webapps\TSMAdapter_wrapped\WEB-INF\classes\net \cp\adapter\TSMAdapter_wrapped.wsdl I used two versions of WSDD file (both attached) to deploy my AXIS 1.1 web service, via the following command: java org.apache.axis.client.AdminClient -lhttp://localhost:9249/TSMAda pter_wrapped/services/AdminService deploy.wsdd Processing file deploy.wsdd AdminDone processing/Admin Note in particular this line in the first WSDD file: service name=TSMAdapter_wrapped style=wrapped use=literal Then a modified version of this line in the second WSDD file: service name=TSMAdapter_wrapped style=document use=literal Unfortunately, with the web service deployed using either version of the WSDD, I still get the same 'SimpleDeserializer' SAX exception - I have attached 'tcpmon' output of the failing request/response (also, for good measure, the equivalent 'tcpmon' output of the working request/response for the RPC/Encoded version of the client/service). Clearly I am doing something wrong here because wrapped/literal does work for AXIS 1.1. I do appreciate the help you are giving me. Thanks, Tim -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 23:21 To: Timothy Thorpe Subject: Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Here's a wrapped version of your WSDL: ?xml version=1.0 encoding=UTF-8? wsdl:definitions targetNamespace=urn:TSMAdapter xmlns:impl=urn:TSMAdapter xmlns:intf=urn:TSMAdapter xmlns:apachesoap=http://xml.apache.org/xml-soap; xmlns:wsdlsoap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns=http://schemas.xmlsoap.org/wsdl/; wsdl:types schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=http://xml.apache.org/xml-soap; complexType name=mapItem sequence element name=key nillable=true type=xsd:string/ element name=value nillable=true type=xsd:string/ /sequence /complexType complexType name=Map sequence element name=item minOccurs=0 maxOccurs=unbounded type=apachesoap:mapItem/ /sequence /complexType /schema schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=urn:TSMAdapter import namespace=http://xml.apache.org/xml-soap/ complexType name=TSMAdapterResponse
RE: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception
Anne I have clearly misunderstood your last point about the input parameters. I have modified my WSDD file as per the attachment - I have changed each operation 'parameter' element to have the same name as the operation. But the web service still returns the same org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. fault. I have tried to locate an example WSDD file for a wrapped web service on the AXIS site but have not been able to - is there one ? Tim -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 13:23 To: Timothy Thorpe; axis-user@ws.apache.org Subject: Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Tim, The operation parameters you've specified in your WSDD are wrong. In wrapped mode, your input parameters are the same as the operation name. Anne On 4/19/05, Timothy Thorpe [EMAIL PROTECTED] wrote: Anne I have read your blogger article the wiki reference. Thank you for the new WSDL. I have supplied it to the AXIS 1.1 version of 'WSDLToJava' generate my client stub code, via the following command: java org.apache.axis.wsdl.WSDL2Java \Tomcat\jakarta-tomcat-4.1.30\webapps\TSMAdapter_wrapped\WEB-INF\classes\net \cp\adapter\TSMAdapter_wrapped.wsdl I used two versions of WSDD file (both attached) to deploy my AXIS 1.1 web service, via the following command: java org.apache.axis.client.AdminClient -lhttp://localhost:9249/TSMAda pter_wrapped/services/AdminService deploy.wsdd Processing file deploy.wsdd AdminDone processing/Admin Note in particular this line in the first WSDD file: service name=TSMAdapter_wrapped style=wrapped use=literal Then a modified version of this line in the second WSDD file: service name=TSMAdapter_wrapped style=document use=literal Unfortunately, with the web service deployed using either version of the WSDD, I still get the same 'SimpleDeserializer' SAX exception - I have attached 'tcpmon' output of the failing request/response (also, for good measure, the equivalent 'tcpmon' output of the working request/response for the RPC/Encoded version of the client/service). Clearly I am doing something wrong here because wrapped/literal does work for AXIS 1.1. I do appreciate the help you are giving me. Thanks, Tim -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 23:21 To: Timothy Thorpe Subject: Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Here's a wrapped version of your WSDL: ?xml version=1.0 encoding=UTF-8? wsdl:definitions targetNamespace=urn:TSMAdapter xmlns:impl=urn:TSMAdapter xmlns:intf=urn:TSMAdapter xmlns:apachesoap=http://xml.apache.org/xml-soap; xmlns:wsdlsoap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns=http://schemas.xmlsoap.org/wsdl/; wsdl:types schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=http://xml.apache.org/xml-soap; complexType name=mapItem sequence element name=key nillable=true type=xsd:string/ element name=value nillable=true type=xsd:string/ /sequence /complexType complexType name=Map sequence element name=item minOccurs=0 maxOccurs=unbounded type=apachesoap:mapItem/ /sequence /complexType /schema schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=urn:TSMAdapter import namespace=http://xml.apache.org/xml-soap/ complexType name=TSMAdapterResponse sequence element name=PNEMailUserID nillable=true type=xsd:string/ element name=additionalInformation nillable=true type=xsd:string/ element name=contextID nillable=true type=xsd:string/ element name=domain nillable=true type=xsd:string/ element name=failureCode type=xsd:long/ element name=failureMessage nillable=true type=xsd:string/ element name=failureStack nillable=true type=xsd:string/ element name=operation nillable=true type=xsd:string/ element name=operationTimestamp type=xsd:long/ element name=successfulOperation type=xsd:boolean/ element name=user nillable=true type=xsd:string/ /sequence /complexType complexType name=TSMAdapterFault sequence element name=faultCode nillable=true type=xsd:QName/ element name=faultString nillable=true type=xsd:string/ /sequence /complexType element name=TSMAdapterFault type=impl:TSMAdapterFault/ element name=addUser complexType sequence element name=hUserDtls type=apachesoap:Map/ /sequence /complexType /element element name=addUserResponse complexType sequence element name=addUserReturn type
Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception
Tim, The operation parameters you've specified in your WSDD are wrong. In wrapped mode, your input parameters are the same as the operation name. Anne On 4/19/05, Timothy Thorpe [EMAIL PROTECTED] wrote: Anne I have read your blogger article the wiki reference. Thank you for the new WSDL. I have supplied it to the AXIS 1.1 version of 'WSDLToJava' generate my client stub code, via the following command: java org.apache.axis.wsdl.WSDL2Java \Tomcat\jakarta-tomcat-4.1.30\webapps\TSMAdapter_wrapped\WEB-INF\classes\net \cp\adapter\TSMAdapter_wrapped.wsdl I used two versions of WSDD file (both attached) to deploy my AXIS 1.1 web service, via the following command: java org.apache.axis.client.AdminClient -lhttp://localhost:9249/TSMAda pter_wrapped/services/AdminService deploy.wsdd Processing file deploy.wsdd AdminDone processing/Admin Note in particular this line in the first WSDD file: service name=TSMAdapter_wrapped style=wrapped use=literal Then a modified version of this line in the second WSDD file: service name=TSMAdapter_wrapped style=document use=literal Unfortunately, with the web service deployed using either version of the WSDD, I still get the same 'SimpleDeserializer' SAX exception - I have attached 'tcpmon' output of the failing request/response (also, for good measure, the equivalent 'tcpmon' output of the working request/response for the RPC/Encoded version of the client/service). Clearly I am doing something wrong here because wrapped/literal does work for AXIS 1.1. I do appreciate the help you are giving me. Thanks, Tim -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 23:21 To: Timothy Thorpe Subject: Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Here's a wrapped version of your WSDL: ?xml version=1.0 encoding=UTF-8? wsdl:definitions targetNamespace=urn:TSMAdapter xmlns:impl=urn:TSMAdapter xmlns:intf=urn:TSMAdapter xmlns:apachesoap=http://xml.apache.org/xml-soap; xmlns:wsdlsoap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns=http://schemas.xmlsoap.org/wsdl/; wsdl:types schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=http://xml.apache.org/xml-soap; complexType name=mapItem sequence element name=key nillable=true type=xsd:string/ element name=value nillable=true type=xsd:string/ /sequence /complexType complexType name=Map sequence element name=item minOccurs=0 maxOccurs=unbounded type=apachesoap:mapItem/ /sequence /complexType /schema schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=urn:TSMAdapter import namespace=http://xml.apache.org/xml-soap/ complexType name=TSMAdapterResponse sequence element name=PNEMailUserID nillable=true type=xsd:string/ element name=additionalInformation nillable=true type=xsd:string/ element name=contextID nillable=true type=xsd:string/ element name=domain nillable=true type=xsd:string/ element name=failureCode type=xsd:long/ element name=failureMessage nillable=true type=xsd:string/ element name=failureStack nillable=true type=xsd:string/ element name=operation nillable=true type=xsd:string/ element name=operationTimestamp type=xsd:long/ element name=successfulOperation type=xsd:boolean/ element name=user nillable=true type=xsd:string/ /sequence /complexType complexType name=TSMAdapterFault sequence element name=faultCode nillable=true type=xsd:QName/ element name=faultString nillable=true type=xsd:string/ /sequence /complexType element name=TSMAdapterFault type=impl:TSMAdapterFault/ element name=addUser complexType sequence element name=hUserDtls type=apachesoap:Map/ /sequence /complexType /element element name=addUserResponse complexType sequence element name=addUserReturn type=impl:TSMAdapterResponse/ /sequence /complexType /element element name=modifyUser complexType sequence element name=hUserDtls type=apachesoap:Map/ /sequence /complexType /element element name=modifyUserResponse complexType sequence element name=modifyUserReturn type=impl:TSMAdapterResponse/ /sequence /complexType /element element name=deleteUser complexType sequence element name=hUserDtls type=apachesoap:Map/ /sequence /complexType /element element name=deleteUserResponse complexType sequence element name=deleteUserReturn type=impl:TSMAdapterResponse/ /sequence /complexType /element element
RE: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception
Anne Thank you for your response. I will try my RPC/Lit with Axis 1.2 - with a view to persuading my customer to upgrade in the near future. In the meantime, as 1.1 is the version in use on our 'live' system, I have tried wrapped/literal with Axis 1.1 (JavaToWSDL to generate the WSDL, WSDLToJava to generate the client stub) - see the exact same failure at the web service. I would be most grateful if you could look at the attached evidence (WSDL included this time, as well as WSDDs + 2x tcpmon traces; showing a successful RPC/Enc exchange the unsuccessful Wrapped/Lit exchange) hopefully tell me what I am doing wrong ? Rgds, Tim -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 15 April 2005 19:41 To: axis-user@ws.apache.org Subject: Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Try switching to wrapped document/literal style or upgrading to Axis 1.2. Axis 1.1 doesn't really support RPC/Literal. (Also, in the future, please include the WSDL file when requesting assistance.) Anne On 4/15/05, Timothy Thorpe [EMAIL PROTECTED] wrote: Could the problem here be that the parameter to the client method invoked is of type 'java.util.HashMap' so I have to inform the web service to use an appropriate deserializer for the resultant 'hUserDtls' node in the SOAP Body (otherwise it will just use a default, inappropriate in this case, SimpleDeserializer) ? If so, I how do I inform the web service which deserializer to use for a given method parameter ? Fuller extract of client 'SoapBindingStub' generated by WSDLToJava: public TSMAdapter_RPC_Lit.TSMAdapterResponse addUser(java.util.HashMap hUserDtls) throws java.rmi.RemoteException, TSMAdapter_RPC_Lit.TSMAdapterFault { 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(); _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(urn:TSMAdapter_RPC_Lit, addUser)); setRequestHeaders(_call); setAttachments(_call); java.lang.Object _resp = _call.invoke(new java.lang.Object[] {hUserDtls}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (TSMAdapter_RPC_Lit.TSMAdapterResponse) _resp; } catch (java.lang.Exception _exception) { return (TSMAdapter_RPC_Lit.TSMAdapterResponse) org.apache.axis.utils.JavaUtils.convert(_resp, TSMAdapter_RPC_Lit.TSMAdapterResponse.class); } } } Tim -Original Message- From: Timothy Thorpe [mailto:[EMAIL PROTECTED] Sent: 15 April 2005 14:36 To: axis-user@ws.apache.org Subject: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Hello all My web service is running AXIS 1.1. To improve performance of my AXIS web service I have converted it, and its client, from RPC/Encoded to RPC/Literal, in an effort to reduce message size by dropping the 'over-the-top' multiRefs types. Now my client (which was working with the web service fine when using RPC/Encoded) gets the following exception back from the web service: --- Axis Fault code: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException Axis Fault string: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. --- I will summarise below what I have done to convert service client from RPC/Encoded to RPC/Literal - perhaps someone can tell me the glaringly obvious step I have failed to do ? Many Thanks, Tim Step 1: I re-deployed the web service to use 'RPC/Lit' by specifying the 'user' attribute to the service node in my WSDD file, thus: --- deployment name=test xmlns=http://xml.apache.org/axis/wsdd
RE: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception
Anne In fact, my previous email may be misleading. To convert the web service WSDL from 'RPC/Lit' to 'Wrapped/Lit' I did not use 'JavaToWSDL' but instead had simply replaced the WSDL's binding style rpc to wrapped at the line: wsdlsoap:binding style=wrapped transport=http://schemas.xmlsoap.org/soap/http/ On reflection I suspect that this would not be sufficient to generate a true 'Wrapped/Lit' WSDL file from which to generate the client stub. However, my attempt to actually use Axis 1.1 Java2WSDL -y WRAPPED -u LITERAL to generate the 'Wrapped/Literal' WSDL from my Java skeleton fails. I have attached the failure. Also the Java skeleton code. It would be great if you could tell me what has gone wrong with JavaToWSDL here. Many Thanks, Tim -Original Message- From: Timothy Thorpe [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 09:05 To: 'axis-user@ws.apache.org'; 'Anne Thomas Manes' Subject: RE: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Anne Thank you for your response. I will try my RPC/Lit with Axis 1.2 - with a view to persuading my customer to upgrade in the near future. In the meantime, as 1.1 is the version in use on our 'live' system, I have tried wrapped/literal with Axis 1.1 (JavaToWSDL to generate the WSDL, WSDLToJava to generate the client stub) - see the exact same failure at the web service. I would be most grateful if you could look at the attached evidence (WSDL included this time, as well as WSDDs + 2x tcpmon traces; showing a successful RPC/Enc exchange the unsuccessful Wrapped/Lit exchange) hopefully tell me what I am doing wrong ? Rgds, Tim -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 15 April 2005 19:41 To: axis-user@ws.apache.org Subject: Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Try switching to wrapped document/literal style or upgrading to Axis 1.2. Axis 1.1 doesn't really support RPC/Literal. (Also, in the future, please include the WSDL file when requesting assistance.) Anne On 4/15/05, Timothy Thorpe [EMAIL PROTECTED] wrote: Could the problem here be that the parameter to the client method invoked is of type 'java.util.HashMap' so I have to inform the web service to use an appropriate deserializer for the resultant 'hUserDtls' node in the SOAP Body (otherwise it will just use a default, inappropriate in this case, SimpleDeserializer) ? If so, I how do I inform the web service which deserializer to use for a given method parameter ? Fuller extract of client 'SoapBindingStub' generated by WSDLToJava: public TSMAdapter_RPC_Lit.TSMAdapterResponse addUser(java.util.HashMap hUserDtls) throws java.rmi.RemoteException, TSMAdapter_RPC_Lit.TSMAdapterFault { 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(); _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(urn:TSMAdapter_RPC_Lit, addUser)); setRequestHeaders(_call); setAttachments(_call); java.lang.Object _resp = _call.invoke(new java.lang.Object[] {hUserDtls}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (TSMAdapter_RPC_Lit.TSMAdapterResponse) _resp; } catch (java.lang.Exception _exception) { return (TSMAdapter_RPC_Lit.TSMAdapterResponse) org.apache.axis.utils.JavaUtils.convert(_resp, TSMAdapter_RPC_Lit.TSMAdapterResponse.class); } } } Tim -Original Message- From: Timothy Thorpe [mailto:[EMAIL PROTECTED] Sent: 15 April 2005 14:36 To: axis-user@ws.apache.org Subject: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Hello all My web service is running AXIS 1.1. To improve performance of my AXIS web service I have converted it, and its client, from RPC/Encoded to RPC/Literal, in an effort to reduce message size by dropping the 'over-the-top' multiRefs types. Now my client (which was working with the web service fine when using RPC/Encoded) gets the following exception back from the web service
Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception
Please send me the original rpc/encoded WSDL. See my blog for info about wrapped style: http://atmanes.blogspot.com/2005/03/wrapped-documentliteral-convention.html Also see the Axis wiki: http://wiki.apache.org/ws/FrontPage/Axis/Wrapped There is no such thing as wsdl style=wrapped. From a wsdl perspective, the only style options are rpc and document. Anne On 4/18/05, Timothy Thorpe [EMAIL PROTECTED] wrote: Anne In fact, my previous email may be misleading. To convert the web service WSDL from 'RPC/Lit' to 'Wrapped/Lit' I did not use 'JavaToWSDL' but instead had simply replaced the WSDL's binding style rpc to wrapped at the line: wsdlsoap:binding style=wrapped transport=http://schemas.xmlsoap.org/soap/http/ On reflection I suspect that this would not be sufficient to generate a true 'Wrapped/Lit' WSDL file from which to generate the client stub. However, my attempt to actually use Axis 1.1 Java2WSDL -y WRAPPED -u LITERAL to generate the 'Wrapped/Literal' WSDL from my Java skeleton fails. I have attached the failure. Also the Java skeleton code. It would be great if you could tell me what has gone wrong with JavaToWSDL here. Many Thanks, Tim -Original Message- From: Timothy Thorpe [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 09:05 To: 'axis-user@ws.apache.org'; 'Anne Thomas Manes' Subject: RE: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Anne Thank you for your response. I will try my RPC/Lit with Axis 1.2 - with a view to persuading my customer to upgrade in the near future. In the meantime, as 1.1 is the version in use on our 'live' system, I have tried wrapped/literal with Axis 1.1 (JavaToWSDL to generate the WSDL, WSDLToJava to generate the client stub) - see the exact same failure at the web service. I would be most grateful if you could look at the attached evidence (WSDL included this time, as well as WSDDs + 2x tcpmon traces; showing a successful RPC/Enc exchange the unsuccessful Wrapped/Lit exchange) hopefully tell me what I am doing wrong ? Rgds, Tim -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 15 April 2005 19:41 To: axis-user@ws.apache.org Subject: Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Try switching to wrapped document/literal style or upgrading to Axis 1.2. Axis 1.1 doesn't really support RPC/Literal. (Also, in the future, please include the WSDL file when requesting assistance.) Anne On 4/15/05, Timothy Thorpe [EMAIL PROTECTED] wrote: Could the problem here be that the parameter to the client method invoked is of type 'java.util.HashMap' so I have to inform the web service to use an appropriate deserializer for the resultant 'hUserDtls' node in the SOAP Body (otherwise it will just use a default, inappropriate in this case, SimpleDeserializer) ? If so, I how do I inform the web service which deserializer to use for a given method parameter ? Fuller extract of client 'SoapBindingStub' generated by WSDLToJava: public TSMAdapter_RPC_Lit.TSMAdapterResponse addUser(java.util.HashMap hUserDtls) throws java.rmi.RemoteException, TSMAdapter_RPC_Lit.TSMAdapterFault { 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(); _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(urn:TSMAdapter_RPC_Lit, addUser)); setRequestHeaders(_call); setAttachments(_call); java.lang.Object _resp = _call.invoke(new java.lang.Object[] {hUserDtls}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (TSMAdapter_RPC_Lit.TSMAdapterResponse) _resp; } catch (java.lang.Exception _exception) { return (TSMAdapter_RPC_Lit.TSMAdapterResponse) org.apache.axis.utils.JavaUtils.convert(_resp, TSMAdapter_RPC_Lit.TSMAdapterResponse.class); } } } Tim -Original Message- From: Timothy Thorpe [mailto:[EMAIL PROTECTED] Sent: 15 April 2005 14:36 To: axis-user@ws.apache.org Subject: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Hello
RE: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception
Anne I have attached the original RPC/Enc WDSL - generated by JavaToWSDL. Tim -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 17:12 To: Timothy Thorpe; axis-user@ws.apache.org Subject: Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Please send me the original rpc/encoded WSDL. See my blog for info about wrapped style: http://atmanes.blogspot.com/2005/03/wrapped-documentliteral-convention.html Also see the Axis wiki: http://wiki.apache.org/ws/FrontPage/Axis/Wrapped There is no such thing as wsdl style=wrapped. From a wsdl perspective, the only style options are rpc and document. Anne On 4/18/05, Timothy Thorpe [EMAIL PROTECTED] wrote: Anne In fact, my previous email may be misleading. To convert the web service WSDL from 'RPC/Lit' to 'Wrapped/Lit' I did not use 'JavaToWSDL' but instead had simply replaced the WSDL's binding style rpc to wrapped at the line: wsdlsoap:binding style=wrapped transport=http://schemas.xmlsoap.org/soap/http/ On reflection I suspect that this would not be sufficient to generate a true 'Wrapped/Lit' WSDL file from which to generate the client stub. However, my attempt to actually use Axis 1.1 Java2WSDL -y WRAPPED -u LITERAL to generate the 'Wrapped/Literal' WSDL from my Java skeleton fails. I have attached the failure. Also the Java skeleton code. It would be great if you could tell me what has gone wrong with JavaToWSDL here. Many Thanks, Tim -Original Message- From: Timothy Thorpe [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 09:05 To: 'axis-user@ws.apache.org'; 'Anne Thomas Manes' Subject: RE: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Anne Thank you for your response. I will try my RPC/Lit with Axis 1.2 - with a view to persuading my customer to upgrade in the near future. In the meantime, as 1.1 is the version in use on our 'live' system, I have tried wrapped/literal with Axis 1.1 (JavaToWSDL to generate the WSDL, WSDLToJava to generate the client stub) - see the exact same failure at the web service. I would be most grateful if you could look at the attached evidence (WSDL included this time, as well as WSDDs + 2x tcpmon traces; showing a successful RPC/Enc exchange the unsuccessful Wrapped/Lit exchange) hopefully tell me what I am doing wrong ? Rgds, Tim -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 15 April 2005 19:41 To: axis-user@ws.apache.org Subject: Re: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Try switching to wrapped document/literal style or upgrading to Axis 1.2. Axis 1.1 doesn't really support RPC/Literal. (Also, in the future, please include the WSDL file when requesting assistance.) Anne On 4/15/05, Timothy Thorpe [EMAIL PROTECTED] wrote: Could the problem here be that the parameter to the client method invoked is of type 'java.util.HashMap' so I have to inform the web service to use an appropriate deserializer for the resultant 'hUserDtls' node in the SOAP Body (otherwise it will just use a default, inappropriate in this case, SimpleDeserializer) ? If so, I how do I inform the web service which deserializer to use for a given method parameter ? Fuller extract of client 'SoapBindingStub' generated by WSDLToJava: public TSMAdapter_RPC_Lit.TSMAdapterResponse addUser(java.util.HashMap hUserDtls) throws java.rmi.RemoteException, TSMAdapter_RPC_Lit.TSMAdapterFault { 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(); _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(urn:TSMAdapter_RPC_Lit, addUser)); setRequestHeaders(_call); setAttachments(_call); java.lang.Object _resp = _call.invoke(new java.lang.Object[] {hUserDtls}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (TSMAdapter_RPC_Lit.TSMAdapterResponse) _resp; } catch (java.lang.Exception _exception) { return (TSMAdapter_RPC_Lit.TSMAdapterResponse) org.apache.axis.utils.JavaUtils.convert(_resp
RE: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception
Could the problem here be that the parameter to the client method invoked is of type java.util.HashMap so I have to inform the web service to use an appropriate deserializer for the resultant hUserDtls node in the SOAP Body (otherwise it will just use a default, inappropriate in this case, SimpleDeserializer) ? If so, I how do I inform the web service which deserializer to use for a given method parameter ? Tim -Original Message- From: Timothy Thorpe [mailto:[EMAIL PROTECTED] Sent: 15 April 2005 14:36 To: axis-user@ws.apache.org Subject: Converting RPC/Enc web service to RPC/Lit - SimpleDeserializer exception Hello all My web service is running AXIS 1.1. To improve performance of my AXIS web service I have converted it, and its client, from RPC/Encoded to RPC/Literal, in an effort to reduce message size by dropping the over-the-top multiRefs types. Now my client (which was working with the web service fine when using RPC/Encoded) gets the following exception back from the web service: --- Axis Fault code: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException Axis Fault string: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. --- I will summarise below what I have done to convert service client from RPC/Encoded to RPC/Literal perhaps someone can tell me the glaringly obvious step I have failed to do ? Many Thanks, Tim Step 1: I re-deployed the web service to use RPC/Lit by specifying the user attribute to the service node in my WSDD file, thus: --- deployment name=test xmlns=http://xml.apache.org/axis/wsdd/ xmlns:java=http://xml.apache.org/axis/wsdd/providers/java service name=TSMAdapter_RPC_Lit style=RPC use=literal parameter name=className value=net.cp.adapter.TSMAdapter/ parameter name=allowedMethods value=addUser, modifyUser, deleteUser, renameUser/ parameter name=allowedRoles value=memum/ parameter name=wsdlServicePort value=TSMAdapter_RPC_Lit/ operation name=addUser parameter name=hUserDtls/ /operation operation name=modifyUser parameter name=hUserDtls/ /operation operation name=deleteUser parameter name=hUserDtls/ /operation operation name=renameUser parameter name=hUserToRenameDtls/ parameter name=hUserNewDtls/ /operation beanMapping qname=responseNS:TSMAdapterFault xmlns:responseNS=urn:TSMAdapter languageSpecificType=java:net.cp.adapter.TSMAdapterFault/ beanMapping qname=responseNS:TSMAdapterResponse xmlns:responseNS=urn:TSMAdapter languageSpecificType=java:net.cp.adapter.TSMAdapterResponse/ typeMapping xmlns:ns=http://content.services.hrs.harris.com/ qname=ns:ProgramContent type=java:com.harris.hrs.services.content.ProgramContent serializer=org.apache.axis.encoding.ser.BeanSerializerFactory deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory encodingStyle= / requestFlow name=checks handler type=java:org.apache.axis.handlers.SimpleAuthenticationHandler/ handler type=java:org.apache.axis.handlers.SimpleAuthorizationHandler/ /requestFlow /service /deployment --- Step 2: I used JavaToWSDL with the -y RPC -u LITERAL parameters to create a new RPC/Lit WSDL for the service. Step 3: I used WSDLToJava to build client stubs from this RPC/Lit WSDL file. I can now see the following reassuring settings in my new client SoapBindStub: --- org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[0]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(); _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(urn:TSMAdapter_RPC_Lit, addUser)); --- I have used the AXIS TCP monitor to check on the clients SOAP Request and see the following, which matches the old RPC/Enc version BUT WITHOUT the multiRefs types: --- POST