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 Steve Pruitt <SP...@exstream.com> on 2003/07/02 19:28:27 UTC

response and result tag override

All,

Is there away in a soap request to specify what the response and result tags are named in the soap response?


Thanks,

-Steve Pruitt

Re: response and result tag override

Posted by Daniel Zhang <zh...@clinicaltools.com>.
Steve Pruitt wrote:

>All,
>
>Is there away in a soap request to specify what the response and result tags are named in the soap response?
>
>
>Thanks,
>
>-Steve Pruitt
>  
>
If you use message call, you can specify your own tag. See Apache SOAP 
example in samples/messaging.  At server side, after you get
request and parameters, you can call resCtx.setRootPart(ResponseString, 
"text/xml") in yourMethod(Envelope env, SOAPContext reqCtx,
SOAPContext resCtx).  But I am afraid you can pass object in message call.

-Daniel


Re: response and result tag override

Posted by Scott Nichol <sn...@scottnichol.com>.
I will qualify my previous response by saying there is no way built 
into the SOAP protocol.  You could, of course, have a service that 
accepted as parameters the response and result element names.  
However, since such a response could not be described in WSDL, your 
service would not be following WS-Interop guidelines.

On 2 Jul 2003 at 13:28, Steve Pruitt wrote:

> All,
> 
> Is there away in a soap request to specify what the response and result tags are named in the soap response?
> 
> 
> Thanks,
> 
> -Steve Pruitt
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Customed SOAP Tags

Posted by Daniel Zhang <zh...@clinicaltools.com>.
Thanks a lot! Scott. I posted the question "Multiple Methods call in 
SOAP Body" in this mailing list
before and you answered me.  Since our customer's spec has two 
methods(elements) in SOAP RPC
Body, so I played a trick using messaging API, the first method is 
nothing but a dummy, inside it,
I let program call the second method. In this way, you can have two 
elements in Body. It works though
it is not a standard way to do SOAP things. Unfortunately, I don't have 
WSDL for this service. I am
still waiting for the customer side technical stuff to answer the 
multiple methods(elements) call question.

-Daniel
Scott Nichol wrote:

>You cannot achieve the desired envelope using an Apache SOAP RPC 
>Call, because it is not a SOAP RPC call.  In particular, the SOAP 1.1 
>spec implies and the 1.2 spec clarifies, an RPC SOAP Body has a 
>single body element.  The body you show has 2.  As such, with Apache 
>SOAP, you are stuck using the messaging API.
>
>Additionally, Apache SOAP has the limitation that one cannot specify 
>a namespace for a parameter.  Someone started adding this capability 
>quite some time ago, but it was never finished.
>
>I am curious: do you have WSDL for this service?  If so, can you post 
>it?
>
>On 7 Jul 2003 at 9:22, Daniel Zhang wrote:
>
>  
>
>>Thank you Scott for your patient reply.  What I mean is every tag inside 
>>Envelope is CUSTOMIZED.
>>In SOAP RPC call, you usually have default tag inside SOAP Body like:
>>
>><ns1: methodName xmlns:ns1="urn:..." 
>>SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>>
>>I understand that one can change part of the tags/prefix through 
>>Constants.java, but in my particular case, there are
>>several depths of nested elements inside the Header and Body,  each 
>>element has exactly fixed format and tag for it.
>>I find it is really hard to realize this through changing 
>>Constants.java.  That's why I use message.send() to control
>>those customized prefix and tags.
>>
>>What I wonder is if there are methods in Apache SOAP to let me pass the 
>>customized tags and prefix into its Header
>>and Body. For example, say you have buildHeader(stringHeader), 
>>buildBody(stringBody), so that you can pass a
>>pre-defined Header and Body tags/prefix into the Envelope.
>>
>>Thanks again,
>>
>>-Daniel
>>
>>
>>    
>>



Re: Customed SOAP Tags

Posted by Scott Nichol <sn...@scottnichol.com>.
You cannot achieve the desired envelope using an Apache SOAP RPC 
Call, because it is not a SOAP RPC call.  In particular, the SOAP 1.1 
spec implies and the 1.2 spec clarifies, an RPC SOAP Body has a 
single body element.  The body you show has 2.  As such, with Apache 
SOAP, you are stuck using the messaging API.

Additionally, Apache SOAP has the limitation that one cannot specify 
a namespace for a parameter.  Someone started adding this capability 
quite some time ago, but it was never finished.

I am curious: do you have WSDL for this service?  If so, can you post 
it?

On 7 Jul 2003 at 9:22, Daniel Zhang wrote:

