Web service session question
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.
Similar Messages
-
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 -
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 -
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?
-
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 -
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... -
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] -
I have created a web service in the NetWeaver portal using a Portal Service. I have marked the service as requiring basic http authentication. However, when I call the web service from the Enterprise Portal Web Services Checker in NWDS it just let's me supply the params of the web service and no authentication. Any ideas?
I also noticed that my web service does not appear under the Web Services Container or Web Services Security section in Visual Administrator. Anybody have any idea why this is?
Thanks in advance.
CurtisHi Curtis,
My guess is that since you are logged into the Portal while calling this web service, it will use the current session cookie to authenticate automatically. I'm not sure on the second question, tried a restart?
Regards,
Raj -
I am using a Web Service to publish some data, and this question is, I'm sure, stemming from my limited knowledge and use of web servers.
I am able to set up an "add" method, pass 2 numbers to the web server, and have the web server return a value. Simple. But, I am not sure what to do when I want to get the current value of something that is being updated in a loop.
For example, let's say I have a VI like the one below, and the user wants to display the current loop iteration in their browser, not continuously, but only when they ask for it. I don't want to use this VI as the method to call. Instead, I'd rather this VI pass the current value to a VI designated only to return the numeric control value to the webserver. But, I have no idea how (or if) I can pass the iteration value to a method to be called. Does this make sense?
I have thought about using session variables, but this requires continually writing to the session variable in my code, which probably isn't a big deal, but it would be nice if it only queried the current iteration when the user asked for it (much like 2 numbers are only added when the user asks for it in the NI example). I'm looking for a way to just return the current value, only when the user asks for it.
CLA, LabVIEW Versions 2010-2013
Solved!
Go to Solution.
Attachments:
loop.png 14 KBYou'll probably want to go through more LabVIEW basics before trying this, or consider another means of communication between your VIs such as shared variables.
A functional global variable is a VI that stores data in an uninitialized shift register. The simplest implementation has a boolean input indicating whether to read or write, an input for data (when writing), and an output for data (when reading). Search this forum for more information. You will also see the term "Action Engine" which is a more sophisticated version of a functional global that implements additional actions that manipulate the data.
The LabVIEW web server runs in its own application instance - almost a separate program. That means it cannot directly share data with the application that hosts the web server. VI Server is a mechanism to allow one LabVIEW instance to access VIs in another instance. In your main program, you would store the data in a functional global variable. In the web server, use VI Server to get access to the same functional global. You can then run that VI remotely, within the web server instance, and read data from it. See the help and examples for VI Server. -
(Newbie) Web Service Session Control
Dont know if my "help I am lost" request are out of line for this fourm. I do appreaceate any help I can get.
Creating a web application that is session based. I have set the scope of my web service to session. I have read that this setting has the same effect that the jsp setting "Session" does. However I am still a little mystified at what the Saop handler does here. I am assuming when a request gets routed to a service there is a HTTPSession that is created at some point, somewhere. I think I need to be able to access this class from Java. I know at some point in the future I will need to be able to handle session events, (Timeouts) and others. But for know I would be comforted in just being able to access getSession().
In case you are wondering I did not handwritte the wsdl or any of those documents. I used Jbuilder to automate that process (plus I cant hand write em yet). So please feel free to refer to these if needed to explain. It might just take me a bit. since id be learning it all at once.
Thanks in advance
JBMaybe this
https://jax-rpc.dev.java.net/servlets/ReadMsg?list=users&msgNo=1946
will answer your questions. It was alot of helpful response when I asked there for session scope stuff.
Merten -
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 -
Hi All,
Does web services in Java mean to simply provide a SOAP container that wraps around an EJB (or even a web container)?
If this is true, all of the work that's been done with the development of EJBs can be preserved, and other system will make calls to the SOAP container in order to get access to the web services provided.
I'm trying to understand the big picture and slowly get into Web Services in Java.
ThanksI don�t know if this answers your question, but I think that SOAP indeed can be used to expose existing EJB�s to non-Java-Systems.
-
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 -
Securing Web Service--Beginner question
Hi--
I am trying to follow the document "Securing WelbLogic Web Service 10g Release 3" and can't get past the initial steps to verify that my service has been deployed with the Wssp1.2-2007-Wss1.1-UsernameToken-Plain-X509-Basic256.xml policy
I have a basic question.
I add the aforementioned policy to my web service using :
*@WebService*
*@Policy(uri = "policy:Wssp1.2-2007-Wss1.1-UsernameToken-Plain-X509-Basic256.xml",attachToWsdl=true)*
and then rebuild and redeploy.
If I then access the URL for the web service with "?wsdl" apppended, shouldn't the WSDL returned now include policy information?
KarlThanks, that's what I've come to understand. Is this restiction due to the fact the the @Policy annotations are not standard or is this a limitation on the Weblogic eclipse plugin
What I've had to due is generate the JWS from the WSDL and then go back to the bottom up approach with the generated JWS source files. A bit of a pain but what can you do.
I tried adding the security policies as suggested by Bethune but they don't seem to "stick" after a restart of weblogic server. This may be due to running weblogic server under Eclipse. I havent had time to investigate this further
Once again thanks all for the help
Karl
Maybe you are looking for
-
The old someclass$1.class issue
I'm testing pulling project files from jb6 Pro from source safe and running it on another machine with the same installation and config. I have a swing class that has 6 $number.class entries in the deployment jar, and on the other machine I have 4. T
-
Writting in MS Excel which containing no sheet
I am developing application for the taxation purpose . I have an excel workbook which is macro enabled , but there is not any worksheet . This is provided by Government of India for vat return etc . How can i write data in excel workbook without cont
-
I get the following warning every time I try to open a recently download application. I'm running Mavericks 10.9.3 "xxxxx' is an application which was downloaded from the Internet. Are you sure you want to open it? How do I disable this warning for a
-
I purchased elements 11 in January and installed it on a PC. I then deactivated it and uninstalled it two days ago and was finally able to reinstall it successfully (after several attempts) yesterday on a new mac. Last night I could see the icon on m
-
Quick Time 7.67 video and audio not playing in CourseCompass MyMathLab
When I first used MyMathLab through Course Compass, the video and audio played with the digital picture broken up. Since then it stopped running the video and audio. I have tried uninstalling and reinstalling Quick Time more than once without any cha