Hi Eran,
I agree.  Axis2 is WS-Addressing compliant.  If someone uses the Axis2
APIs though and changes the wsa headers (which you correctly pointed out
earlier should not be messed with), then it's becomes a user issue if
the output message is no longer spec compliant.
 
Erwin,
One of the goals of WS-Addressing is to help identify where the SOAP
message is going to just by looking at the message itself.  If your
server is just routing the request to another location/server and you
want your client to specify/hint where to route it to, you probably need
to set that URI in some other element other than wsa:To.  Perhaps using
an EPR reference parameter will work?
 
To help clarify, see Sections 2.3, 3, and 3.1 of the spec here:
http://www.w3.org/Submission/ws-addressing/
 
Here's some snippets of the related content:
 
Section 2.3:

The SOAP binding for endpoint references is defined by the following two
rules:

*       The [address] property in the endpoint reference is copied in
the [destination] header field of the SOAP message.  

Section 3:

[destination] : URI (mandatory) 

The address of the intended receiver of this message. 

 

Section 3.1:

/wsa:To 

This REQUIRED element (of type xs:anyURI) provides the value for the
[destination] property. 

 

Hope this helps...
-Vinh

________________________________

From: Eran Chinthaka [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2008 10:17 AM
To: [email protected]
Subject: Re: [AXIS2] - How to control "To" element in the SOAP header?


Erwin,

Don't be alarmed. There is no violation here. I think Vinh was just
trying to remind us that if To address is not there, it is a violation.
I don't think he complained Axis2 violates anything. We made Axis2 pass
all the interop tests within WS-Addressing working group and also in
other interop workshops. 

If some one things passing interop tests doesn't mean anything, then the
point is, WS-Addressing is with Axis2 for a long time and used by
numerous experts and within companies. So don't worry. WS-A is so
fundamental to message interactions that, If there is/was a problem, it
will be fixed pretty soon. 



On Thu, Jun 5, 2008 at 4:34 AM, Erwin Reinhoud <[EMAIL PROTECTED]>
wrote:


        Hello All,
         
        Could someone more specific state where it violates the
Ws-Addressing spec if you use a different value for epr (where you send
the message to) and the wsa to header?. I raised the question about
being able te seperate a WS-Aheader from where you actually want to send
the message a while back. The Axis2 1.3 version i used the wsa:to was
automaticvally used to route the message. Is it not the idea to have
seperate wsa headers, with possible contain logical values i.o. actual
endpoint urls of web services?
         
        Kind regards,
        Erwin

________________________________

        Van: Vinh Nguyen (vinguye2) [mailto:[EMAIL PROTECTED] 
        Verzonden: donderdag 5 juni 2008 8:22
        Aan: [email protected]
        Onderwerp: RE: [AXIS2] - How to control "To" element in the SOAP
header?
        
        
        Hi Eran,
         
        Actually, I think Axis2 is fine and is setting the wsa:To
properly.  It's Victor's createSOAPEnvelope() code that I believe is
wrong because it manually adds its own wsa:To element.  The end result
is a SOAP header with two wsa:To elements.  I don't believe this is
correct.
         
        So if I'm reading this right, Victor is asking for a solution
that will allow him to change/override the wsa:To value that Axis2 sets
there by default (from the EndpointReference).  I don't have the
solution, but I'm merely stating that even if there was, using that
solution to make wsa:To and EndpointReference.address be different
values...may end up in a message that's not WS-Addressing compliant.
Designs/implementations that do require non-compliant messages like this
probably needs to be re-evaluated closely:)
         
        -Vinh
         

________________________________

        From: Eran Chinthaka [mailto:[EMAIL PROTECTED] 
        Sent: Wednesday, June 04, 2008 9:23 PM
        To: [email protected]
        Subject: Re: [AXIS2] - How to control "To" element in the SOAP
header?
        
        
        Oh I see.Thanks Vinh for the update ;) Can you please help Axis2
to implement it properly to be WS-Addressing compliant ?
        
        
        
        
        On Wed, Jun 4, 2008 at 4:00 PM, Vinh Nguyen (vinguye2)
<[EMAIL PROTECTED]> wrote:
        

                Hi,
                The WS-Addressing spec states that the "address" value
of the EndpointReference should be copied into the "To" header.  If
implementations are doing otherwise, they are probably not WS-Addressing
compliant.
                 
                See Section 2.3 of the following link:
                http://www.w3.org/Submission/ws-addressing/
                 
                Hope this helps...
                -Vinh

________________________________

                From: Victor Solakhian [mailto:[EMAIL PROTECTED] 
                Sent: Wednesday, June 04, 2008 3:01 PM 
                
                To: [email protected]
                
                Subject: RE: [AXIS2] - How to control "To" element in
the SOAP header?
                
                

                Hi Chinthaka,

                 

                Actually createSOAPEnvelope() method is mine. It creates
an envelope that has "To" element in the header according to specs of
the Web Servcies server. The Axis2 code that sends the message adds
another "To" header block using the value that was set in
options.setTo() method.

                 

                The problem is that sometimes servers expect values in
the "To" element that differ from the value of the endpoint reference
used to send messages. I do not know if this is a bug in Axis2. I know
that some developers used Axis1 to successfully implement desired
behavior.

                 

                Thanks

                 

                
________________________________


                From: Eran Chinthaka [mailto:[EMAIL PROTECTED] 
                Sent: Wednesday, June 04, 2008 5:41 PM
                To: [email protected]
                Subject: Re: [AXIS2] - How to control "To" element in
the SOAP header?

                 

                Hi Victor,
                
                If createSOAPEnvelope() method adds wsa:To header, then
it is a bug, IMO. Please create a bug in JIRA and someone will look in
to this (but it might take some time for me to commit in to this :( )
                
                Thanks,
                Chinthaka

                On Wed, Jun 4, 2008 at 10:37 AM, Victor Solakhian
<[EMAIL PROTECTED]> wrote:

                I have code that creates a SOAP envelope and sends it
using Axis2 ServiceCLient.

                 

                        EndpointReference targetEPR = 

                        new EndpointReference("https://...";);

                 

                        String action = "...";        

                        client = new ServiceClient(ctx, null);

                        operationClient =
client.createClient(ServiceClient.ANON_OUT_IN_OP);

                 

                        MessageContext outMsgCtx = new MessageContext();

                        Options options = outMsgCtx.getOptions();

                        options.setTo(targetEPR);

        
options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);

                        options.setProperty(HTTPConstants.CHUNKED,
false);

                        options.setAction(action);

                        

        
outMsgCtx.setEnvelope(createSOAPEnvelope(operation, payload));

                        operationClient.addMessageContext(outMsgCtx);

                        operationClient.execute(true);

                 

                Now the createSOAPEnvelope(operation, payload)) method
creates an envelope with a header  that includes:

                 

                      <soapenv:Header>

                                        ...

                                        <wsa:To

        
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing";>

                                                    urn:xxx.yyy.com.zzz

                                        </wsa:To>

                 

                which is expected by the web services server, but Axis2
code adds another To" element:

                 

                                        <wsa:To>

                                                    https://...

                                        </wsa:To>

                 

                to the header (using the endpoint reference set by
options.setTo(targetEPR)).

                 

                We need to set the targetEPR to  the options so that
messages are sent to the right place, but we need to have control on
what is put in the header.

                 

                Is there a way to avoid adding the targetEPR to the
header?

                 

                Thanks,

                 

                Victor

                
                
                
                -- 
                With Mettha,
                Eran Chinthaka
                
        
--------------------------------------------------------------------
                Health is the greatest gift; contentment is the greatest
wealth; trusting is the best relationship; nirvana is the highest joy. -
Dhammapada 




        -- 
        With Mettha,
        Eran Chinthaka
        
        
--------------------------------------------------------------------
        Health is the greatest gift; contentment is the greatest wealth;
trusting is the best relationship; nirvana is the highest joy. -
Dhammapada 




-- 
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth;
trusting is the best relationship; nirvana is the highest joy. -
Dhammapada 

Reply via email to