axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anne Thomas Manes <atma...@gmail.com>
Subject Re: Error : could not find deserializer while running a client
Date Sat, 20 Aug 2005 15:56:15 GMT
When using document style, your message parts must reference elements, not 
types. 
Notice in the WSDL I sent back to you initially, I added two elements to the 
<types> section, and I changed the message parts to reference these 
elements:
 <types>
<xsd:schema targetNamespace="urn:DataInquiry2">

<xsd:element name="getInquiryData" type="typens:inquiryRequest"/>
<xsd:complexType name="inquiryRequest">
<xsd:sequence>
<xsd:element name="sor" type="xsd:string"/>
<xsd:element name="loanNumber" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

<xsd:element name="getInquiryDataResponse" type="typens:inquiryResponse"/>
<xsd:complexType name="inquiryResponse">
<xsd:sequence>
<xsd:element name="minNumber" type="xsd:string"/>
<xsd:element name="momFlag" type="xsd:string"/>
<xsd:element name="mersQAFlag" type="xsd:string"/>
<xsd:element name="mersQAFlag" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>

<!-- message declns -->
<message name="empty"/>

<message name="GetInquiryDataRequest">
<part name="parameters" element="typens:getInquiryData"/>
</message>

<message name="GetInquiryDataResponse">
<part name="parameters" element="typens:getInquiryDataResponse"/>
</message>



 On 8/18/05, raj.x.arunmugan@jpmchase.com <raj.x.arunmugan@jpmchase.com> 
