Hello everyone,

I haven't yet come across a similar problem on the user's list so, I thought I'll ask.

I am using Axis 1.4 client stubs to invoke a database encapsulating web service. Since the response depends upon the query passed as argument to the web service operation, therefore, WSDL2Java cannot generate java beans ( e.g. Phone class from Axis User's Guide) to capture the dynamic return type. Instead it generates a response class that captures the response as an array of MessageElement objects. One of the  array elements corresponds to an xml document containing the query result and the other corresponds to a schema document that describes the format of the xml document.  An example of these two documents follows. Given these two documents, how can I use Axis or some other 3rd party code to extract say the archivetime in the following example as a java.util.Calendar object or the UrlID as a byte[][] array?

Schema Example:
<code>
<xs:schema id="NewDataSet" // namespace info>
    <xs:element name="NewDataSet" //namespace info>
        <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="Table">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="UrlID" type="xs:base64Binary" minOccurs="0"/>
                            <xs:element name="archivetime" type="xs:dateTime" minOccurs="0"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>
</code>

And a corresponding xml document would be:

<code>
<diffgr:diffgram  //namespace info>
    <NewDataSet xmlns="">
        <Table diffgr:id="Table1" msdata:rowOrder="0">
            <UrlID>zrBE/Yw3aTXmwdW/Rk3f/Q==</UrlID>
            <archivetime>2005-02-14T06:30:28-05:00</archivetime>
        </Table>
    </NewDataSet>
</diffgr:diffgram>
</code>

Will appreciate any pointers,

Adil

Reply via email to