Re: Inserting a SOAP Header in a client request
From: john deviney (johndeviney_at_discussions.microsoft.com)
Date: 01/13/05
- Next message: jimp_at_aig: "Social Security Web Service"
- Previous message: Adrian Burka: "Problem with Exception Handling using Web Services"
- In reply to: Dilip Krishnan: "Re: Inserting a SOAP Header in a client request"
- Next in thread: john deviney: "Re: Inserting a SOAP Header in a client request"
- Reply: john deviney: "Re: Inserting a SOAP Header in a client request"
- Reply: Dilip Krishnan: "Re: Inserting a SOAP Header in a client request"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 Jan 2005 10:59:02 -0800
Sorry if my original post was not clear. Let me clarify the options I was
exploring:
Option 1: custom SoapHeader and modify the ws client proxy by hand to
reference the new SoapHeader..
Option 2: custom SoapExtension and modify the stream by hand via
ChainStream().
Option 3: custom Soap Extension and SoapHeader and modify the SoapMessage
via ProcessMessage().
So, it sounds like option 3 is not really an option. Option 2 means working
with a byte stream instead of a Soap API. ChainStream() is the only place we
can modify the message before serialization? I guess I'm still not quite
clear on the distinction between ChainStream() and ProcessMessage().
Given that this is all in the context of a web service request, I shouldn't
have to work at the byte level to add a soap header to a soap message. I
imagine the Stream could somehow be converted to a SoapMessage before adding
the soap header but that would be inefficient given that it will be converted
into a SoapMessage later in the call chain.
WSE is something I will explore but for the time being this is what I am
working with. I need to research Axis 1.1 support of WS-Security and compare
it to .Net.
The server side of this solution already exists and works for a different
client implementation.
Clean insertion of a custom soap header on the client side should be
relatively painless. This is how it's done in Axis (Java):
// setup authorization header
SOAPHeaderElement authHeader = new SOAPHeaderElement( "",
"AuthHeader" );
MessageElement usernameElement = ( MessageElement )
authHeader.addChildElement( "UserName" );
MessageElement passwordElement = ( MessageElement )
authHeader.addChildElement( "Password" );
usernameElement.setObjectValue("jdoe");
passwordElement.setObjectValue("password");
call.addHeader( authHeader );
John
"Dilip Krishnan" wrote:
> Hello john,
> I dont see the difference in what you call the second option and the
> third option. What you seem to be missing is overriding the chain stream
> and writing to the stream (which I gather you dont wish to do). The problem
> with your code is .. yes you're using the soap object model to add the header
> but you've failed to modify the stream by writing that information back into
> the stream. Also have you considered using WSE? and also are you sure the
> java service is not using WS-Security? If it is, you would need to send standard
> username tokens as opposed to a custom auth header
>
> HTH
> Regards,
> Dilip Krishnan
> MCAD, MCSD.net
> dkrishnan at geniant dot com
> http://www.geniant.com
>
- Next message: jimp_at_aig: "Social Security Web Service"
- Previous message: Adrian Burka: "Problem with Exception Handling using Web Services"
- In reply to: Dilip Krishnan: "Re: Inserting a SOAP Header in a client request"
- Next in thread: john deviney: "Re: Inserting a SOAP Header in a client request"
- Reply: john deviney: "Re: Inserting a SOAP Header in a client request"
- Reply: Dilip Krishnan: "Re: Inserting a SOAP Header in a client request"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|