wrote: 
> 
> 
> Anne, 
> 
> I fiexed my WSDL and here is my new WSDL . 
> 
> 
> 
> 
> 
> <?xml version="1.0" ?> 
> 
> <definitions name="urn:DataInquiry" 
> targetNamespace="urn:DataInquiry2" 
> xmlns:tns="urn:DataInquiry2" 
> xmlns:typens="urn:DataInquiry2" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> xmlns="http://schemas.xmlsoap.org/wsdl/"> 
> 
> <!-- type defs --> 
> <types> 
> <xsd:schema targetNamespace="urn:DataInquiry2" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
> 
>  
> <xsd:complexType name="inquiryRequest"> 
> <xsd:all> 
> <xsd:element name="sor" type="xsd:string"/> 
> <xsd:element name="loanNumber" type="xsd:string"/> 
> </xsd:all> 
> </xsd:complexType> 
> 
> <xsd:complexType name="inquiryResponse"> 
> <xsd:all> 
> <xsd:element name="minNumber" type="xsd:string"/> 
> <xsd:element name="momFlag" type="xsd:string"/> 
> <xsd:element name="mersQAFlag" type="xsd:string"/> 
> <xsd:element name="mersQAFlag" type="xsd:string"/> 
> </xsd:all> 
> </xsd:complexType> 
> </xsd:schema> 
> </types> 
> 
> <!-- message declns --> 
> <message name="empty"/> 
> 
> 
> 
> <!-- Raj --> 
> 
> <message name="GetInquiryDataRequest"> 
> <part name="inquiryRequest" type="typens:inquiryRequest"/> 
> </message> 
> 
> <message name="GetInquiryDataResponse"> 
> <part name="inquiryResponse" type="typens:inquiryResponse"/> 
> </message> 
> 
> <!-- port type declns --> 
> <portType name="DataInquiry"> 
> 
> <operation name="getInquiryData"> 
>  <input name="input" message="tns:GetInquiryDataRequest"/> 
> <output name="output" message="tns:GetInquiryDataResponse"/> 
> </operation> 
> </portType> 
> 
> <!-- binding declns --> 
> <binding name="DataInquirySOAPBinding" type="tns:DataInquiry"> 
> <soap:binding style="document" 
> transport="http://schemas.xmlsoap.org/soap/http"/> 
> 
> <operation name="getInquiryData"> 
> 
> <soap:operation soapAction=""/> 
> <input name="input"> 
> <soap:body use="literal"/> 
> </input> 
> <output name="output"> 
> <soap:body use="literal"/> 
> </output> 
> </operation> 
> </binding> 
> 
> <!-- service decln --> 
> <service name="DataInquiryService"> 
> <port name="DataInquiry" binding="tns:DataInquirySOAPBinding"> 
> <soap:address location="
> http://localhost:8080/TestInquiryServiceWAR/services/DataInquiry"/> 
> </port> 
> </service> 
> 
> </definitions> 
> 
> I ran WSD2Java ,deployed the web service, when I tried to run a test 
> client and getting this error 
> 
> org.xml.sax.SAXException: Invalid element in 
> com.webservice.datainquiry.InquiryRequest - arg0 
> 
> 
> Pleae shed some light.. thanks. 
> 
> 
> *package* samples.addr; 
> 
> *import* org.apache.axis.client.Call; 
> *import* org.apache.axis.client.Service; 
> *import* javax.xml.namespace.QName; 
> *import* com.webservice.datainquiry.*; 
> 
> 
> *public* *class* InquiryServiceTestClient { 
> *public* *static* *void* main(String [] args) { 
> *try* { 
> 
> String endpoint = "
> http://localhost:8080/TestInquiryServiceWAR/services/DataInquiry"; 
> 
> Service service = *new* Service(); 
> Call call = (Call) service.createCall(); 
> 
> call.setTargetEndpointAddress( *new* java.net.URL(endpoint) ); 
> call.setOperationName(*new* QName("urn:DataInquiry2", "getInquiryData")); 
> 
> InquiryRequest inquiryRequest = *new* InquiryRequest(); 
> inquiryRequest.setSor("12345"); 
> inquiryRequest.setLoanNumber("123456789"); 
> InquiryResponse ret = (InquiryResponse) call.invoke( *new* Object[] 
> {inquiryRequest} ); 
> 
>  
> } *catch* (Exception e) { 
> System.err.println(e.toString()); 
> } 
> } 
> } 
> 
> 
> 
> 
>   *Anne Thomas Manes <atmanes@gmail.com>* 
> 
> 08/18/2005 07:18 AM 
> Please respond to axis-user 
>  
> To: axis-user@ws.apache.org 
> cc: 
> Subject: Re: Error : could not find deserializer while running a client 
> 
> 
> 
> 
> Two problems with your WSDL:
> 
> #1 - you're using an older version of XML Schema, which Axis doesn't 
> support.
> #2 - "name" is a required attribute on all <input> and <output>
> definitions (in both portType and binding definitions).
> 
> Fix your WSDL and try it again.
> 
> (I also suggest that you switch from rpc/encoded to wrapped 
> document/literal)
> 
> Anne
> 
> ps -- here's your WSDL using wrapped document/literal:
> 
> <?xml version="1.0" ?> 
> 
> <definitions name="urn:DataInquiry" 
> targetNamespace="urn:DataInquiry2" 
> xmlns:tns="urn:DataInquiry2" 
> xmlns:typens="urn:DataInquiry2" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> xmlns="http://schemas.xmlsoap.org/wsdl/"<http://schemas.xmlsoap.org/wsdl/%22>>

> 
> 
> <!-- type defs --> 
> <types> 
> <xsd:schema targetNamespace="urn:DataInquiry2"> 
> 
> <xsd:element name="getInquiryData" type="typens:inquiryRequest"/>
> <xsd:complexType name="inquiryRequest"> 
> <xsd:sequence> 
> <xsd:element name="sor" type="xsd:string"/> 
> <xsd:element name="loanNumber" type="xsd:string"/> 
> </xsd:sequence> 
> </xsd:complexType> 
> 
> <xsd:element name="getInquiryDataResponse" type="typens:inquiryResponse"/>
> <xsd:complexType name="inquiryResponse"> 
> <xsd:sequence> 
> <xsd:element name="minNumber" type="xsd:string"/> 
> <xsd:element name="momFlag" type="xsd:string"/> 
> <xsd:element name="mersQAFlag" type="xsd:string"/> 
> <xsd:element name="mersQAFlag" type="xsd:string"/> 
> </xsd:sequence> 
> </xsd:complexType> 
> </xsd:schema> 
> </types> 
> 
> <!-- message declns --> 
> <message name="empty"/> 
> 
> 
> 
> 
> 
> <message name="GetInquiryDataRequest"> 
> <part name="parameters" element="typens:getInquiryData"/> 
> </message> 
> 
> <message name="GetInquiryDataResponse"> 
> <part name="parameters" element="typens:getInquiryDataResponse"/> 
> </message> 
> 
> <!-- port type declns --> 
> <portType name="DataInquiry"> 
> 
> <operation name="getInquiryData"> 
> <input name="input" message="tns:GetInquiryDataRequest"/> 
> <output name="output" message="tns:GetInquiryDataResponse"/> 
> </operation> 
> </portType> 
> 
> <!-- binding declns --> 
> <binding name="DataInquirySOAPBinding" type="tns:DataInquiry"> 
> <soap:binding style="document" 
> transport="http://schemas.xmlsoap.org/soap/http"/<http://schemas.xmlsoap.org/soap/http%22/>>

