8 Replies Latest reply on Feb 15, 2005 3:07 PM by Thomas Diesler

    web service client deserialization

    Andrew Wagg Newbie

      Has anyone seen any problems with the deserialization code generated by wscompile for complex types. I have put trace into the deserialization and my problem seems the be the element name from the XML does not match the name expected by the code and so the message is not decoded.

      The deserialization is looking for a QNAME of

      {http://opcfoundation.org/webservices/XMLDA/1.0/}GetStatusResult


      but the element name from the XML reader is

      GetStatusResult


      Am I missing some option somewhere.

      Any pointers greatly appreciatted.

        • 1. Re: web service client deserialization
          Thomas Diesler Master

          The key to this is, whether the element name should be quailfied or unqualified. Checkout your schema.

          • 2. Re: web service client deserialization
            Andrew Wagg Newbie

            This is a section of my wsdl,

            <?xml version="1.0" encoding="utf-8"?>
            <!--
             COPYRIGHT (c) 2003 OPC Foundation. All rights reserved.
             http://www.opcfoundation.org
             Use subject to the OPC Foundation License Agreement found at the following URL:
             http://www.opcfoundation.org/Downloads/LicenseAgreement.asp
            -->
            <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://opcfoundation.org/webservices/XMLDA/1.0/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://opcfoundation.org/webservices/XMLDA/1.0/" xmlns="http://schemas.xmlsoap.org/wsdl/">
             <types>
             <s:schema elementFormDefault="qualified" targetNamespace="http://opcfoundation.org/webservices/XMLDA/1.0/">
             <s:element name="GetStatus">
             <s:complexType>
             <s:attribute name="LocaleID" type="s:string" />
             <s:attribute name="ClientRequestHandle" type="s:string" />
             </s:complexType>
            
             </s:element>
             <s:element name="GetStatusResponse">
             <s:complexType>
             <s:sequence>
             <s:element minOccurs="0" maxOccurs="1" name="GetStatusResult" type="s0:ReplyBase" />
             <s:element minOccurs="0" maxOccurs="1" name="Status" type="s0:ServerStatus" />
             </s:sequence>
             </s:complexType>
             </s:element>
            
            


            I assume looking at this that the elementFormDefault for the schema has specified qualified.

            Both the client and server side are being generated using wscompile.

            • 3. Re: web service client deserialization
              Thomas Diesler Master

              Could you please post the SOAP messages that are beeing exchanged to this forum. In order to see them you would enable DEBUG on the org.apache.axis category in log4j.xml.

              Yust to confirm. Your client is jwsdp, your server is jbossws?

              It seems that jbossws is defaulting to unqualified, if this is true we need to file a bug in jira.

              • 4. Re: web service client deserialization
                Andrew Wagg Newbie

                Client sends

                <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
                 xmlns:ns0="http://opcfoundation.org/webservices/XMLDA/1.0/">
                 <env:Body>
                 <ns0:GetStatus LocaleID="en" ClientRequestHandle="Andy"/>
                 /env:Body>
                 /env:Envelope
                >
                


                Server replies



                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                 <soapenv:Body>
                 <ns1:GetStatusResponse xmlns:ns1="http://opcfoundation.org/webservices/XMLDA/1.0/">
                 <GetStatusResult ClientRequestHandle="Andy" RcvTime="2005-02-11T13:47:58.673Z" ReplyTime="2005-02-11T13:47:58.673Z" RevisedLocaleID="en" ServerState="running"/>
                 <Status ProductVersion="1.00.1.00" StartTime="2005-02-11T13:47:58.673Z">
                 <StatusInfo>OK</StatusInfo>
                 <VendorInfo>Andy</VendorInfo>
                 <SupportedLocaleIDs>en</SupportedLocaleIDs>
                 <SupportedInterfaceVersions>XML_DA_Version_1_0</SupportedInterfaceVersions>
                 </Status>
                 </ns1:GetStatusResponse>
                 </soapenv:Body>
                 </soapenv:Envelope>
                


                The server is jbossws (server-side files generated by using wscompile from jwsdp) and the client is a standalone client using the files generated by wscompile from jwsdp.

                • 5. Re: web service client deserialization
                  Andrew Wagg Newbie

                  Just for interest, I took the qualified out of the wsdl. The test client and test server were then able to communicate successfully. Unfortunately, the wsdl is an external published interface so i cannot permenantly change it. So the problem does seem to be related to JBoss not providing a qualified name.

                  Andy

                  • 6. Re: web service client deserialization
                    Thomas Diesler Master

                    Andy, this is what I thought. The only chance you have is copy all type definitions from the gnerated *.wsdd to our propriatary ws4ee-deployment.xml desriptor and add the name prefix to all bean properties that should be qualified.

                    You are a victim of our Axis based implementation not beeing schema aware. Changing that would involve a conserable change to the Axis code that I consider dead already. Instead we are in the process of designing a new SOAP stack that will of course address this problem.

                    See the JBossWS roadmap for details.

                    • 7. Re: web service client deserialization
                      Andrew Wagg Newbie

                      Thans for your help Tom. Adding the namespace prefix to the xml name in the type mappings works. Its not very neat, but I already have to include the operations here to correct the return and parameters, so not to big a deal to add the type mappings as well.It's unlikely my external wsdl will change, so this will work as a solution for now.

                      I look forward to the JBoss solution.

                      Thanks again for your help with this, these forums are what helps to make JBoss so good.

                      Regards, Andy