Dan,
The child elements (<id>, <thedate>, and <avalue>) are defined as local
elements (defined inside a complex type), and therefore must be unqualified.
Therefore the elements must include the "no default" namespace definitions
(xmlns=""). If you prefer to make these element qualified, you can add the
elementFormDefault="qualified" attribute to the <schema> definition. But
this issue really shouldn't make a difference.
Anne
-----Original Message-----
From: Dan Ciarniello [mailto:dciarniello@cityxpress.com]
Sent: Wednesday, October 13, 2004 6:36 PM
To: axis-user@ws.apache.org
Subject: Re: WSDL2Java and Basic Profile
Anne,
Thanks for the info. I had to make a few minor changes to what you sent
(I've attached a corrected version below) but that gave me enough to
work with. Except for one problem...
WSDL2Java produces both client and server code without apparent problem
but when I invoke the service I get a NullPointerException. I wonder if
this is a problem with "empty" namespaces. The response from the server
looks like this:
<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>
<getObjectResponse xmlns="http://cityxpress.com/external">
<thedate xsi:type="xsd:dateTime"
xmlns="">2004-10-13T16:30:38.953Z</thedate>
<avalue xsi:type="xsd:int" xmlns="">0</avalue>
</getObjectResponse>
</soapenv:Body>
</soapenv:Envelope>
I'm wondering if the xmlns="" in response values are the problem.
Should the xmlns attribute even be there? If so, shouldn't it be
http://cityxpress.com/external?
Thanks,
Dan.
Corrected WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://cityxpress.com/external"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://cityxpress.com/external">
<wsdl:types>
<xsd:schema targetNamespace="http://cityxpress.com/external">
<xsd:element name="getObject" type="tns:GetObjectType"/>
<xsd:complexType name="GetObjectType">
<xsd:sequence>
<xsd:element name="id" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="getObjectReturn" type="tns:CXObjectType"/>
<xsd:complexType name="CXObjectType">
<xsd:sequence>
<xsd:element name="thedate" type="xsd:dateTime"/>
<xsd:element name="avalue" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getObjectRequest">
<wsdl:part name="parameters" element="tns:getObject"/>
</wsdl:message>
<wsdl:message name="getObjectResponse">
<wsdl:part name="parameters" element="tns:getObjectReturn"/>
</wsdl:message>
<wsdl:portType name="XMTestPortType">
<wsdl:operation name="getObject">
<wsdl:input message="tns:getObjectRequest"/>
<wsdl:output message="tns:getObjectResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="XMTestBinding" type="tns:XMTestPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http/"/>
<wsdl:operation name="getObject">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="XMTest">
<wsdl:port name="XMTest" binding="tns:XMTestBinding">
<soap:address location="http://localhost:8080/v01/XMTest"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
|