> 
> 
> <operation name="getInquiryData"> 
> <soap:operation soapAction=""/> 
> <input name="input"> 
> <soap:body use="literal"/> 
> </input> 
> <output name="output"> 
> <soap:body use="literal"/> 
> </output> 
> </operation> 
> </binding> 
> 
> <!-- service decln --> 
> <service name="DataInquiryService"> 
> <port name="DataInquiry" binding="tns:DataInquirySOAPBinding"> 
> <soap:address 
> location="
> http://localhost:8080/TestInquiryServiceWAR/services/DataInquiry"/<http://localhost:8080/TestInquiryServiceWAR/services/DataInquiry%22/>
> >
> </port> 
> </service> 
> 
> </definitions> 
> 
> 
> On 8/18/05, raj.x.arunmugan@jpmchase.com <raj.x.arunmugan@jpmchase.com> 
> wrote:
> > 
> > Hello, 
> > 
> > I created a web service and when I try to test it with a test client I 
> am
> > getting the following errr 
> > 
> > org.xml.sax.SAXException: Deserializing parameter 'inquiryResponse': 
> could
> > not find deserializer for type
> > {urn:DataInquiry2}inquiryResponse 
> > 
> > here is my WSDL ..IO ran WSDl2Java to create my web service 
> > 
> > 
> > 
> > <?xml version="1.0" ?> 
> > 
> > <definitions name="urn:DataInquiry" 
> > targetNamespace="urn:DataInquiry2" 
> > xmlns:tns="urn:DataInquiry2" 
> > xmlns:typens="urn:DataInquiry2" 
> > xmlns:xsd="http://www.w3.org/1999/XMLSchema" 
> > 
> > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> > xmlns="http://schemas.xmlsoap.org/wsdl/"<http://schemas.xmlsoap.org/wsdl/%22>>

> 
> > 
> > <!-- type defs --> 
> > <types> 
> > <xsd:schema targetNamespace="urn:DataInquiry2" 
> > 
> > xmlns:xsd="http://www.w3.org/1999/XMLSchema"<http://www.w3.org/1999/XMLSchema%22>>

> 
> > 
> > 
> > <xsd:complexType name="inquiryRequest"> 
> > <xsd:all> 
> > <xsd:element name="sor" type="xsd:string"/> 
> > <xsd:element name="loanNumber" type="xsd:string"/> 
> > </xsd:all> 
> > </xsd:complexType> 
> > 
> > <xsd:complexType name="inquiryResponse"> 
> > <xsd:all> 
> > <xsd:element name="minNumber" type="xsd:string"/> 
> > <xsd:element name="momFlag" type="xsd:string"/> 
> > <xsd:element name="mersQAFlag" type="xsd:string"/> 
> > <xsd:element name="mersQAFlag" type="xsd:string"/> 
> > </xsd:all> 
> > </xsd:complexType> 
> > </xsd:schema> 
> > </types> 
> > 
> > <!-- message declns --> 
> > <message name="empty"/> 
> > 
> > 
> > 
> > 
> > 
> > <message name="GetInquiryDataRequest"> 
> > <part name="inquiryRequest" type="typens:inquiryRequest"/> 
> > </message> 
> > 
> > <message name="GetInquiryDataResponse"> 
> > <part name="inquiryResponse" type="typens:inquiryResponse"/> 
> > </message> 
> > 
> > <!-- port type declns --> 
> > <portType name="DataInquiry"> 
> > 
> > <operation name="getInquiryData"> 
> > <input message="tns:GetInquiryDataRequest"/> 
> > <output message="tns:GetInquiryDataResponse"/> 
> > </operation> 
> > </portType> 
> > 
> > <!-- binding declns --> 
> > <binding name="DataInquirySOAPBinding" type="tns:DataInquiry"> 
> > <soap:binding style="rpc" 
> > 
> > transport="http://schemas.xmlsoap.org/soap/http"/<http://schemas.xmlsoap.org/soap/http%22/>>

