axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eran Chinthaka <chinth...@opensource.lk>
Subject Re: [Axis2]MessageContext
Date Tue, 24 Oct 2006 04:31:12 GMT
Options you set to message context in the client side will not be
available to you in the server side. But if you can get hold to some of
the HTTP transport properties, by retrieving them from the options.

If you wanna send some props from client side, you might wanna consider
putting them as headers in the request SOAP message.

-- Chinthaka

Smirnova, Natalya wrote:
> Hi, 
> Thank you for your advance. 
> But my MessageContext in my handler is still empty :-(. 
> I simple add some property to Options object on client side, set this
> option to sender and send.
> MessageContext does not contain my property. 
> 
> 
> Best regards,Natalya Smirnova.
> MERA NN /EMA/custom software
> 
> 
> -----Original Message-----
> From: robert lazarski [mailto:robertlazarski@gmail.com] 
> Sent: Saturday, October 21, 2006 12:21 AM
> To: axis-user@ws.apache.org
> Subject: Re: [Axis2]MessageContext
> 
> First of all, try a nightly as the new release is almost ready, as
> there were problems here since fixed:
> 
> http://people.apache.org/dist/axis2/nightly/axis2-1.1-SNAPSHOT.war
> http://people.apache.org/dist/axis2/nightly/axis2-1.1-SNAPSHOT.zip
> 
> Looks like the current way the client sends out basic auth info is the
> following - change to match your env:
> 
> OMElement payload = TestingUtils.createDummyOMElement();
>         /**
>          * Proxy setting in runtime
>          */
>         HttpTransportProperties.ProxyProperties proxyproperties = new
> HttpTransportProperties.ProxyProperties();
>         proxyproperties.setProxyName("localhost");
>         proxyproperties.setProxyPort(5555);
>         proxyproperties.setDomain("anonymous");
>         proxyproperties.setPassWord("anonymous");
>         proxyproperties.setUserName("anonymous");
> 
>         Options options = new Options();
>         options.setProperty(HTTPConstants.PROXY, proxyproperties);
>         options.setTo(targetEPR);
>         options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>         ServiceClient sender = new ServiceClient();
>         sender.setOptions(options);
> 
>         OMElement result = sender.sendReceive(payload);
> 
> Since these params are probably in the http headers, you'll probably
> need a handler to access them. The following code example is from axis
> 1.x but is close enough to start with -
> HTTPConstants.HEADER_AUTHORIZATION is still there, for example:
> 
> http://koders.com/java/fidDCB769581B5FB55A16B0B191DEB229F79B8CB9E2.aspx
> 
> See the migration guide for getting the above handler to work in axis2:
> 
> http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/xdocs/1_1/m
> igration.html
> 
> HTH,
> Robert
> 
> On 10/20/06, Smirnova, Natalya <nsmirn@mera.ru> wrote:
>>
>>
>>
>> Hi,
>>
>>
>>
>> How I can get user name and password from MessageContext class object?
>>
>> I use Axis2 release 1.0.  I write custom module and handler. It work
>> correctly.
>>
>> On client side I set username and password into options properties and
> send.
>>
>>
>> Options options = new Options();
>>
>> options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>>
>>
>>
>>             HttpTransportProperties.ProxyProperties
>> basicAuthentication = new HttpTransportProperties().new
> ProxyProperties();
>>             basicAuthentication.setUserName("admin");
>>
>>             basicAuthentication.setPassWord("axis2");
>>
>>
>>
> options.setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY,
>> basicAuthentication);
>>
>>             options.setTo(targetEPR);
>>
>>
>>
>>             ServiceClient serviceClient = new ServiceClient();
>>
>>             serviceClient.setOptions(options);
>>
>>
>>
>>
>>
>>
>>
>> But on service side in handler my message context is empty.
>>
>>
>>
>> Thank you
>>
>>
>>
>>
>>
>> Best regards,Natalya Smirnova.
>>
>> MERA NN /EMA/custom software
>>
>>
> 
> ---------------------------------------------------------------------
> 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
> 
> 



Mime
View raw message