You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Magnus Altin <ma...@gmail.com> on 2010/07/08 18:48:28 UTC
Namespace missing on elements
I'm developing a web service with Axis2 1.5.1 and I have a problem
with a Dotnet client trying to consume it.
I'm using the contract first model and this is how I define one of my
complex types:
<xsd:complexType name="Category" >
<xsd:sequence>
<xsd:element name="id" type="xsd:int"></xsd:element>
<xsd:element name="text" type="xsd:string"></xsd:element>
<xsd:element name="parentId" type="xsd:int"></xsd:element>
<xsd:element name="treeLevel" type="xsd:int"></xsd:element>
<xsd:element name="isLeafNode" type="xsd:boolean"></xsd:element>
</xsd:sequence>
</xsd:complexType>
And here is what my ADB and Axis2 generated WSDL looks like:
<xs:complexType name="Category">
<xs:sequence>
<xs:element minOccurs="0" name="id" type="xs:int"/>
<xs:element minOccurs="0" name="isLeafNode" type="xs:boolean"/>
<xs:element minOccurs="0" name="parentId" type="xs:int"/>
<xs:element minOccurs="0" name="text" nillable="true"
type="xs:string"/>
<xs:element minOccurs="0" name="treeLevel" type="xs:int"/>
</xs:sequence>
</xs:complexType>
Pretty similar :-)
And finally here is a snippet of the output from the service call (from SoapUI)
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:readCategoryResponse
xmlns:ns="http://webservices.project.company.se"
xmlns:ax21="http://gen.webservices.project.company.se/xsd">
<ns:return>
<id>1001</id>
<text>Administration</text>
<parentId>0</parentId>
<treeLevel>0</treeLevel>
<isLeafNode>false</isLeafNode>
</ns:return>
...
...
...
Why is xmlns:ax21 declared as a namespace when it's never used?
Shouldn't the elements id, text, parentId and so on have a namespace prefix?
Like this:
<ax21:id>1001</ax21:id>
I believe that our Dotnet client should be able to understand the
data better if it is namespace prefixed. Now it just gets a null
value.
I would very much appreciate any thoughts on this problem
Kind regards,
Magnus
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org
Re: Namespace missing on elements
Posted by Magnus Altin <ma...@gmail.com>.
Hi Prateek!
Nice of you to notice my question.
The WSDL is pretty big and I didn't want to risk cutting the wrong
things out, so I send you the complete versions. Before and after Axis
ADB involvement.
Does it work with attachments to this mail list?
Kind regards
Magnus
2010/7/9 Prateek Asthana <pa...@gmail.com>:
> Magnus,
> Please paste the complete WSDL.
>
> Prateek
>
> On Thu, Jul 8, 2010 at 12:48 PM, Magnus Altin <ma...@gmail.com> wrote:
>> I'm developing a web service with Axis2 1.5.1 and I have a problem
>> with a Dotnet client trying to consume it.
>>
>> I'm using the contract first model and this is how I define one of my
>> complex types:
>>
>> <xsd:complexType name="Category" >
>> <xsd:sequence>
>> <xsd:element name="id" type="xsd:int"></xsd:element>
>> <xsd:element name="text" type="xsd:string"></xsd:element>
>> <xsd:element name="parentId" type="xsd:int"></xsd:element>
>> <xsd:element name="treeLevel" type="xsd:int"></xsd:element>
>> <xsd:element name="isLeafNode" type="xsd:boolean"></xsd:element>
>> </xsd:sequence>
>> </xsd:complexType>
>>
>> And here is what my ADB and Axis2 generated WSDL looks like:
>>
>> <xs:complexType name="Category">
>> <xs:sequence>
>> <xs:element minOccurs="0" name="id" type="xs:int"/>
>> <xs:element minOccurs="0" name="isLeafNode" type="xs:boolean"/>
>> <xs:element minOccurs="0" name="parentId" type="xs:int"/>
>> <xs:element minOccurs="0" name="text" nillable="true"
>> type="xs:string"/>
>> <xs:element minOccurs="0" name="treeLevel" type="xs:int"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> Pretty similar :-)
>>
>> And finally here is a snippet of the output from the service call (from SoapUI)
>>
>> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
>> <soapenv:Body>
>> <ns:readCategoryResponse
>> xmlns:ns="http://webservices.project.company.se"
>> xmlns:ax21="http://gen.webservices.project.company.se/xsd">
>> <ns:return>
>> <id>1001</id>
>> <text>Administration</text>
>> <parentId>0</parentId>
>> <treeLevel>0</treeLevel>
>> <isLeafNode>false</isLeafNode>
>> </ns:return>
>> ...
>> ...
>> ...
>>
>> Why is xmlns:ax21 declared as a namespace when it's never used?
>>
>> Shouldn't the elements id, text, parentId and so on have a namespace prefix?
>>
>> Like this:
>> <ax21:id>1001</ax21:id>
>>
>> I believe that our Dotnet client should be able to understand the
>> data better if it is namespace prefixed. Now it just gets a null
>> value.
>>
>> I would very much appreciate any thoughts on this problem
>>
>> Kind regards,
>> Magnus
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
Re: Namespace missing on elements
Posted by Prateek Asthana <pa...@gmail.com>.
Magnus,
Please paste the complete WSDL.
Prateek
On Thu, Jul 8, 2010 at 12:48 PM, Magnus Altin <ma...@gmail.com> wrote:
> I'm developing a web service with Axis2 1.5.1 and I have a problem
> with a Dotnet client trying to consume it.
>
> I'm using the contract first model and this is how I define one of my
> complex types:
>
> <xsd:complexType name="Category" >
> <xsd:sequence>
> <xsd:element name="id" type="xsd:int"></xsd:element>
> <xsd:element name="text" type="xsd:string"></xsd:element>
> <xsd:element name="parentId" type="xsd:int"></xsd:element>
> <xsd:element name="treeLevel" type="xsd:int"></xsd:element>
> <xsd:element name="isLeafNode" type="xsd:boolean"></xsd:element>
> </xsd:sequence>
> </xsd:complexType>
>
> And here is what my ADB and Axis2 generated WSDL looks like:
>
> <xs:complexType name="Category">
> <xs:sequence>
> <xs:element minOccurs="0" name="id" type="xs:int"/>
> <xs:element minOccurs="0" name="isLeafNode" type="xs:boolean"/>
> <xs:element minOccurs="0" name="parentId" type="xs:int"/>
> <xs:element minOccurs="0" name="text" nillable="true"
> type="xs:string"/>
> <xs:element minOccurs="0" name="treeLevel" type="xs:int"/>
> </xs:sequence>
> </xs:complexType>
>
> Pretty similar :-)
>
> And finally here is a snippet of the output from the service call (from SoapUI)
>
> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> <soapenv:Body>
> <ns:readCategoryResponse
> xmlns:ns="http://webservices.project.company.se"
> xmlns:ax21="http://gen.webservices.project.company.se/xsd">
> <ns:return>
> <id>1001</id>
> <text>Administration</text>
> <parentId>0</parentId>
> <treeLevel>0</treeLevel>
> <isLeafNode>false</isLeafNode>
> </ns:return>
> ...
> ...
> ...
>
> Why is xmlns:ax21 declared as a namespace when it's never used?
>
> Shouldn't the elements id, text, parentId and so on have a namespace prefix?
>
> Like this:
> <ax21:id>1001</ax21:id>
>
> I believe that our Dotnet client should be able to understand the
> data better if it is namespace prefixed. Now it just gets a null
> value.
>
> I would very much appreciate any thoughts on this problem
>
> Kind regards,
> Magnus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org