> Thank you Scott for your patient reply.  What I mean is every tag inside 
> Envelope is CUSTOMIZED.
> In SOAP RPC call, you usually have default tag inside SOAP Body like:
> 
> <ns1: methodName xmlns:ns1="urn:..." 
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> 
> I understand that one can change part of the tags/prefix through 
> Constants.java, but in my particular case, there are
> several depths of nested elements inside the Header and Body,  each 
> element has exactly fixed format and tag for it.
> I find it is really hard to realize this through changing 
> Constants.java.  That's why I use message.send() to control
> those customized prefix and tags.
> 
> What I wonder is if there are methods in Apache SOAP to let me pass the 
> customized tags and prefix into its Header
> and Body. For example, say you have buildHeader(stringHeader), 
> buildBody(stringBody), so that you can pass a
> pre-defined Header and Body tags/prefix into the Envelope.
> 
> Thanks again,
> 
> -Daniel
> 
> 
> Scott Nichol wrote:
> 
> >Hmmm.  I still don't quite understand what you need to accomplish.  
> >You have emphasized *soap:Envelope*, *soap:Header* and *soap:Body*, 
> >which is just a change of namespace prefix from SOAP-ENV to soap.  
> >The way you would achieve that is to change Constants.java and make 
> >sure its .class file gets loaded instead of the "sanctioned" one from 
> >a distribution.  Are there other aspects to the request that you do 
> >not know how to do with Apache SOAP?
> >
> >On 3 Jul 2003 at 11:53, Daniel Zhang wrote:
> >
> >  
> >
> >>Scott -
> >>
> >>What need to be changed are not only prefix, also include SOAP Header, 
> >>Body, and their
> >>sub-elements. Our customer required a specific format for SOAP Request 
> >>and Response.
> >>Example of SOAP request like:
> >>
> >><*soap:Envelope* xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> >>              xmlns:cb="http://mycompany.com/cbody.xsd"
> >>              xmlns:ch="http://mycompany.com/cheader.xsd"            
> >>              
> >>xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd" 
> >>
> >>              xmlns:xlink="http://www.w3.org/1999/xlink"
> >>              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>              xmlns:xs="http://www.w3/org/2001/XMLSchema"
> >>              xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/
> >>                                  
> >>http://www.oasis-open.org/committees/ebxml-msg/schema/envelope.xsd
> >>                                  cbody.xsd cheader.xsd status.xsd 
> >>ticket.xsd response.xsd" >
> >>* <soap:Header> *
> >>   <eb:MessageHeader eb:id="ID000001" 
> >>eb:version="2.0"soap:mustUnderstand = "1">
> >>     <eb:From>
> >>           <eb:Role>String</eb:Role>
> >>     </eb:From>
> >>     <eb:To>
> >>           <eb:Role>String</eb:Role>
> >>     </eb:To>
> >>     <eb:CPAId>TBD</eb:CPAId>
> >>     <eb:ConversationId>934523405</eb:ConversationId>
> >>     <eb:Service>service</eb:Service>
> >>     <eb:Action>Application</eb:Action>     
> >>   </eb:MessageHeader>
> >>   <ch:cHeader>    
> >>     <ch:version>1.0</ch:version>
> >>     <ch:messageType type="xs:string">string</ch:messageType>
> >>   </ch:cHeader>
> >> *</soap:Header>*
> >>* <soap:Body>*
> >>   <eb:Manifest eb:id="ID000002" eb:version="2.0">
> >>      <eb:xlink="http://mycompany.com/link" />
> >>   </eb:Manifest>
> >>   <cb:cBody>
> >>     <cb:MessageType>
> >>        <cb:Name>John</cb:Name>
> >>        <cb:Phone>1233456789</cb:Phone>
> >>         .....
> >>     </cb:MessageType>
> >>   </cb:cBody>
> >> *</soap:Body>**
> >></soap:Envelope>  *  
> >>
> >>So how can I achieve this in SOAP RPC call(call.invoke())? Apache SOAP 
> >>is pretty much predefine those tags.
> >>All I think now is to use message call to achieve but it can not embed 
> >>object or attachment, isn't it?
> >>
> >>-Daniel
> >>
> >>
> >>    
> >>
> 
> 
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Customed SOAP Tags

Posted by Daniel Zhang <zh...@clinicaltools.com>.
Thank you Scott for your patient reply.  What I mean is every tag inside 
Envelope is CUSTOMIZED.
In SOAP RPC call, you usually have default tag inside SOAP Body like:

<ns1: methodName xmlns:ns1="urn:..." 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

I understand that one can change part of the tags/prefix through 
Constants.java, but in my particular case, there are
several depths of nested elements inside the Header and Body,  each 
element has exactly fixed format and tag for it.
I find it is really hard to realize this through changing 
Constants.java.  That's why I use message.send() to control
those customized prefix and tags.

What I wonder is if there are methods in Apache SOAP to let me pass the 
customized tags and prefix into its Header
and Body. For example, say you have buildHeader(stringHeader), 
buildBody(stringBody), so that you can pass a
pre-defined Header and Body tags/prefix into the Envelope.

Thanks again,

-Daniel


Scott Nichol wrote:

>Hmmm.  I still don't quite understand what you need to accomplish.  
>You have emphasized *soap:Envelope*, *soap:Header* and *soap:Body*, 
>which is just a change of namespace prefix from SOAP-ENV to soap.  
>The way you would achieve that is to change Constants.java and make 
>sure its .class file gets loaded instead of the "sanctioned" one from 
>a distribution.  Are there other aspects to the request that you do 
>not know how to do with Apache SOAP?
>
>On 3 Jul 2003 at 11:53, Daniel Zhang wrote:
>
>  
>
>>Scott -
>>
>>What need to be changed are not only prefix, also include SOAP Header, 
>>Body, and their
>>sub-elements. Our customer required a specific format for SOAP Request 
>>and Response.
>>Example of SOAP request like:
>>
>><*soap:Envelope* xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>>              xmlns:cb="http://mycompany.com/cbody.xsd"
>>              xmlns:ch="http://mycompany.com/cheader.xsd"            
>>              
>>xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd" 
>>
>>              xmlns:xlink="http://www.w3.org/1999/xlink"
>>              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>              xmlns:xs="http://www.w3/org/2001/XMLSchema"
>>              xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/
>>                                  
>>http://www.oasis-open.org/committees/ebxml-msg/schema/envelope.xsd
>>                                  cbody.xsd cheader.xsd status.xsd 
>>ticket.xsd response.xsd" >
>>* <soap:Header> *
>>   <eb:MessageHeader eb:id="ID000001" 
>>eb:version="2.0"soap:mustUnderstand = "1">
>>     <eb:From>
>>           <eb:Role>String</eb:Role>
>>     </eb:From>
>>     <eb:To>
>>           <eb:Role>String</eb:Role>
>>     </eb:To>
>>     <eb:CPAId>TBD</eb:CPAId>
>>     <eb:ConversationId>934523405</eb:ConversationId>
>>     <eb:Service>service</eb:Service>
>>     <eb:Action>Application</eb:Action>     
>>   </eb:MessageHeader>
>>   <ch:cHeader>    
>>     <ch:version>1.0</ch:version>
>>     <ch:messageType type="xs:string">string</ch:messageType>
>>   </ch:cHeader>
>> *</soap:Header>*
>>* <soap:Body>*
>>   <eb:Manifest eb:id="ID000002" eb:version="2.0">
>>      <eb:xlink="http://mycompany.com/link" />
>>   </eb:Manifest>
>>   <cb:cBody>
>>     <cb:MessageType>
>>        <cb:Name>John</cb:Name>
>>        <cb:Phone>1233456789</cb:Phone>
>>         .....
>>     </cb:MessageType>
>>   </cb:cBody>
>> *</soap:Body>**
>></soap:Envelope>  *  
>>
>>So how can I achieve this in SOAP RPC call(call.invoke())? Apache SOAP 
>>is pretty much predefine those tags.
>>All I think now is to use message call to achieve but it can not embed 
>>object or attachment, isn't it?
>>
>>-Daniel
>>
>>
>>    
>>



Re: Customed SOAP Tags

Posted by Scott Nichol <sn...@scottnichol.com>.
Hmmm.  I still don't quite understand what you need to accomplish.  
You have emphasized *soap:Envelope*, *soap:Header* and *soap:Body*, 
which is just a change of namespace prefix from SOAP-ENV to soap.  
The way you would achieve that is to change Constants.java and make 
sure its .class file gets loaded instead of the "sanctioned" one from 
a distribution.  Are there other aspects to the request that you do 
not know how to do with Apache SOAP?

On 3 Jul 2003 at 11:53, Daniel Zhang wrote:

> Scott -
> 
> What need to be changed are not only prefix, also include SOAP Header, 
> Body, and their
> sub-elements. Our customer required a specific format for SOAP Request 
> and Response.
> Example of SOAP request like:
> 
> <*soap:Envelope* xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>               xmlns:cb="http://mycompany.com/cbody.xsd"
>               xmlns:ch="http://mycompany.com/cheader.xsd"            
>               
> xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd" 
> 
>               xmlns:xlink="http://www.w3.org/1999/xlink"
>               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>               xmlns:xs="http://www.w3/org/2001/XMLSchema"
>               xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/
>                                   
> http://www.oasis-open.org/committees/ebxml-msg/schema/envelope.xsd
>                                   cbody.xsd cheader.xsd status.xsd 
> ticket.xsd response.xsd" >
> * <soap:Header> *
>    <eb:MessageHeader eb:id="ID000001" 
> eb:version="2.0"soap:mustUnderstand = "1">
>      <eb:From>
>            <eb:Role>String</eb:Role>
>      </eb:From>
>      <eb:To>
>            <eb:Role>String</eb:Role>
>      </eb:To>
>      <eb:CPAId>TBD</eb:CPAId>
>      <eb:ConversationId>934523405</eb:ConversationId>
>      <eb:Service>service</eb:Service>
>      <eb:Action>Application</eb:Action>     
>    </eb:MessageHeader>
>    <ch:cHeader>    
>      <ch:version>1.0</ch:version>
>      <ch:messageType type="xs:string">string</ch:messageType>
>    </ch:cHeader>
>  *</soap:Header>*
> * <soap:Body>*
>    <eb:Manifest eb:id="ID000002" eb:version="2.0">
>       <eb:xlink="http://mycompany.com/link" />
>    </eb:Manifest>
>    <cb:cBody>
>      <cb:MessageType>
>         <cb:Name>John</cb:Name>
>         <cb:Phone>1233456789</cb:Phone>
>          .....
>      </cb:MessageType>
>    </cb:cBody>
>  *</soap:Body>**
> </soap:Envelope>  *  
> 
> So how can I achieve this in SOAP RPC call(call.invoke())? Apache SOAP 
> is pretty much predefine those tags.
> All I think now is to use message call to achieve but it can not embed 
> object or attachment, isn't it?
> 
> -Daniel
> 
> 
> Scott Nichol wrote:
> 
> >Can you be more specific about what you mean by your "own SOAP tags"? 
> >Your example shows a different namespace prefix.  Is that all you 
> >want to do, change the namespace prefixes?
> >
> >On 3 Jul 2003 at 8:12, Daniel Zhang wrote:
> >
> >  
> >
> >>I need to write my own SOAP tags in SOAP message. I prefer to use SOAP 
> >>RPC call(call.invoke()),  but I found
> >>it's not easy to change the SOAP tag(e.g change default Apache SOAP 
> >>default <SOAP-ENV: Envelope ... to
> >><soap:Envelope ..., also change other tags). So I turned to use SOAP 
> >>Message transmission since it's easy to write
> >>your own tag and make it as message.send(). However, I found it's hard 
> >>to pass any object or attachment.
> >>
> >>I wonder how I can solve this problem? Does SOAP RPC call allow you to 
> >>construct your own tags for SOAP
> >>header and body? Or does SOAP Message allow you to embed any object or 
> >>attachment?
> >>
> >>Thank you all in advance,
> >>
> >>-Daniel
> >>
> >>
> >>    
> >>
> >
> >
> >Scott Nichol
> >
> >Do not reply directly to this e-mail address,
> >as it is filtered to only receive e-mail from
> >specific mailing lists.
> >
> >  
> >
> 
> 
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Customed SOAP Tags

Posted by Daniel Zhang <zh...@clinicaltools.com>.
Scott -

What need to be changed are not only prefix, also include SOAP Header, 
Body, and their
sub-elements. Our customer required a specific format for SOAP Request 
and Response.
Example of SOAP request like:

<*soap:Envelope* xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
              xmlns:cb="http://mycompany.com/cbody.xsd"
              xmlns:ch="http://mycompany.com/cheader.xsd"            
              
xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd" 

              xmlns:xlink="http://www.w3.org/1999/xlink"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:xs="http://www.w3/org/2001/XMLSchema"
              xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/
                                  
http://www.oasis-open.org/committees/ebxml-msg/schema/envelope.xsd
                                  cbody.xsd cheader.xsd status.xsd 
ticket.xsd response.xsd" >
* <soap:Header> *
   <eb:MessageHeader eb:id="ID000001" 
