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 esu2 <jo...@hotmail.com> on 2009/03/08 01:42:17 UTC
set "http.protocol.single-cookie-header" in Axis2
Axis2 using HTTPClient as it underline http channel.
In HTTPClient, I was able to set "http.protocol.single-cookie-header" as
parameter.
I think Axis2 using Options to set parameter, could someone give me an
example code to set this property to underline HTTP through Axis2 API?
Thanks
--
View this message in context: http://www.nabble.com/set-%22http.protocol.single-cookie-header%22-in-Axis2-tp22393645p22393645.html
Sent from the Axis - User mailing list archive at Nabble.com.
Re: set "http.protocol.single-cookie-header" in Axis2
Posted by esu2 <jo...@hotmail.com>.
BWT, do you know any server side setting affect this?
Beacuse my application is working with one of server(A) even without cookie
policy and this SINGLE_COOKIE_HEADER setting, but not working in another
one(B).
I think one of work around to my problem is change server setting to support
without this setting, but I'm not able to find out what difference between
server A and B (they suppose to be same). Web server is Apache.
Thanks
--
View this message in context: http://www.nabble.com/set-%22http.protocol.single-cookie-header%22-in-Axis2-tp22393645p22398211.html
Sent from the Axis - User mailing list archive at Nabble.com.
Re: set "http.protocol.single-cookie-header" in Axis2
Posted by esu2 <jo...@hotmail.com>.
Haha, thank you for confirmation.
No wonder why all of others options parameter I can see in HTTPClient sender
except this one.
With this confirmation, I think I can stop my debugging and start a issue
requesting.
Thanks
--
View this message in context: http://www.nabble.com/set-%22http.protocol.single-cookie-header%22-in-Axis2-tp22393645p22398047.html
Sent from the Axis - User mailing list archive at Nabble.com.
Re: set "http.protocol.single-cookie-header" in Axis2
Posted by keith chapman <ke...@gmail.com>.
No I dont think we support that parameter. Although you set it into the
options object it is not set into HTTPClient at the sender. You may have to
raise this issue requesting for it as a new feature to Axis2.
Thanks,
Keith.
On Sun, Mar 8, 2009 at 6:44 PM, esu2 <jo...@hotmail.com> wrote:
>
> Thank you.
> Sorry I guess my question was not clear.
>
> I was looking for how to set cookie attribut in a web service call.
>
> The example you provided demostrated how to set cookie when request a web
> page.
> I thought when calling a web service, we call a client service:
>
> ServiceClient sc = service._getServiceClient();
> then, acquire a "options" object from service:
> Options options = sc.getOptions();
>
> the attributs set in options:
> options.setManageSession(true);
>
> options.setProperty(HTTPConstants.COOKIE_POLICY,CookiePolicy.BROWSER_COMPATIBILITY);
> ...
> However, if I use the same way to set SINGLE_COOKIE_HEADER, it seems not
> working:
> options.setProperty(HttpMethodParams.SINGLE_COOKIE_HEADER,Boolean.TRUE);
>
> any idea?
>
> Thanks
> --
> View this message in context:
> http://www.nabble.com/set-%22http.protocol.single-cookie-header%22-in-Axis2-tp22393645p22397812.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
--
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
blog: http://www.keith-chapman.org
RE: set "http.protocol.single-cookie-header" in Axis2
Posted by esu2 <jo...@hotmail.com>.
Thank you.
Sorry I guess my question was not clear.
I was looking for how to set cookie attribut in a web service call.
The example you provided demostrated how to set cookie when request a web
page.
I thought when calling a web service, we call a client service:
ServiceClient sc = service._getServiceClient();
then, acquire a "options" object from service:
Options options = sc.getOptions();
the attributs set in options:
options.setManageSession(true);
options.setProperty(HTTPConstants.COOKIE_POLICY,CookiePolicy.BROWSER_COMPATIBILITY);
...
However, if I use the same way to set SINGLE_COOKIE_HEADER, it seems not
working:
options.setProperty(HttpMethodParams.SINGLE_COOKIE_HEADER,Boolean.TRUE);
any idea?
Thanks
--
View this message in context: http://www.nabble.com/set-%22http.protocol.single-cookie-header%22-in-Axis2-tp22393645p22397812.html
Sent from the Axis - User mailing list archive at Nabble.com.
RE: set "http.protocol.single-cookie-header" in Axis2
Posted by Martin Gainty <mg...@hotmail.com>.
There is an example of using HttpMethodParams in org.apache.axis2.saaj.SOAPConnectionTest.java
private boolean isNetworkedResourceAvailable(String url) {
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
client.getHttpConnectionManager().getParams().setConnectionTimeout(1000);
method.getParams().setParameter(HttpMethodParams.SINGLE_COOKIE_HEADER,
new DefaultHttpMethodRetryHandler(1, false));
try {
int statusCode = client.executeMethod(method);
if (statusCode != HttpStatus.SC_OK) {
return false;
}
} catch (HttpException e) {
e.printStackTrace();
return false;
} catch (IOException e) {
e.printStackTrace();
return false;
} finally {
method.releaseConnection();
}
return true;
}
HTH
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.
> Date: Sat, 7 Mar 2009 16:42:17 -0800
> From: johnzhang618@hotmail.com
> To: axis-user@ws.apache.org
> Subject: set "http.protocol.single-cookie-header" in Axis2
>
>
> Axis2 using HTTPClient as it underline http channel.
>
> In HTTPClient, I was able to set "http.protocol.single-cookie-header" as
> parameter.
>
> I think Axis2 using Options to set parameter, could someone give me an
> example code to set this property to underline HTTP through Axis2 API?
>
> Thanks
> --
> View this message in context: http://www.nabble.com/set-%22http.protocol.single-cookie-header%22-in-Axis2-tp22393645p22393645.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
_________________________________________________________________
Windows Live⢠Groups: Create an online spot for your favorite groups to meet.
http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009