WEB Service Session - Login
Hello Experts,
I have to consume a BOBJ Web Service Session in SAP Netweawer.
Hello,
We have SAP NetWeaver 2004s and BusinessObjects Enterprise 12.0.
I've created an proxy object on the SAP Netweaver side in the following way :
se80->Create->Enterprice Service->Service-Consumer->URL/HTTP Destination-> URL = http://<host>:8080/dswsbobje/services/Session?wsdl
Then I've created an Port using soamanager.
I't seems to be working, becouse methods like : getServerInfo, getServerInfoDetails are working ok.
Now I have a problem with the method Login. As parameter for this method I see only structure CREDENTIAL, which have only one field CONTROLLER (PRXCTRLTAB).
I've expected to have in the Parameters for this method a structure EnterpriceCredential with fields like username, password and so on - but its not.
Could You help me ?
Greetings
Wojciech
Here my coding :
REPORT ztest.
DATA text TYPE string.
DATA : lr_proxy TYPE REF TO zsco_session_port. " its my session proxy object
DATA : oref TYPE REF TO cx_root.
TRY.
CREATE OBJECT lr_proxy
EXPORTING
logical_port_name = 'LP1'.
CATCH cx_ai_system_fault INTO oref.
text = oref->get_text( ).
ENDTRY.
DATA get_server_info_in TYPE zsget_server_info_soap_in.
DATA get_server_info_out TYPE zsget_server_info_soap_out.
THIS IS WORKING WELL
TRY.
CALL METHOD lr_proxy->get_server_info
EXPORTING
input = get_server_info_in
IMPORTING
output = get_server_info_out.
CATCH cx_ai_system_fault INTO oref..
CATCH zscx_dswsexception INTO oref..
CATCH cx_ai_application_fault INTO oref..
ENDTRY.
break-point.
AND THIS IS ENDINNG WITH EXCEPTION
TRY.
CALL METHOD lr_proxy->login
EXPORTING
input = login_in
IMPORTING
output = login_out.
CATCH cx_ai_system_fault INTO oref.
text = oref->get_text( ).
_ CATCH zscx_dswsexception INTO oref. this exeption is being called_
text = oref->get_text( ).
CATCH cx_ai_application_fault INTO oref.
text = oref->get_text( ).
ENDTRY.
Hello,
I struggle with exactly the same problem accessing the login webservice of the BOE server. Unfortunately the previous answer did not help me since I don't understand it
Anyone able to enlighten me?
Edit: Nevermind, I just found out by myself.
Thanks,
Sebastian
Edited by: Sebastian Solzbacher on Nov 25, 2011 9:43 AM
Similar Messages
-
BOBJ WEB Service Session - Login
Hello Experts,
I have to consume a BOBJ Web Service Session in SAP Netweawer.
Hello,
We have SAP NetWeaver 2004s and BusinessObjects Enterprise 12.0.
I've created an proxy object on the SAP Netweaver side in the following way :
se80->Create->Enterprice Service->Service-Consumer->URL/HTTP Destination-> URL = http://<host>:8080/dswsbobje/services/Session?wsdl
Then I've created an Port using soamanager.
I't seems to be working, becouse methods like : getServerInfo, getServerInfoDetails are working ok.
Now I have a problem with the method Login. As parameter for this method I see only structure CREDENTIAL, which have only one field CONTROLLER (PRXCTRLTAB).
I've expected to have in the Parameters for this method a structure EnterpriceCredential with fields like username, password and so on - but its not.
Could You help me ?
Greetings
Wojciech
Here my coding :
REPORT ztest.
DATA text TYPE string.
DATA : lr_proxy TYPE REF TO zsco_session_port. " its my session proxy object
DATA : oref TYPE REF TO cx_root.
TRY.
CREATE OBJECT lr_proxy
EXPORTING
logical_port_name = 'LP1'.
CATCH cx_ai_system_fault INTO oref.
text = oref->get_text( ).
ENDTRY.
DATA get_server_info_in TYPE zsget_server_info_soap_in.
DATA get_server_info_out TYPE zsget_server_info_soap_out.
THIS IS WORKING WELL
TRY.
CALL METHOD lr_proxy->get_server_info
EXPORTING
input = get_server_info_in
IMPORTING
output = get_server_info_out.
CATCH cx_ai_system_fault INTO oref..
CATCH zscx_dswsexception INTO oref..
CATCH cx_ai_application_fault INTO oref..
ENDTRY.
break-point.
AND THIS IS ENDINNG WITH EXCEPTION
TRY.
CALL METHOD lr_proxy->login
EXPORTING
input = login_in
IMPORTING
output = login_out.
CATCH cx_ai_system_fault INTO oref.
text = oref->get_text( ).
_ CATCH zscx_dswsexception INTO oref. this exeption is being called_
text = oref->get_text( ).
CATCH cx_ai_application_fault INTO oref.
text = oref->get_text( ).
ENDTRY.Hello,
I struggle with exactly the same problem accessing the login webservice of the BOE server. Unfortunately the previous answer did not help me since I don't understand it
Anyone able to enlighten me?
Edit: Nevermind, I just found out by myself.
Thanks,
Sebastian
Edited by: Sebastian Solzbacher on Nov 25, 2011 9:43 AM -
Autentication error in Web Service after Login Module
Hi Experts,
I am getting a failed autentication when i try to access a web service. This is my scenario:
I have developed my own login module using JAAS. When i call a web service, the login module is executed, then it validate the credencials and make the authetication true. After that the web service is called. The web Service is mark as user/password authetication. But i always get this error:
Authentication for web service UtilityService, configuration UtilityService using security policy BASIC___ws failed: Login failed.. (See SAP Note 880896 for further info).
Just for you know, the credentials taht i use in login modulo isn't the user of UME. I use user store in another user store. I fthe credential is correct pass to the Principal an user of UME. To login stack is right when pass to login module:
LOGIN.OK
User: tecbmmab
IP Address: 192.168.14.48
Authentication Stack: tridmen.com.br/pegasus~ear*pegasus
Login Module Flag Initialize Login Commit Abort Details
1. com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule SUFFICIENT ok false false
2. br.com.tridmen.login.ERPCEHeaderLoginModule REQUISITE ok true true
#1 Client = 800
#2 Destination_reference = CUSTOM_DEST
#3 SysId = DE1
#4 SysNum = 00
#5 TargetHost = tecs220
#6 TrATicket = TRATICKETCTRL
Central Checks true
After this, the error mention above, of web service happen.
As my knowledge, when i call the web service i already have the session autenticate with login module. But this is not happen.
Could someone help with this question?
Best regards
Marcos BrandãHi,
in what order did you specify your login modules? In that error message it looks like it's in wrong order. Your custom module should be first with SUFFICIENT and then standard user name/password with REQUISITE.
Cheers -
Web Service session manager not found.
I'm trying to understand how to use the HTTP utilities, and I'm having trouble just creating a session. I get a Web Service session manager not found error. I've read where the client has to support cookies. My eventual client will be a labview VI that talks to a web server. I llooked at the Toolsptions, but don't see anything related to cookies. Not sure if that's what's causing this anyway, but I'm just digging. Also, I want to eventually send http messages across TCP/IP. Do I need to use the TCP/IP VIs (i.e. open connection, etc) or do I use the http utilities alone. If both are needed, how does the httpRequestID and the TCP/IP connection ID correlate.
Attachments:
htttGetSession.vi 9 KB
WebServerError.PNG 13 KBHi can you please let me know how you resolved this issue?
-
Keeping "CS Web Service session" alive while uploading big files.
Hi.
I have a problem when I'm uploading big files, which takes longer than the session timeout value, causing the upload to fail.
As you all know uploading a file is a three step process:
1). Create a new DocumentDefinition Item on the server as a placeholder.
2). Open an HTTP connection to the created placeholder and transfer the data using the HTTPConnection.put() method.
3). Create the final document using the FileManager by passing in the destination folder and the document definition.
The problem is that step 2 take so long that the "CS Web Service Session" times out and thus step 3 can not be completed. The Developer guide gives a utility method for creating an HTTP connection for step 2 and it states the folllowing "..you must create a cookie for the given domain and path in order to keep the session alive while transferring data." But this only keeps the session of the HTTP Connection alive and not the "CS Web Service Session". As in my case step 2 completes succesfully and the moment I peform step 3 it throws an ORACLE.FDK.SessionError:ORACLE.FDK.SessionNotConnected exception.
How does one keep the "CS Web Service Session" alive?
Thanks in advance
Regards.Okay, even a thread that pushes dummy stuff through once in a while doesn't help. I'm getting the following when the keep alive thread kicks in while uploading a big file.
"AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (409)Conflict
faultActor:
faultNode:
faultDetail:
{}:return code: 409
<HTML><HEAD><TITLE>409 Conflict</TITLE></HEAD><BODY><H1>409 Conflict</H1>Concurrent Requests On The Same Session Not Supported</BODY></HTML>
{http://xml.apache.org/axis/}HttpErrorCode:409
(409)Conflict
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:732)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:143)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:2424)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at oracle.ifs.fdk.FileManagerSoapBindingStub.existsRelative(FileManagerSoapBindingStub.java:1138)"
I don't understand this, as the exception talks about "Concurrent Requests On The Same Session", but if their is already a request going on why is the session timing out in the first place?!
I must be doing something really stupid somewhere. Aia ajay jay what a unproductive day...
Any help? It will be greatly appreciated... -
RPC web service session beans and local interfaces
I am wondering if it is possible to use EJB 2.0's local
interface (vs remote interface) with 6.1's RPC web service
session beans. Since WLS generates the SOAP servlet that
invokes the RPC session bean and I do not find
a way to some how tell SOAP servlet to use local interface to
get the session bean's local home interface, I am not sure
this can be done.
Any comments would be appreciated.
Thanks.
PeterTa. Thanks for the info.
Any idea when Local I/F support is due?
-Nick
"Neal Yin" <[email protected]> wrote:
>
"Nick Minutello" <[email protected]>
wrote
in message news:3d4413a4$[email protected]..
I was just about to post the very same question - but for WLS 7.0.0.1.
There are essentially two questions:
1) (from a functional perspective)
Can I expose Local Interfaces as SOAP using the auto-generation(servicegen ant
tasks)?Local Interfaces support is coming.
2) (from a performance perspective)
Does the generated SOAP implementation go via the (expensive) RemoteInterface
(ie marshalling) - or is the RMI marshalling optimised out (by setting<enable-call-by-reference>true</>)?
You can set this option by yourself on your EJB. Web service runtime
doesn't
do any magic in this area.
Regards,
Nick
"Peter" <[email protected]> wrote:
I am wondering if it is possible to use EJB 2.0's local
interface (vs remote interface) with 6.1's RPC web service
session beans. Since WLS generates the SOAP servlet that
invokes the RPC session bean and I do not find
a way to some how tell SOAP servlet to use local interface to
get the session bean's local home interface, I am not sure
this can be done.
Any comments would be appreciated.
Thanks.
Peter -
Can WebLogic 6.x maintain web services sessions between the client and the
server?
I need to implement a set of web services which share some session data.
SOAP itself does allow for maintaining a session, so it is possible to have
a SOAP header that will handle the passing of a session ID. Does WebLogic
provide an API to implement this feature?
Thanks in advance
RegardsWe've spent a lot of time thinking about conversations between Web Services
clients and WebLogic Servers where session data and ids are maintained. I
don't think we can provide much detail yet on the newsgroups, but it's
definitely an area that we're very much looking into.
Currently, you would have to role your own service. If you just wanted to
maintain a session id between client and server, the easiest (but most
intrusive) thing to do would be to pass an extra 'id' parameter on every method
call between client and server.
-- Rob
David Solis wrote:
Almost all of the sample code for Web Services that we are seeing today is
simple stateless method calls like "requesting a key or password",
"validations", "calculations", etc.
Has anybody experimented into the next logical step of a Stateful Web
Service i.e a set of interaction request/responses for example a teller bank
application or a shopping cart like example. Something on the lines of a
Stateful Session Bean in EJB.
It would be useful to all followers of this forum if either WebLogic
Engineers or developers of web services throw some light on their
experiences, suggestions.
Regards
"Rob Woollen" <rob@trebor_nelloow.moc> wrote in message
news:3BFE9675.EE4AB56@trebor_nelloow.moc...
WLS 6.1 does not currently provide a means to automatically propogate asession
ID in the SOAP header. I'd be interested in hearing more about what youwould
want for this feature. It's something that we are working on for a future
release.
-- Rob
David Solis wrote:
Can WebLogic 6.x maintain web services sessions between the client and
the
server?
I need to implement a set of web services which share some session data.
SOAP itself does allow for maintaining a session, so it is possible tohave
a SOAP header that will handle the passing of a session ID. DoesWebLogic
provide an API to implement this feature?
Thanks in advance
Regards
AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
by Michael Girdley, Rob Woollen, and Sandra Emerson
http://learnWebLogic.com
[att1.html] -
Partner Web Service Session Management in BPEL with JDeveloper 11g
JDeveloper 11g 11.1.1.1.0 and SOA Suite 11g
Trying to create an synchronous Web Service which has an external reference to a Web Service partner (AXIS 1.4 implementation) using BPEL. I have a sequence which has 2 invokes, one for user login and another invoke for a different call. However the session from the login has to be maintained for the second call to work. I am unable to do this. I get a NoSession error thrown from the partner Web Service. I did verify that my login piece is working.
On the composite, in the external reference piece I added binding property oracle.webservices.session.maintain and set to true and also added oracle.webservices.httpConnTimeout and set the value to 10000. This did not help. I would appreciate any help. Thanks.
RatnamHi,
Did you configure the Axis2 in Jdeveloper?
Best Regards
Sunny -
Web service with login soap action
Hi !
I would an explanation if the XI soap adapter can resolve the web service's flow below:
1 - soap action login with the first wsdl;
2 - reception of the session header;
3 - when the soap action that needs be called to solve, the session header (cookie saved) must be written inside the http protocol header (from the cookie saved) and after that to send with the second wsdl.
If there are another thing to resolve, I would thank about.
Thanks for your attention.Hi thanks for your input, but did you have to encode your binary data stream in say Base64 / utf-8 ? Also if you are transferring files in bulk(say 10 -100 files) how does your web service indicate end of one file or what is the best way so as to avoid performance problems.
Regards,
Aditya -
Web Services Session /Singleton cluster environment
Hi!
I am having trouble figuring out how to do sessions in web services.
I am trying to build an app that uses multiple GUI's in different languages (not java) and we want to implement our business layer with web services.
I need a session to save user settings, and user info so that I can avoid going to the database and ldap in every call.
So far my idea is to have a web service that deals with the authentication. If the user is valid, the web service will save in a singleton that has hashmap the user setting and return to the client the hashmap key as a token.
The client has the responsibility to save the token and to use it in later calls.
The problem that I have is that a singleton would not work in a cluster environment! And I really don't want to be passing all the user information between calls
Any ideas how can I solve this???Hi Gaurav,
Yes, the currently running session will be taken care of by the another server node which is up and running.
Your question: Does this mean that the a session of WebDynpro application will continue to work or the changes are lost and the user needs to login again?
"The state of the session is maintained in the persistent storage after the last successfully ended request." Which means that for example a user was filling up a form and haven't saved the changes and the server crashes then the data on that form will be lost when the second server node starts processing the request. But if the user had saved the data before the server crashes that state of the session will be stored and the data of the form will be saved and user need not fill it up again. If the Server crashes in between the HTTP request session then the request is assinged to the another server node to generate the response. In none of the case user needs to login again.
Your question: Fundamentally the question is what WebDynpro uses behind the scenes for maintaining session?
It uses Java Serialization to serialize the HTTP Sessions
"Serialization involves saving the current state of an object to a stream, and restoring an equivalent object from that stream. The stream functions as a container for the object. The information stored in the container can later be used to construct an equivalent object containing the same data as the original."
Edited by: Aishwarya Sharma on Oct 7, 2008 8:07 AM -
SOAP Web Service + Custom Login Module issue
Hi Guys,
We faced an authentication issue in our project. Could you please give any advice how the issue could be resolved.
Environment: A simple SOAP Web Service on top of POJO class created in a Web Application. The web application deployed to the SAP NetWeaver 7.10 Application Server in the Enterprise Application Archive.
Configuration:
Single Service Administration Application(NetWeaver Administration -> SOA Management -> Application and Scenario Communication -> Single Service Administration)
The web service endpoint has authentication configured to use User ID/Password HTTP Authentication.
Authentication Application(NetWeaver Administration-> Configuration Management->Security->Authentication)
The application(<vendorName>/<earName>*<vendor>~<webAppName>) has Authentication Stack configured to use our custom login module.
Issue: BasicPasswordLoginModule used by the J2EE when we are trying to execute the web service using Web Service Navigator(checked in debug mode). It seems that we missed something in configuration.
Idea: The main Idea is to use our custom login module when we are executing a web service.
Could you help me to resolve the issue.
Thanks,
Dmitry
Edited by: Dmitry Eidin on Jul 17, 2009 3:46 PM> The web service endpoint has authentication configured to use User ID/Password HTTP Authentication.
That's the point. -
BEA Web Service Session Example (Reformatted)
Hi,<br>
<p>
Has anyone been able to get access to the HTTP Session functionality from a web
service under WebLogic 8.1sp1 (Service Pack 1)?
I tried the example as shown at http://e-docs.bea.com/wls/docs81/webserv/api.html#1067906.
The relevant code section is as
follows:
<pre>
import weblogic.webservice.context.WebServiceContext;
import weblogic.webservice.context.ContextNotFoundException;
import weblogic.webservice.context.WebServiceSession;
* Shows how to use HTTP Session to maintain session state between
* invokes
public int maintainSessionState(){
try{
WebServiceContext wsContext = WebServiceContext.currentContext();
WebServiceSession session = (WebServiceSession)wsContext.getSession();
Integer count = (Integer)session.getAttribute( "count" );
count = (count==null) ?
new Integer( 0 ) : new Integer( count.intValue() + 1 );
session.setAttribute( "count", count );
return count.intValue();
}catch( ContextNotFoundException e ){
e.printStackTrace();
return -1;
</pre>
</p>
<p>
The ContextNotFoundException exception is thrown (the web service returns a –1
as it’s result). I have tried everything I
could think of to track this problem down, but I’ve had no luck. Here is my setup.<br>
Environment:<br>
WebLogic 8.1 (Service Pack 1)<br>
JDK 1.4.1.03<br>
Windows 2000<br>
</p>
<p>
I created a new clean Basic WebLogic Workshop Domain using the Configuration Wizard
that ships with WebLogic 8.1sp1. No JDBC,
JMS, or anything extra. I then created a new clean Empty Application under WebLogic
Workshop that ships with WebLogic 8.1sp1.
I associated the Application with the domain through Workshop’s Tools/Application
Properties menu. I added one Web Service
project to the application, then added one Web Service to the project, and then
added one method to the Web Service. I renamed
the method to the same method as in the example listed above. I copied all the
imports and method implementation into the web
service. Then ran the web service inside workshop. It failed. The method returned
a –1 (the ContextNotFoundException was
thrown). The return value from the WebServiceContext.currentContext() called
is null.
</p>
<p>
When I start a debug session (Debug\Start in Workshop), the following warning
is emitted:<br>
<br>
<Warning> <WLW> <000000> <Unable to load class ProcessControl><br>
<br>
Not sure if this is part of the problem. Other than not being able to get the
context through WebServiceContext, everything
else with the web services seems to be running fine.
</p>
<p>
When I run the example above I get the following stack trace in the logs:
<br>
<pre>
weblogic.webservice.context.ContextNotFoundException: unable to find context for
current thread
at weblogic.webservice.context.WebServiceContext.currentContext(WebServiceContext.java:36)
at WebServiceSessionTest.maintainSessionState(WebServiceSessionTest.jws:15)
at sun.reflect.GeneratedMethodAccessor161.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:353)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:420)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:393)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:245)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContainerBean.java:185)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(SLSBContainerBean.java:103)
at com.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(StatelessContainer_ly05hg_ELOImpl.java:99)
at com.bea.wlwgen.GenericStatelessSLSBContAdpt.invokeOnBean(GenericStatelessSLSBContAdpt.java:59)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.runAsInvoke(BaseDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.invoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.invoke(SyncDispatcherBean.java:159)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java:100)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Dispatcher.java:134)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dispatch(Dispatcher.java:46)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.exploreExec(HttpServerHelper.java:253)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.executeGetRequest(HttpServerHelper.java:570)
at com.bea.wlw.runtime.core.dispatcher.HttpServer.doGet(HttpServer.java:81)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6316)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
</pre>
</p>
Thanks in advance,
<br>
Brad Babb
P.S. Is there a preview pain somewhere on the posting page?Hi,<br>
<p>
Has anyone been able to get access to the HTTP Session functionality from a web
service under WebLogic 8.1sp1 (Service Pack 1)?
I tried the example as shown at http://e-docs.bea.com/wls/docs81/webserv/api.html#1067906.
The relevant code section is as
follows:
<pre>
import weblogic.webservice.context.WebServiceContext;
import weblogic.webservice.context.ContextNotFoundException;
import weblogic.webservice.context.WebServiceSession;
* Shows how to use HTTP Session to maintain session state between
* invokes
public int maintainSessionState(){
try{
WebServiceContext wsContext = WebServiceContext.currentContext();
WebServiceSession session = (WebServiceSession)wsContext.getSession();
Integer count = (Integer)session.getAttribute( "count" );
count = (count==null) ?
new Integer( 0 ) : new Integer( count.intValue() + 1 );
session.setAttribute( "count", count );
return count.intValue();
}catch( ContextNotFoundException e ){
e.printStackTrace();
return -1;
</pre>
</p>
<p>
The ContextNotFoundException exception is thrown (the web service returns a –1
as it’s result). I have tried everything I
could think of to track this problem down, but I’ve had no luck. Here is my setup.<br>
Environment:<br>
WebLogic 8.1 (Service Pack 1)<br>
JDK 1.4.1.03<br>
Windows 2000<br>
</p>
<p>
I created a new clean Basic WebLogic Workshop Domain using the Configuration Wizard
that ships with WebLogic 8.1sp1. No JDBC,
JMS, or anything extra. I then created a new clean Empty Application under WebLogic
Workshop that ships with WebLogic 8.1sp1.
I associated the Application with the domain through Workshop’s Tools/Application
Properties menu. I added one Web Service
project to the application, then added one Web Service to the project, and then
added one method to the Web Service. I renamed
the method to the same method as in the example listed above. I copied all the
imports and method implementation into the web
service. Then ran the web service inside workshop. It failed. The method returned
a –1 (the ContextNotFoundException was
thrown). The return value from the WebServiceContext.currentContext() called
is null.
</p>
<p>
When I start a debug session (Debug\Start in Workshop), the following warning
is emitted:<br>
<br>
<Warning> <WLW> <000000> <Unable to load class ProcessControl><br>
<br>
Not sure if this is part of the problem. Other than not being able to get the
context through WebServiceContext, everything
else with the web services seems to be running fine.
</p>
<p>
When I run the example above I get the following stack trace in the logs:
<br>
<pre>
weblogic.webservice.context.ContextNotFoundException: unable to find context for
current thread
at weblogic.webservice.context.WebServiceContext.currentContext(WebServiceContext.java:36)
at WebServiceSessionTest.maintainSessionState(WebServiceSessionTest.jws:15)
at sun.reflect.GeneratedMethodAccessor161.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:353)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:420)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:393)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:245)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContainerBean.java:185)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(SLSBContainerBean.java:103)
at com.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(StatelessContainer_ly05hg_ELOImpl.java:99)
at com.bea.wlwgen.GenericStatelessSLSBContAdpt.invokeOnBean(GenericStatelessSLSBContAdpt.java:59)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.runAsInvoke(BaseDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.invoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.invoke(SyncDispatcherBean.java:159)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java:100)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Dispatcher.java:134)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dispatch(Dispatcher.java:46)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.exploreExec(HttpServerHelper.java:253)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.executeGetRequest(HttpServerHelper.java:570)
at com.bea.wlw.runtime.core.dispatcher.HttpServer.doGet(HttpServer.java:81)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6316)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
</pre>
</p>
Thanks in advance,
<br>
Brad Babb
P.S. Is there a preview pain somewhere on the posting page? -
BEA Web Service Session Example
Hi,
Has anyone been able to get access to the HTTP Session functionality from a web
service under WebLogic 8.1sp1 (Service Pack 1)? I tried the example as shown at
http://e-docs.bea.com/wls/docs81/webserv/api.html#1067906. The relevant code
section is as follows:
import weblogic.webservice.context.WebServiceContext;
import weblogic.webservice.context.ContextNotFoundException;
import weblogic.webservice.context.WebServiceSession;
* Shows how to use HTTP Session to maintain session state between
* invokes
public int maintainSessionState(){
try{
WebServiceContext wsContext = WebServiceContext.currentContext();
WebServiceSession session = (WebServiceSession)wsContext.getSession();
Integer count = (Integer)session.getAttribute( "count" );
count = (count==null) ?
new Integer( 0 ) : new Integer( count.intValue() + 1 );
session.setAttribute( "count", count );
return count.intValue();
}catch( ContextNotFoundException e ){
e.printStackTrace();
return -1;
The ContextNotFoundException exception is thrown (the web service returns a –1
as it’s result). I have tried everything I could think of to track this problem
down, but I’ve had no luck. Here is my setup.
Environment:
WebLogic 8.1 (Service Pack 1)
JDK 1.4.1.03
Windows 2000
I created a new clean Basic WebLogic Workshop Domain using the Configuration Wizard
that ships with WebLogic 8.1sp1. No JDBC, JMS, or anything extra. I then created
a new clean Empty Application under WebLogic Workshop that ships with WebLogic
8.1sp1. I associated the Application with the domain through Workshop’s Tools/Application
Properties menu. I added one Web Service project to the application, then added
one Web Service to the project, and then added one method to the Web Service.
I renamed the method to the same method as in the example listed above. I copied
all the imports and method implementation into the web service. Then ran the
web service inside workshop. It failed. The method returned a –1 (the ContextNotFoundException
was thrown). The return value from the WebServiceContext.currentContext() called
is null.
When I start a debug session (Debug\Start in Workshop), the following warning
is emitted:
<Warning> <WLW> <000000> <Unable to load class ProcessControl>
Not sure if this is part of the problem. Other than not being able to get the
context through WebServiceContext, everything else with the web services seems
to be running fine.
When I run the example above I get the following stack trace in the logs:
weblogic.webservice.context.ContextNotFoundException: unable to find context for
current thread
at weblogic.webservice.context.WebServiceContext.currentContext(WebServiceContext.java:36)
at WebServiceSessionTest.maintainSessionState(WebServiceSessionTest.jws:15)
at sun.reflect.GeneratedMethodAccessor161.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:353)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:420)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:393)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:245)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContainerBean.java:185)
at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(SLSBContainerBean.java:103)
at com.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(StatelessContainer_ly05hg_ELOImpl.java:99)
at com.bea.wlwgen.GenericStatelessSLSBContAdpt.invokeOnBean(GenericStatelessSLSBContAdpt.java:59)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.runAsInvoke(BaseDispatcherBean.java:160)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.invoke(BaseDispatcherBean.java:54)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.invoke(SyncDispatcherBean.java:159)
at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java:100)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Dispatcher.java:134)
at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dispatch(Dispatcher.java:46)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.exploreExec(HttpServerHelper.java:253)
at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.executeGetRequest(HttpServerHelper.java:570)
at com.bea.wlw.runtime.core.dispatcher.HttpServer.doGet(HttpServer.java:81)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6316)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Thanks in advance,
Brad BabbThe maintain session example works only with the
web service stack that comes with WLS. You
need to use servicegen, source2wsdd, etc ant
tasks to assemble this web service.
Here is the full session example:
http://www.manojc.com/?sample30
Webservice generated by Workshop use a diffrent
soap stack and this functionality is not supported in it.
Regards,
-manoj
http://manojc.com
"Brad Babb" <[email protected]> wrote in message
news:[email protected]...
>
Hi,
Has anyone been able to get access to the HTTP Session functionality froma web
service under WebLogic 8.1sp1 (Service Pack 1)? I tried the example asshown at
http://e-docs.bea.com/wls/docs81/webserv/api.html#1067906. The relevant
code
section is as follows:
import weblogic.webservice.context.WebServiceContext;
import weblogic.webservice.context.ContextNotFoundException;
import weblogic.webservice.context.WebServiceSession;
* Shows how to use HTTP Session to maintain session state between
* invokes
public int maintainSessionState(){
try{
WebServiceContext wsContext = WebServiceContext.currentContext();
WebServiceSession session =(WebServiceSession)wsContext.getSession();
Integer count = (Integer)session.getAttribute( "count" );
count = (count==null) ?
new Integer( 0 ) : new Integer( count.intValue() + 1 );
session.setAttribute( "count", count );
return count.intValue();
}catch( ContextNotFoundException e ){
e.printStackTrace();
return -1;
The ContextNotFoundException exception is thrown (the web service returnsa -1
as it's result). I have tried everything I could think of to track thisproblem
down, but I've had no luck. Here is my setup.
Environment:
WebLogic 8.1 (Service Pack 1)
JDK 1.4.1.03
Windows 2000
I created a new clean Basic WebLogic Workshop Domain using theConfiguration Wizard
that ships with WebLogic 8.1sp1. No JDBC, JMS, or anything extra. I thencreated
a new clean Empty Application under WebLogic Workshop that ships withWebLogic
8.1sp1. I associated the Application with the domain through Workshop'sTools/Application
Properties menu. I added one Web Service project to the application, thenadded
one Web Service to the project, and then added one method to the WebService.
I renamed the method to the same method as in the example listed above.I copied
all the imports and method implementation into the web service. Then ranthe
web service inside workshop. It failed. The method returned a -1 (theContextNotFoundException
was thrown). The return value from the WebServiceContext.currentContext()called
is null.
When I start a debug session (Debug\Start in Workshop), the followingwarning
is emitted:
<Warning> <WLW> <000000> <Unable to load class ProcessControl>
Not sure if this is part of the problem. Other than not being able to getthe
context through WebServiceContext, everything else with the web servicesseems
to be running fine.
When I run the example above I get the following stack trace in the logs:
weblogic.webservice.context.ContextNotFoundException: unable to findcontext for
current thread
atweblogic.webservice.context.WebServiceContext.currentContext(WebServiceConte
xt.java:36)
atWebServiceSessionTest.maintainSessionState(WebServiceSessionTest.jws:15)
at sun.reflect.GeneratedMethodAccessor161.invoke(Unknown Source)
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
atcom.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:353)
atcom.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:420)
atcom.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:393)
atcom.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:245)
atcom.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContainerBean
.java:185)
atcom.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(SLSBContainerBean.jav
a:103)
atcom.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(StatelessContainer_l
y05hg_ELOImpl.java:99)
atcom.bea.wlwgen.GenericStatelessSLSBContAdpt.invokeOnBean(GenericStatelessSLS
BContAdpt.java:59)
atcom.bea.wlw.runtime.core.bean.BaseDispatcherBean.runAsInvoke(BaseDispatcherB
ean.java:160)
atcom.bea.wlw.runtime.core.bean.BaseDispatcherBean.invoke(BaseDispatcherBean.j
ava:54)
atcom.bea.wlw.runtime.core.bean.SyncDispatcherBean.invoke(SyncDispatcherBean.j
ava:159)
atcom.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(SyncDispat
cher_k1mrl8_EOImpl.java:100)
atcom.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Dispatcher.jav
a:134)
atcom.bea.wlw.runtime.core.dispatcher.Dispatcher.dispatch(Dispatcher.java:46)
atcom.bea.wlw.runtime.core.dispatcher.HttpServerHelper.exploreExec(HttpServerH
elper.java:253)
atcom.bea.wlw.runtime.core.dispatcher.HttpServerHelper.executeGetRequest(HttpS
erverHelper.java:570)
atcom.bea.wlw.runtime.core.dispatcher.HttpServer.doGet(HttpServer.java:81)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:1053)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:387)
atweblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
atweblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:6316)
atweblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:317)
atweblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3622)
atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Thanks in advance,
Brad Babb -
i develop a web service from a java class that has get and set method for a int variable.
first i call set method of web service then i call get method.But i lose the value set before.
Is it possible to store the value of the variable for the session.This is not something related to WS.
Check your backend java code. -
Is there a standard protocal that will allow Web Services to be tracked via a session?
I know that one can do it via an http session, but from what I have read - it is not recommended.
A correlation ID has been referred to - but is there a standard way of doing this via a correlation ID - I hate to just start creating my own tracking mechanism.
Thanks in Advance!
dustoffIs there a standard protocal that will allow Web Services to be tracked via a session?
I know that one can do it via an http session, but from what I have read - it is not recommended.
A correlation ID has been referred to - but is there a standard way of doing this via a correlation ID - I hate to just start creating my own tracking mechanism.
Thanks in Advance!
dustoff
Maybe you are looking for
-
Help in creating XML documents in ABAP using XI in new version ECC6.0
Hello All: I am pretty comfortable with XML and XSLT but new to XI. Is there a way of creating XML documents in ABAP using XI in new version ECC6.0? Please provide me with any links or any information you may have. All the answers will be rewarded
-
BR*Tools 7.0 and 7.1 what Instance Client version 10202 or 10204
I'm not sure if this is the wright form, but here goes. I have a question. What Instance Client verion (10.2.0.2 or 10.2.0.4) do you install with BRTools 7.0 and BRTools 7.1. Can you use either Instance Client version with either versions of BR*To
-
Modifying Phone Gap Accelerometer Code to identify when the axis is being tilted
Hi there, I am currently trying to create a phone application, one of the features that I am working on is using the Phone Gap Accelerometer function, and viewing it through Ripple. Currently I can view the position of the X, Y and Z axis, and they c
-
Jdbc modifying/deletion of entire rows..
Hi.. I have a database... at a given particular row I need to modify ALL columns in that row to something such as:('a','b','c','d','e','f','g') Is there anyway to iterate through the rows until you get to the row you want? Like with this resultSet? i
-
I'm a student and I recently took a class on Business Intelligence Tools using SSAS. I built a cube and I want to predict what factors lead students to become inactive (drop out/stop out). I have a table I'm calling DimStudent with the following colu