eb:version="2.0"soap:mustUnderstand = "1">
     <eb:From>
           <eb:Role>String</eb:Role>
     </eb:From>
     <eb:To>
           <eb:Role>String</eb:Role>
     </eb:To>
     <eb:CPAId>TBD</eb:CPAId>
     <eb:ConversationId>934523405</eb:ConversationId>
     <eb:Service>service</eb:Service>
     <eb:Action>Application</eb:Action>     
   </eb:MessageHeader>
   <ch:cHeader>    
     <ch:version>1.0</ch:version>
     <ch:messageType type="xs:string">string</ch:messageType>
   </ch:cHeader>
 *</soap:Header>*
* <soap:Body>*
   <eb:Manifest eb:id="ID000002" eb:version="2.0">
      <eb:xlink="http://mycompany.com/link" />
   </eb:Manifest>
   <cb:cBody>
     <cb:MessageType>
        <cb:Name>John</cb:Name>
        <cb:Phone>1233456789</cb:Phone>
         .....
     </cb:MessageType>
   </cb:cBody>
 *</soap:Body>**
</soap:Envelope>  *  

So how can I achieve this in SOAP RPC call(call.invoke())? Apache SOAP 
is pretty much predefine those tags.
All I think now is to use message call to achieve but it can not embed 
object or attachment, isn't it?

-Daniel


Scott Nichol wrote:

>Can you be more specific about what you mean by your "own SOAP tags"? 
>Your example shows a different namespace prefix.  Is that all you 
>want to do, change the namespace prefixes?
>
>On 3 Jul 2003 at 8:12, Daniel Zhang wrote:
>
>  
>
>>I need to write my own SOAP tags in SOAP message. I prefer to use SOAP 
>>RPC call(call.invoke()),  but I found
>>it's not easy to change the SOAP tag(e.g change default Apache SOAP 
>>default <SOAP-ENV: Envelope ... to
>><soap:Envelope ..., also change other tags). So I turned to use SOAP 
>>Message transmission since it's easy to write
>>your own tag and make it as message.send(). However, I found it's hard 
>>to pass any object or attachment.
>>
>>I wonder how I can solve this problem? Does SOAP RPC call allow you to 
>>construct your own tags for SOAP
>>header and body? Or does SOAP Message allow you to embed any object or 
>>attachment?
>>
>>Thank you all in advance,
>>
>>-Daniel
>>
>>
>>    
>>
>
>
>Scott Nichol
>
>Do not reply directly to this e-mail address,
>as it is filtered to only receive e-mail from
>specific mailing lists.
>
>  
>



Re: Customed SOAP Tags

Posted by Scott Nichol <sn...@scottnichol.com>.
Can you be more specific about what you mean by your "own SOAP tags"? 
Your example shows a different namespace prefix.  Is that all you 
want to do, change the namespace prefixes?

On 3 Jul 2003 at 8:12, Daniel Zhang wrote:

> I need to write my own SOAP tags in SOAP message. I prefer to use SOAP 
> RPC call(call.invoke()),  but I found
> it's not easy to change the SOAP tag(e.g change default Apache SOAP 
> default <SOAP-ENV: Envelope ... to
> <soap:Envelope ..., also change other tags). So I turned to use SOAP 
> Message transmission since it's easy to write
> your own tag and make it as message.send(). However, I found it's hard 
> to pass any object or attachment.
> 
> I wonder how I can solve this problem? Does SOAP RPC call allow you to 
> construct your own tags for SOAP
> header and body? Or does SOAP Message allow you to embed any object or 
> attachment?
> 
> Thank you all in advance,
> 
> -Daniel
> 
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Customed SOAP Tags

Posted by Daniel Zhang <zh...@clinicaltools.com>.
I need to write my own SOAP tags in SOAP message. I prefer to use SOAP 
RPC call(call.invoke()),  but I found
it's not easy to change the SOAP tag(e.g change default Apache SOAP 
default <SOAP-ENV: Envelope ... to
<soap:Envelope ..., also change other tags). So I turned to use SOAP 
Message transmission since it's easy to write
your own tag and make it as message.send(). However, I found it's hard 
to pass any object or attachment.

I wonder how I can solve this problem? Does SOAP RPC call allow you to 
construct your own tags for SOAP
header and body? Or does SOAP Message allow you to embed any object or 
attachment?

Thank you all in advance,

-Daniel


Re: response and result tag override

Posted by Scott Nichol <sn...@scottnichol.com>.
Not according to the spec.

On 2 Jul 2003 at 13:28, Steve Pruitt wrote:

> All,
> 
> Is there away in a soap request to specify what the response and result tags are named in the soap response?
> 
> 
> Thanks,
> 
> -Steve Pruitt
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.