You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Marcos <ma...@globalred.com> on 2006/11/09 14:21:31 UTC

XFire Web Service and Axis Client

Hello,

I'm trying to implement a client with Axis for a web service implemented
with XFire. I generate service stubs with any problem and I can login
and call most of the web services but I'm having problems with those
that use XFire cookie based session management.

I need to propagate a remote session id that comes as a cookie on the
HTTP Headers of the response of the login request.

I can access this session id by using the following code:

MimeHeaders headers = stub._getCall().getResponseMessage().getMimeHeaders();
String remoteSessionId = headers.getHeader("set-cookie")[0];

I don't like it but it works, the problem is I haven't found a way to
add this HTTP header to the next request.

I've tried:

MimeHeaders headers = ((Stub) port)._getCall().getMessageContext().getRequestMessage().getMimeHeaders();
headers.setHeader("set-cookie", account.getRemoteSessionId());

But the stub creates and invokes the _call object and I can't add
headers to it without modifying the stub. I tried changing _getCall for
_createCall but this doesn't work.

Any help would be appreciated.

Thanks and best regards,
Marcos


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: XFire Web Service and Axis Client

Posted by Davanum Srinivas <da...@gmail.com>.
Don't use the mime headers, you can set up parameters in the options

http://www.wso2.net/articles/axis2/java/2006/08/01/client-api-parameters

-- dims

On 11/9/06, Marcos <ma...@globalred.com> wrote:
> Hello,
>
> I'm trying to implement a client with Axis for a web service implemented
> with XFire. I generate service stubs with any problem and I can login
> and call most of the web services but I'm having problems with those
> that use XFire cookie based session management.
>
> I need to propagate a remote session id that comes as a cookie on the
> HTTP Headers of the response of the login request.
>
> I can access this session id by using the following code:
>
> MimeHeaders headers = stub._getCall().getResponseMessage().getMimeHeaders();
> String remoteSessionId = headers.getHeader("set-cookie")[0];
>
> I don't like it but it works, the problem is I haven't found a way to
> add this HTTP header to the next request.
>
> I've tried:
>
> MimeHeaders headers = ((Stub) port)._getCall().getMessageContext().getRequestMessage().getMimeHeaders();
> headers.setHeader("set-cookie", account.getRemoteSessionId());
>
> But the stub creates and invokes the _call object and I can't add
> headers to it without modifying the stub. I tried changing _getCall for
> _createCall but this doesn't work.
>
> Any help would be appreciated.
>
> Thanks and best regards,
> Marcos
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org