I'm having trouble with a deserializer problem. I have scanned the archives and have found things of interest, but nothing that applies directly to problem I'm having. (I did see Chris Kelly's message dated 2004-05-13 7:04:13.) I start with a wsdl file of the following form. The things in []'s describe the text I didn't show here to keep it short.

[header stuff omitted]
<definitions
[stuff omitted]
   name="UniversalLoginLibrary"
   xmlns:ro="urn:UniversalLoginLibrary"
[more stuff omitted]
>
   <types>
      <xs:schema targetNamespace="urn:UniversalLoginLibrary"
        xmlns="urn:UniversalLoginLibrary">
         <xs:complexType name="TUserRecord">
            <xs:sequence>
               <xs:element name="Username" type="xs:string"/>
[the rest of the types are all xs:string, and are omitted]
            </xs:sequence>
         </xs:complexType>
      </xs:schema>
   </types>
   <message name="GetUserRecordRequest">
      <part name="Username" type="xs:string" />
   </message>
   <message name="GetUserRecordResponse">
      <part name="Result" type="ro:TUserRecord" />
   </message>
   <portType name="UniversalLoginSvc">
      <operation name="GetUserRecord">
         <input message="tns:GetUserRecordRequest" />
         <output message="tns:GetUserRecordResponse" />
      </operation>
   </portType>
   <portType name="LoginInfo">
[...other services defined]
   </portType>
   <binding name="UniversalLoginSvcBinding" type="tns:UniversalLoginSvc">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
         <operation name="GetUserRecord">
            <soap:operation soapAction="urn:UniversalLoginLibrary-UniversalLoginSvc#GetUserRecord" style="rpc" />
            <input message="GetUserRecordRequest">

               <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:UniversalLoginLibrary-UniversalLoginSvc" />
            </input>
            <output message="GetUserRecordResponse">
               <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:UniversalLoginLibrary-UniversalLoginSvc" />
            </output>
         </operation>
   </binding>
   <binding name="LoginInfoBinding" type="tns:LoginInfo">
[...other services bindings defined here]
   </binding>
   <service name="UniversalLoginSvcService">
      <documentation></documentation>
      <port name="UniversalLoginSvcPort" binding="tns:UniversalLoginSvcBinding">
         <soap:address location="http://loginserver:8099/SOAP" />
      </port>
   </service>
   <service name="LoginInfoService">
      <documentation></documentation>
      <port name="LoginInfoPort" binding="tns:LoginInfoBinding">
         <soap:address location="http://loginserver:8099/SOAP" />
      </port>
   </service>
</definitions>

If you have gotten to this point you will notice that the complex type TUserRecord is defined in UniversalLoginLibrary. The GetUserRecord service is defined in UniversalLoginLibrary-UniversalLoginSvc and the other service [not shown] is defined in UniversalLoginLibrary-LoginInfo. The idea is to put all of the complex shared types in UniversalLoginLibrary and put the services in a sub-"library". The problem is that when I use WSDL2Java to generate the Java code and try to run a client, I get the infamous can't find deserializer problem:

org.xml.sax.SAXException: Deserializing parameter 'Result':  could not find deserializer for type {urn:UniversalLoginLibrary-UniversalLoginSvc}TUserRecord
        at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302)
        at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)
[rest of stack trace omitted]

Note that it is looking for the TUserRecord in urn:UniversalLoginLibrary-UniversalLoginSvc but it is actually defined in urn:UniversalLoginLibrary. If I hack up the generated Java code to define TUserRecord in urn:UniversalLoginLibrary-UniversalLoginSvc the client runs without errors (and gets the right data too!).

I also tried this on axis-1_2alpha I downloaded on 6/4/2004 and got the same deserializer trouble.

Note that the wsdl file was generated from another package. Also, if I only have one sub-"library", the services are able to access the complex types.

Is this an axis bug, or am I doing something wrong?

Tom Ekberg
Middleberg, Riddle and Gianna
214-220-6630

Reply via email to