You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by sreenivasamurthy krishnappa <sr...@hotmail.com> on 2004/06/26 16:07:32 UTC

Problem in setting the namespace prefixes

HI Folks,

We have to interface with a webservice server , and we started using the 
apache soap tool kit for it.
the problem is that we need to use a couple of namespaces for the method 
invocation.
We are using RPC kind of invocation.

The problem is that the in the operation tag we have the name space defined 
as
xmlns:ns1="THEURL"
but the prefix ns1 is not getting added to all the tags in the SOAP message 
, basically the parameter tag and its contents.

ex:
Itis coming as

<createTicket xmlns:ns1="THEURL">
<createTicketInput>
    <elementa>value</elementa>
    <elementb>value</elementb>
</createTicketInput>
</createTicket>

In this case the operation createTicket and createTicketInput is not 
recognized by the server , as it need them to belong to ns1 namespace.

not I want the SOAP message to be generated as

<ns1:createTicket xmlns:ns1="THEURL">
<ns1:createTicketInput>
    <ns1:elementa>value</ns1:elementa>
    <ns1:elementb>value</ns1:elementb>
</ns1:createTicketInput>
</ns1:createTicket>

Couple of my co developers have jumped into modifying the Apache soap source 
code to achieve this. Which is very tedious to understand and change.

This looks to me like a basic requirement , Is there any better, easy and 
straight forward way of achieving this???

please help, ASAP

Sreeni

_________________________________________________________________
Contact brides & grooms FREE! http://www.shaadi.com/index.php?ptnr=hmltag 
Only on www.shaadi.com. Register now!


Re: Problem in setting the namespace prefixes

Posted by Scott Nichol <sn...@scottnichol.com>.
There is no single standard for the use of namespaces in SOAP messages.  Apache SOAP always assigns a namespace to the element representing the RPC operation, such as

<ns1:helloString xmlns:ns1="urn:hello1"
        SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<name xsi:type="xsd:string">Bill</name>
</ns1:helloString>

Namespacing has been better addressed by WSDL, which uses XML Schema, which provides mechanisms for specifying which elements must be namespaced.  Newer SOAP implementations, such as Apache Axis, support WSDL and thus can create messages with the namespaces the server requires.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "sreenivasamurthy krishnappa" <sr...@hotmail.com>
To: <so...@ws.apache.org>
Sent: Saturday, June 26, 2004 10:07 AM
Subject: Problem in setting the namespace prefixes


> HI Folks,
> 
> We have to interface with a webservice server , and we started using the 
> apache soap tool kit for it.
> the problem is that we need to use a couple of namespaces for the method 
> invocation.
> We are using RPC kind of invocation.
> 
> The problem is that the in the operation tag we have the name space defined 
> as
> xmlns:ns1="THEURL"
> but the prefix ns1 is not getting added to all the tags in the SOAP message 
> , basically the parameter tag and its contents.
> 
> ex:
> Itis coming as
> 
> <createTicket xmlns:ns1="THEURL">
> <createTicketInput>
>     <elementa>value</elementa>
>     <elementb>value</elementb>
> </createTicketInput>
> </createTicket>
> 
> In this case the operation createTicket and createTicketInput is not 
> recognized by the server , as it need them to belong to ns1 namespace.
> 
> not I want the SOAP message to be generated as
> 
> <ns1:createTicket xmlns:ns1="THEURL">
> <ns1:createTicketInput>
>     <ns1:elementa>value</ns1:elementa>
>     <ns1:elementb>value</ns1:elementb>
> </ns1:createTicketInput>
> </ns1:createTicket>
> 
> Couple of my co developers have jumped into modifying the Apache soap source 
> code to achieve this. Which is very tedious to understand and change.
> 
> This looks to me like a basic requirement , Is there any better, easy and 
> straight forward way of achieving this???
> 
> please help, ASAP
> 
> Sreeni
> 
> _________________________________________________________________
> Contact brides & grooms FREE! http://www.shaadi.com/index.php?ptnr=hmltag 
> Only on www.shaadi.com. Register now!
> 
>