> 
> > 
> > <operation name="getInquiryData"> 
> > <soap:operation soapAction=""/> 
> > <input> 
> > <soap:body use="encoded" 
> > namespace="urn:DataInquiry2" 
> > 
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/<http://schemas.xmlsoap.org/soap/encoding/%22/>
> >
> > </input> 
> > <output> 
> > <soap:body use="encoded" 
> > namespace="urn:DataInquiry2" 
> > 
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/<http://schemas.xmlsoap.org/soap/encoding/%22/>
> >
> > </output> 
> > </operation> 
> > </binding> 
> > 
> > <!-- service decln --> 
> > <service name="DataInquiryService"> 
> > <port name="DataInquiry"
> > binding="tns:DataInquirySOAPBinding"> 
> > <soap:address
> > location="
> http://localhost:8080/TestInquiryServiceWAR/services/DataInquiry"/<http://localhost:8080/TestInquiryServiceWAR/services/DataInquiry%22/>
> >
> > </port> 
> > </service> 
> > 
> > </definitions> 
> > 
> > 
> > Here is my test Client 
> > 
> > 
> > 
> > /* 
> > * Created on Aug 17, 2005 
> > * 
> > * To change the template for this generated file go to 
> > * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code
> > and Comments 
> > */ 
> > package samples.addr; 
> > 
> > import org.apache.axis.client.Call; 
> > import org.apache.axis.client.Service; 
> > import javax.xml.namespace.QName; 
> > import com.webservice.datainquiry.*; 
> > 
> > public class InquiryServiceTestClient { 
> > public static void main(String [] args) { 
> > try { 
> > //String endpoint =
> > "http://ws.apache.org:5049/axis/services/echo"; 
> > String endpoint =
> > "http://localhost:8080/TestInquiryServiceWAR/services/DataInquiry";
> > 
> > Service service = new Service(); 
> > Call call = (Call) service.createCall(); 
> > 
> > call.setTargetEndpointAddress( new java.net.URL(endpoint) ); 
> > call.setOperationName(new QName("urn:DataInquiry2", "getInquiryData")); 
> > 
> > InquiryRequest inquiryRequest = new InquiryRequest(); 
> > inquiryRequest.setSor("12345"); 
> > inquiryRequest.setLoanNumber("123456789"); 
> > InquiryResponse ret = (InquiryResponse) call.invoke( new Object[]
> > {inquiryRequest} ); 
> > 
> > System.out.println("Sent 'Hello!', got '" + ret + "'"); 
> > } catch (Exception e) { 
> > System.err.println(e.toString()); 
> > } 
> > } 
> > } 
> > 
> > 
> > Here is my server config ... 
> > 
> > 
> > <?xml version="1.0" encoding="UTF-8"?> 
> > <deployment xmlns="http://xml.apache.org/axis/wsdd/"
> > xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"<http://xml.apache.org/axis/wsdd/providers/java%22>
> >
> > <globalConfiguration> 
> > <parameter name="sendMultiRefs" value="true"/> 
> > <parameter name="disablePrettyXML" value="true"/> 
> > <parameter name="adminPassword" value="admin"/> 
> > <parameter name="attachments.Directory"
> > 
> value="C:\localWS\workspace_MERS\TestInquiryServiceWAR\WebContent\WEB-INF\attachments"/>
> > <parameter name="dotNetSoapEncFix" value="true"/> 
> > <parameter name="enableNamespacePrefixOptimization"
> > value="true"/> 
> > <parameter name="sendXMLDeclaration" value="true"/> 
> > <parameter name="attachments.implementation"
> > value="org.apache.axis.attachments.AttachmentsImpl"/> 
> > <parameter name="sendXsiTypes" value="true"/> 
> > <requestFlow> 
> > <handler
> > type="java:org.apache.axis.handlers.JWSHandler"> 
> > <parameter name="scope" value="session"/> 
> > </handler> 
> > <handler
> > type="java:org.apache.axis.handlers.JWSHandler"> 
> > <parameter name="scope" value="request"/> 
> > <parameter name="extension" value=".jwr"/> 
> > </handler> 
> > </requestFlow> 
> > </globalConfiguration> 
> > <handler name="LocalResponder"
> > type="java:org.apache.axis.transport.local.LocalResponder"/>
> > <handler name="URLMapper"
> > type="java:org.apache.axis.handlers.http.URLMapper"/> 
> > <handler name="Authenticate"
> > type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
> > <service name="AdminService" provider="java:MSG"> 
> > <parameter name="allowedMethods" value="AdminService"/> 
> > <parameter name="enableRemoteAdmin" value="false"/> 
> > <parameter name="className" value="org.apache.axis.utils.Admin"/> 
> > <namespace>http://xml.apache.org/axis/wsdd/</namespace> 
> > <namespace>http://xml.apache.org/axis/wsdd/</namespace> 
> > </service> 
> > <service name="Version" provider="java:RPC"> 
> > <parameter name="allowedMethods" value="getVersion"/> 
> > <parameter name="className" value="org.apache.axis.Version"/> 
> > </service> 
> > <service name="DataInquiry" provider="java:RPC"> 
> > <parameter name="wsdlServicePort" value="DataInquiry"/> 
> > <parameter name="className"
> > value="com.webservice.datainquiry.DataInquirySOAPBindingSkeleton"/>
> > <parameter name="typeMappingVersion" value="1.2"/> 
> > <parameter name="allowedMethods" value="*"/> 
> > <parameter name="wsdlServiceElement" value="DataInquiryService"/> 
> > <parameter name="wsdlTargetNamespace" value="urn:DataInquiry2"/> 
> > <parameter name="wsdlPortType" value="DataInquiry"/> 
> > <parameter name="scope" value="Session"/> 
> > <parameter name="schemaUnqualified" value="urn:DataInquiry2"/> 
> > <typeMapping
> > deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > qname="ns1:inquiryResponse"
> > serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> > type="java:com.webservice.datainquiry.InquiryResponse"
> > xmlns:ns1="urn:DataInquiry2"/> 
> > <typeMapping
> > deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > qname="ns2:inquiryRequest"
> > serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> > type="java:com.webservice.datainquiry.InquiryRequest"
> > xmlns:ns2="urn:DataInquiry2"/> 
> > </service> 
> > <transport name="http"> 
> > <requestFlow> 
> > <handler type="URLMapper"/> 
> > <handler
> > type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
> > </requestFlow> 
> > <parameter name="qs:list"
> > value="org.apache.axis.transport.http.QSListHandler"/> 
> > <parameter name="qs:wsdl"
> > value="org.apache.axis.transport.http.QSWSDLHandler"/> 
> > <parameter name="qs.list"
> > value="org.apache.axis.transport.http.QSListHandler"/> 
> > <parameter name="qs.method"
> > value="org.apache.axis.transport.http.QSMethodHandler"/> 
> > <parameter name="qs:method"
> > value="org.apache.axis.transport.http.QSMethodHandler"/> 
> > <parameter name="qs.wsdl"
> > value="org.apache.axis.transport.http.QSWSDLHandler"/> 
> > </transport> 
> > <transport name="local"> 
> > <responseFlow> 
> > <handler type="LocalResponder"/> 
> > </responseFlow> 
> > </transport> 
> > </deployment> 
> > 
> > Please help me out. 
> > 
> > Thanks in advance 
> > 
> > Raj
> 
> 
>

Mime
View raw message