I've been digging through the mailing list and have not figured out how to make this work. What did I do wrong? I'm running X-fire 1.2 and embedded jetty 5.10, java 1.5.8, client is dotnet 2.0
I want to be able to remove the sessionid that I have to pass to all my web methods. So I thought I could use the session object and store something there. I did this for my service.xml <beans xmlns="http://xfire.codehaus.org/config/1.0"> <service> <name>MyService</name> <namespace>http://www.netiq.com</namespace> <serviceClass>com.ws.MyService</serviceClass> <scope>session</scope> </service> </beans> And my logon method has this in it. Logon() { String mySession = getSession(); XFireServletController.getRequest().getSession().setAttribute("CoreSessi on", mySession); } Then any call I make to it I could just do this. (mySession is always null) Void anycall() { String mySession = XFireServletController.getRequest().getSession().getAttribute("CoreSessi on")); if (valid(mySession)) { // do something useful } } Thanks! -----Original Message----- From: Dan Diephouse [mailto:[EMAIL PROTECTED] Sent: Friday, September 29, 2006 12:52 PM To: [email protected] Subject: Re: [xfire-user] Session Management Issue Hi David, Just so you know you can get access to the message context easily enough: http://xfire.codehaus.org/MessageContext I'm not sure whats going on with the your service not actually being session scoped though. Please file a JIRA so we can make sure this is actually working! - Dan David Boyer wrote: > What I will do if I have to is write a header and add a param to every > function call with a "session_id" as a header style @WebParam which I > use to manage a session container myself. I had to do something like > this in Axis2. However, there are explicit statements in the xfire > services.xml documentation about the behavior of the scope variable. > My testing today has shown me that simply setting that variable to > application, request, or session has absolutely no impact on how my > DoorsService is instantiated, indicating to me that the > "SessionFactory" needs some additional configuration to get this to > work, what this is I don't know. > > The other option would be to have access directly to the HttpSession > through something like the MessageContext. > > So to summarize in order of preference the solutions are: > > 1. Additional configuration settings for services.xml to make the > scope setting work > 2. A means of accessing the HttpSession (probably through the > MessageContext) > 3. Homegrown session using a Header Web Param, and a static HashMap > in my service. > > I'll address this issue late tomorrow night using option 3 unless I > can get some guidance on options 1 or 2 > > ----------------------------------------------------------------- > > David S. Boyer > > Sr. S/W Developer > > Telelogic North America > > Business: +1 (703) 944-9289 > > Mobile: +1 (703) 944-9289 > > mailto:[EMAIL PROTECTED] > > ----------------------------------------------------------------- > > Telelogic - Requirements Driven Innovation > > ---------------------------------------------------------------------- > -- > > *From:* Andres Bernasconi [mailto:[EMAIL PROTECTED] > *Sent:* Thursday, September 28, 2006 11:31 AM > *To:* [email protected] > *Subject:* Re: [xfire-user] Session Management Issue > > If you need a workaround maybe you can send the user/pass information > on every call... just a thought (you have more complex solutions > around this as well but just so you know other ways of working around > that.) > > On 9/28/06, *David Boyer* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Anyone using scope="session" successfully? I need to understand this, > and quickly. I've got 2 days to finish a rewrite of an existing > service on axis2 in xfire. J > > I spent Monday and Tuesday mornings realizing that their fault > implementation was completely broken. Tuesday afternoon and Wednesday > were spent spiking a solution in XFire. I've decided to generate the > wsdl, generate jaxb from xsd, and to use session scope to manage > login, logout calls around a batch of service calls. Without either > access to the HttpSession or access to a unique DoorsService object > per "HttpSession", I'm screwed L . I can think of ways to work around > it, but not with the time I have left. > > Thanks, > > ----------------------------------------------------------------- > > David S. Boyer > > Sr. S/W Developer > > Telelogic North America > > Business: +1 (703) 944-9289 > > Mobile: +1 (703) 944-9289 > > mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > ----------------------------------------------------------------- > > Telelogic - Requirements Driven Innovation > > ---------------------------------------------------------------------- > -- > > *From:* David Boyer [mailto:[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>] > *Sent:* Thursday, September 28, 2006 2:57 AM > *To:* [email protected] <mailto:[email protected]> > *Subject:* [xfire-user] Session Management Issue > > I have a WebService class and a services.xml class, and the service is > executing properly. However, I need my service class to be session > scoped. My expectation was that if I either, use a different client or > rerun a testing application, it would result in receiving a new > session and thus a new version of my Service Implementation class. > It's not working that way, what am I doing wrong? Or do I > misunderstand the scope setting in services.xml? > > 1. *Services.xml* > > <beans xmlns= "http://xfire.codehaus.org/config/1.0" > > > <bean id ="doorsService" class= > "com.telelogic.doors.xt.ws.DoorsServiceImpl"/> > > <bean name ="jaxbServiceFactory" class= > "org.codehaus.xfire.jaxb2.JaxbServiceFactory"> > > <constructor-arg ref ="xfire.transportManager" /> > > </bean> > > <service> > > <serviceBean>#doorsService </serviceBean> > > <serviceFactory>#jaxbServiceFactory </serviceFactory> > > <schemas> > > <schema> META-INF/xfire/DoorsXT.xsd</schema> > > </schemas> > > <style>document </style> > > <scope>session </scope> > > </service> > > </beans> > > 2. *My DoorsService.java file (relevant portion only?)* > > * * > > @WebService (endpointInterface = > "com.telelogic.doors.xt.ws.DoorsService" , serviceName = > "DoorsService" ) > > @SOAPBinding (parameterStyle = SOAPBinding .ParameterStyle./BARE/ ) > > *public* *class* DoorsServiceImpl *implements* DoorsService > > { > > *public* *static* *final* String /WEBSVC_NS/ = > "http://www.telelogic.com/doors/xt/ws" ; > > *public* *static* *final* String /SCHEMA_NS/ = > "http://www.telelogic.com/doors/xt/ws/schema" ; > > *private* *boolean* session_on = *false*; > > *public* LoginResponse login(LoginRequest login_request) *throws* > DoorsServiceFault_Exception > > { > > String url = login_request.getUrl(); > > String uname = login_request.getUsername(); > > String pword = login_request.getPassword(); > > System./out/ .println("Url: " + url); > > System./out/ .println("Username: " + uname); > > System./ out/.println( "Password: " + pword); > > System./ out/.println( "Session: " + session_on); > > *if* (! session_on) session_on = *true*; > > *if* (url == *null* || uname == *null* || pword == *null*) > > { > > *throw* *new* DoorsServiceFault_Exception( "Login Error!",getFault( > "Login requires a url, username and password!")); > > } > > LoginResponse result = *new* LoginResponse(); > > result.setSuccess(* true*); > > *return* result; > > } > > } > > * * > > *So basically, the first time a DoorsService object has login invoked, > it prints the "service_on" variable as false, every new call to the > same object will report true from now on.* > > *I didn't expect that, I expected to get false each time I reconnected > with a new client * > > * * > > * 1. Using ruby, I create client/server stub code, and use the client > to attach to a server.* > > a. *Using soap4r (ruby) I login 2x through one Service object (a > proxy)* > > b. *First Run Output: Session: false* > > c. *Second Run Output: Session: true* > > d. *Good, that's expected behavior* > > 3. *New unit test, in same ruby test script:* > > a. *Create new service connection (via setup call)* > > b. *Login* > > c. *Output Session: true* > > d. *Expected Output: false (shouldn't a new service connection mean > new service object)* > > 4. *Using oXygen XML WSDL SOAP Analyzer* > > a. *Perform login* > > b. *Expected Output: Session: false (new connection)* > > c. *Actual Output: Session: true (should have been a new service > object)* > > * * > > ----------------------------------------------------------------- > > David S. Boyer > > Sr. S/W Developer > > Telelogic North America > > Business: +1 (703) 944-9289 > > Mobile: +1 (703) 944-9289 > > mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > ----------------------------------------------------------------- > > Telelogic - Requirements Driven Innovation > > ---------------------------------------------------------------------- > ---------- > > **Innovation 2006 - Telelogic User Group Conference*** **/Where can > innovation take you?/** **Learn more at: > *****http://www.telelogic.com/company/events/usergroup**/ > <http://www.telelogic.com/company/events/usergroup/> > > > > David Boyer > Sr. Software Developer > Telelogic North America Inc. > 2711 Crab Apple Ct. > Woodbridge > VA 22192 > United States > > Phone: +1 (703) 349 6790 > Fax: > Mobile phone: +1 (703) 944-9289 > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > http://www.telelogic.com <http://www.telelogic.com/> > > *Telelogic - Requirements-Driven Innovation! > **-------------------------------------------------------------** * > > The information contained in this e-mail, including any attachment or > enclosure, is intended only for the person or entity to which it is > addressed and may contain confidential material. Any unauthorized use, > review, retransmissions, dissemination, copying or other use of this > information by persons or entities other than the intended recipient > is prohibited. > -- Dan Diephouse (616) 971-2053 Envoi Solutions LLC http://netzooid.com --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
