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 Rainer Menzner <rm...@L1id.com> on 2007/01/18 13:36:36 UTC
[Axis2] wsdl2java / Axis2 : Is namespace / prefix handling in SOAP
messages configurable?
Hi,
up to now I had a web-service implemented in Axis2 along with
a client written in .Net 2 C# up and running successfully. I use
wsdl2java and wsdl.exe in order to create the server and client
stubs. The WSDL used Document/literal SOAP.
Now I had to extend some messages to multiple parts, which enforced
using RPC/literal SOAP. And now, I run into a problem:
Axis2 generates SOAP-messages that use a namespace prefix e.g.,
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header />
<soapenv:Body>
<ns1:ReRegisterResponse
xmlns:ns1="http://www.company.com/Communication/1/0/">
<ReRegisterResult>
<ns1:ClientGuid>12EA746B95AE57CEFFB11D6FA22D9400</ns1:ClientGuid>
</ReRegisterResult>
</ns1:ReRegisterResponse>
</soapenv:Body>
</soapenv:Envelope>
By contrast, WSDL.exe-stub generates messages that define the namespace
within an attribute, e.g.
<?xml version='1.0' encoding='utf-8'?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ReRegister xmlns="http://www.company.com/Communication/1/0/api/">
<ReRegisterParam xmlns="">
<ClientIdentifier
xmlns="http://www.identix.com/Communication/1/0/">testclient</ClientIdentifier>
<ClientSign xmlns="http://www.company.com/Communication/1/0/" />
<RetainClaimedData
xmlns="http://www.company.com/Communication/1/0/">true</RetainClaimedData>
</ReRegisterParam>
</ReRegister>
</soap:Body>
</soap:Envelope>
Now, Axis2 obviously can handle both formats correctly, messages arrive
and are processed properly. But the .Net stub is not able to decode the
message that uses the namespace-prefix format. As a result I receive a
null pointer message.
Hence my question, can Axis2 be configured how to layout the newly
created messages? I don't know which format is the best or if one is not
allowed at all. Axis2 format using namespace-prefix is more compact.
Thanks and best regards,
-Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: [Axis2] wsdl2java / Axis2 : Is namespace / prefix handling in
SOAP messages configurable?
Posted by Rainer Menzner <rm...@L1id.com>.
Hello Anne,
Anne Thomas Manes wrote:
> Rainer,
>
> .Net has no problem dealing with explicit versus default namespace
> declarations. My guess is that the problem is caused by the fact that
> .NET doesn't support RPC/Literal.
>
strange, why do they not issue an appropriate message when propcessing
the WSDL?
> Rather than using RPC style, you should use the wrapped
> document/literal style. You just have to wrap your parameters with a
> wrapper element. See my blog post on the topic:
>
> http://atmanes.blogspot.com/2005/03/wrapped-documentliteral-convention.html
>
thanks for this hint, your article was very useful for me. I'll try the
Wrapped Document/Literal.
Thanks for your quick answer and best regards,
-Rainer
> Anne
>
> On 1/18/07, Rainer Menzner <rm...@l1id.com> wrote:
>> Hi,
>>
>> up to now I had a web-service implemented in Axis2 along with
>> a client written in .Net 2 C# up and running successfully. I use
>> wsdl2java and wsdl.exe in order to create the server and client
>> stubs. The WSDL used Document/literal SOAP.
>>
>> Now I had to extend some messages to multiple parts, which enforced
>> using RPC/literal SOAP. And now, I run into a problem:
>>
>> Axis2 generates SOAP-messages that use a namespace prefix e.g.,
>>
>> <?xml version='1.0' encoding='utf-8'?>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>> <soapenv:Header />
>> <soapenv:Body>
>> <ns1:ReRegisterResponse
>> xmlns:ns1="http://www.company.com/Communication/1/0/">
>> <ReRegisterResult>
>>
>> <ns1:ClientGuid>12EA746B95AE57CEFFB11D6FA22D9400</ns1:ClientGuid>
>> </ReRegisterResult>
>> </ns1:ReRegisterResponse>
>> </soapenv:Body>
>> </soapenv:Envelope>
>>
>>
>> By contrast, WSDL.exe-stub generates messages that define the namespace
>> within an attribute, e.g.
>>
>> <?xml version='1.0' encoding='utf-8'?>
>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>> <soap:Body>
>> <ReRegister xmlns="http://www.company.com/Communication/1/0/api/">
>> <ReRegisterParam xmlns="">
>> <ClientIdentifier
>> xmlns="http://www.identix.com/Communication/1/0/">testclient</ClientIdentifier>
>>
>> <ClientSign xmlns="http://www.company.com/Communication/1/0/" />
>> <RetainClaimedData
>> xmlns="http://www.company.com/Communication/1/0/">true</RetainClaimedData>
>>
>> </ReRegisterParam>
>> </ReRegister>
>> </soap:Body>
>> </soap:Envelope>
>>
>>
>> Now, Axis2 obviously can handle both formats correctly, messages arrive
>> and are processed properly. But the .Net stub is not able to decode the
>> message that uses the namespace-prefix format. As a result I receive a
>> null pointer message.
>>
>> Hence my question, can Axis2 be configured how to layout the newly
>> created messages? I don't know which format is the best or if one is not
>> allowed at all. Axis2 format using namespace-prefix is more compact.
>>
>> Thanks and best regards,
>> -Rainer
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: [Axis2] wsdl2java / Axis2 : Is namespace / prefix handling in SOAP messages configurable?
Posted by Anne Thomas Manes <at...@gmail.com>.
Rainer,
.Net has no problem dealing with explicit versus default namespace
declarations. My guess is that the problem is caused by the fact that
.NET doesn't support RPC/Literal.
Rather than using RPC style, you should use the wrapped
document/literal style. You just have to wrap your parameters with a
wrapper element. See my blog post on the topic:
http://atmanes.blogspot.com/2005/03/wrapped-documentliteral-convention.html
Anne
On 1/18/07, Rainer Menzner <rm...@l1id.com> wrote:
> Hi,
>
> up to now I had a web-service implemented in Axis2 along with
> a client written in .Net 2 C# up and running successfully. I use
> wsdl2java and wsdl.exe in order to create the server and client
> stubs. The WSDL used Document/literal SOAP.
>
> Now I had to extend some messages to multiple parts, which enforced
> using RPC/literal SOAP. And now, I run into a problem:
>
> Axis2 generates SOAP-messages that use a namespace prefix e.g.,
>
> <?xml version='1.0' encoding='utf-8'?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> <soapenv:Header />
> <soapenv:Body>
> <ns1:ReRegisterResponse
> xmlns:ns1="http://www.company.com/Communication/1/0/">
> <ReRegisterResult>
> <ns1:ClientGuid>12EA746B95AE57CEFFB11D6FA22D9400</ns1:ClientGuid>
> </ReRegisterResult>
> </ns1:ReRegisterResponse>
> </soapenv:Body>
> </soapenv:Envelope>
>
>
> By contrast, WSDL.exe-stub generates messages that define the namespace
> within an attribute, e.g.
>
> <?xml version='1.0' encoding='utf-8'?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <soap:Body>
> <ReRegister xmlns="http://www.company.com/Communication/1/0/api/">
> <ReRegisterParam xmlns="">
> <ClientIdentifier
> xmlns="http://www.identix.com/Communication/1/0/">testclient</ClientIdentifier>
> <ClientSign xmlns="http://www.company.com/Communication/1/0/" />
> <RetainClaimedData
> xmlns="http://www.company.com/Communication/1/0/">true</RetainClaimedData>
> </ReRegisterParam>
> </ReRegister>
> </soap:Body>
> </soap:Envelope>
>
>
> Now, Axis2 obviously can handle both formats correctly, messages arrive
> and are processed properly. But the .Net stub is not able to decode the
> message that uses the namespace-prefix format. As a result I receive a
> null pointer message.
>
> Hence my question, can Axis2 be configured how to layout the newly
> created messages? I don't know which format is the best or if one is not
> allowed at all. Axis2 format using namespace-prefix is more compact.
>
> Thanks and best regards,
> -Rainer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org