To clarify. What I want to do in Axis 2 was accomplished in Axis 1 by
going the following: I need to create a signle cookie string and I need
to create a configuration to use XMLStringProvider below.
Thanks in advance.
/* change the cookie
passing mechanisam of axis from
Cookie: a=a1
Cookie: b=b2
Cookie: c=c3
to
Cookie: a=a1;b=b2;c=c3
*/
DefaultHttpParams.getDefaultParams().setBooleanParameter(
HttpMethodParams.SINGLE_COOKIE_HEADER,true);
//Create a custom engine configuration
for the custom cilent-wsdd file
EngineConfiguration e =
getEngineConfiguration();
// get the panel data service locator
locator = new ProjectDataLocator(e);
locator.setProjectDataSoapEndpointAddress("http://efm.activant.com/ws/pr
ojectdata.asmx");
// maintain the session
locator.setMaintainSession(true);
//create the service for the paneldata
pdService =
locator.getProjectDataSoap();
//set the session properties on service
level
((Stub)
pdService).setMaintainSession(true);
((Stub)
pdService)._setProperty(Call.SESSION_MAINTAIN_PROPERTY, new
Boolean(true));
// method to set the custom engine configuration for axis
protected org.apache.axis.EngineConfiguration
getEngineConfiguration()
{
java.lang.StringBuffer sb = new
java.lang.StringBuffer();
sb.append("<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\r\n");
sb.append("<deployment
name=\"defaultClientConfig\"\r\n");
sb.append("xmlns=\"http://xml.apache.org/axis/wsdd/\"\r\n");
sb.append("xmlns:java=\"http://xml.apache.org/axis/wsdd/providers/java\"
>\r\n");
sb.append("<transport name=\"http\"
pivot=\"java:org.apache.axis.transport.http.CommonsHTTPSender\"
/>\r\n");
sb.append("<transport name=\"local\"
pivot=\"java:org.apache.axis.transport.local.LocalSender\" />\r\n");
sb.append("<transport name=\"java\"
pivot=\"java:org.apache.axis.transport.java.JavaSender\" />\r\n");
sb.append("</deployment>\r\n");
org.apache.axis.configuration.XMLStringProvider
config =
new
org.apache.axis.configuration.XMLStringProvider(sb.toString());
return config;
}
-----Original Message-----
From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED]
Sent: Friday, September 05, 2008 10:09 AM
To: [email protected]
Subject: Re: Axis 2 manage session not working - Cookies and axis not
working
hehe , no worries . If you get that working then thats what we want.
Thank you!
Deepal
Deborah Wus wrote:
> Actually thank you very much I think I was identifying the wrong
> variable. When I changed the custom cookie to ASP.NET_Ses, it does
work!
> Thank you all very much.
>
>
------------------------------------------------------------------------
> *From:* Deborah Wus [mailto:[EMAIL PROTECTED]
> *Sent:* Friday, September 05, 2008 9:37 AM
> *To:* [email protected]
> *Subject:* RE: Axis 2 manage session not working - Cookies and axis
> not working
>
> HTTP/1.1 200 OK
> Date: Fri, 05 Sep 2008 13:34:35 GMT
> Server: Microsoft-IIS/6.0
> X-Powered-By: ASP.NET
> X-AspNet-Version: 2.0.50727
> Set-Cookie: ASP.NET_SessionId=jmjmsh45enh2d5553vflpfbl; path=/;
HttpOnly
> Cache-Control: private, max-age=0
> Content-Type: application/soap+xml; charset=utf-8
> Content-Length: 328
> Set-Cookie: NSC_fgn_ns_bqq=ac10005a0050;path=/
> <?xml version="1.0" encoding="utf-8"?><soap:Envelope
> xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><LoginResponse
>
<http://www.w3.org/2001/XMLSchema%22%3E%3Csoap:Body%3E%3CLoginResponse>
> xmlns="http://www.perseus.com/Pdc.WS"><LoginResult
> <http://www.perseus.com/Pdc.WS%22%3E%3CLoginResult>
> /></LoginResponse></soap:Body></soap:Envelope>
> Thank you so much for your help and guidance - I am completely new to
> webservices. Let me know if I sent the correct portion.
>
>
------------------------------------------------------------------------
> *From:* keith chapman [mailto:[EMAIL PROTECTED]
> *Sent:* Thursday, September 04, 2008 11:57 PM
> *To:* [email protected]
> *Subject:* Re: Axis 2 manage session not working - Cookies and axis
> not working
>
> You can use TCPMotitor [1] to trace the SOAP messages
>
<http://www.keith-chapman.org/2008/07/using-tcp-monitor-to-debug-web-ser
vice.html>.
>
> Thanks,
> Keith.
>
> [1]
>
http://www.keith-chapman.org/2008/07/using-tcp-monitor-to-debug-web-serv
ice.html
>
> On Fri, Sep 5, 2008 at 6:28 AM, Deepal Jayasinghe
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
>
> can you please paste the HTTP header of the messages I mean HTTP
> header
> of the response and the second request.
>
> Deborah Wus wrote:
> > That did not work either. I also tried setting the
customCookieId
> > before maintiaining the sessions as I saw listed elsewhere.
> >
> > options.setProperty("customCookieID" ,"NSC_fgn_ns_bqq");
> > But that also did not work.
> >
> >
>
------------------------------------------------------------------------
> > *From:* keith chapman [mailto:[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>]
> > *Sent:* Thursday, September 04, 2008 12:47 PM
> > *To:* [email protected] <mailto:[email protected]>
> > *Subject:* Re: Axis 2 manage session not working - Cookies and
axis
> > not working
> >
> > Hi,
> >
> > Can you try using
> > _stub._getServiceClient().getOptions.setManageSession(true);
> instead.
> > We use transport session a lot in our projects and it works.
> >
> > Thanks,
> > Keith.
> >
> > On Thu, Sep 4, 2008 at 9:11 PM, Deborah Wus
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > <mailto:[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>>> wrote:
> >
> > I attempted to do this in Axis 2 to see if solved the problem I
> > was having, but I am still receiving an invalid access, meaning
> > that the session cookies are not being handled. Any calls which
> > require a login are failing although the login itself is
succeeding.
> > Ping does not required a login. GetProfileList does required a
> > login. Ping receives an ACK, Login succeeds. GetProfileList
> > returns an Invalid Access error. Support from the third party
who
> > created the service said if I am using .NET I should set the
> > CookieContainer. They have no input so far for Axis or Axis 2.
> > Any help would be appreciated.
> > package com.p21.test.web;
> > import java.rmi.RemoteException;
> > import org.apache.axis2.AxisFault;
> > import org.apache.axis2.client.Options;
> > import org.apache.axis2.client.ServiceClient;
> > import junit.framework.TestCase;
> > import com.perseus.www.pdc_ws.ProjectDataStub;
> > public class WSTest extends TestCase {
> >
> > public void testLogin() {
> > try {
> > Options options = new Options();
> > options.setManageSession(true);
> > ProjectDataStub _stub = new
> > ProjectDataStub("http://efm.activant.com/ws/projectdata.asmx");
> > ServiceClient sender = _stub._getServiceClient();
> > sender.setOverrideOptions(options);
> >
> > ProjectDataStub.Ping ping = new ProjectDataStub.Ping();
> > ProjectDataStub.PingResponse res;
> > ProjectDataStub.LoginResponse loginResponse;
> > ProjectDataStub.Login login = new ProjectDataStub.Login();
> >
> > ProjectDataStub.GetProfileListResponse gres;
> > ProjectDataStub.GetProfileList glist = new
> > ProjectDataStub.GetProfileList();
> >
> > login.setUserName("username");
> > login.setPassword("password");
> >
> >
> > try {
> > res = _stub.Ping(ping);
> > System.out.println(res.getPingResult());
> >
> > loginResponse = _stub.Login(login);
> > System.out.println(loginResponse.getLoginResult());
> >
> > gres = _stub.GetProfileList(glist);
> > System.out.println(gres.getGetProfileListResult());
> >
> >
> > } catch (RemoteException e1) {
> > // TODO Auto-generated catch block
> > e1.printStackTrace();
> > }
> >
> > } catch (AxisFault e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > }
> > }
> >
> > _________________________________
> > *Deborah Wus*
> > Senior Development Engineer
> > Wholesale Distribution Group
> >
> > *Activant Solutions Inc.(tm)*
> > 19 W. College Ave.
> > Yardley, PA 19067
> > *T:* 215.493.8900 x6725
> > E-mail: [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
> > Web site: _www.activant.com_ <http://www.activant.com/>
> > _________________________________
> >
> >
> >
> >
> > --
> > Keith Chapman
> > Senior Software Engineer
> > WSO2 Inc.
> > Oxygenating the Web Service Platform.
> > http://wso2.org/
> >
> > blog: http://www.keith-chapman.org
>
> --
> Thanks,
> Deepal
> ................................................................
> http://blogs.deepal.org/
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>
>
>
>
> --
> Keith Chapman
> Senior Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://www.keith-chapman.org
--
Thanks,
Deepal
................................................................
http://blogs.deepal.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]