473,732 Members | 2,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Async Web Service - Oracle 10g JDeveloper

3 New Member
Hi All,

I have a JSR 168 portlet that I need to call a J2EE 1.4 JAX-RPC Web Service. I'm using Oracle 10g JDeveloper. (I don't have a choice about this). It works when I call the sync method, but it won't recognizine the async method.

I'm thinking I have to use the async method of the WS because the WS takes a while to do it's thing and return. If it doesn't take a while, everything works fine. If it does take a while, my portlet becomes unavailable.

To create my WS, I wrote a java class, and used JDeveloper's "Create J2EE Web Service" wizard to create a J2EE 1.4 JAX-RPC WS. All my WS does is use a system call to execute a bash script. If the bash script just touches a file and returns, everything works great. If the bash script touches a file and then sleeps for a while, my portlet becomes unavailable.

DatabaseService BkupAll.java
Expand|Select|Wrap|Line Numbers
  1. public int bkupAllDB() { 
  2. int exitVal = -1;
  3. try {
  4. Runtime rt = Runtime.getRuntime();
  5. Process p = rt.exec("/auto/touchBash1.sh");
  6. p.waitFor();
  7. exitVal = p.exitValue(); 
  8. } catch (Exception e) {
  9. System.out.println(e);
  10. return exitVal;
  11. }
  12. Currently, my call to the WS is the following and it works just fine. I used the JDeveloper Web Service Proxy wizard to do it. 
  13.  
  14. DatabasePortlet.java
  15. DatabaseServiceBkupAllSoapHttpPortClient myPort = null;
  16. try {
  17. myPort = new DatabaseServiceBkupAllSoapHttpPortClient();
  18. System.err.println("Calling " + myPort.getEndpoint());
  19. } catch (Exception ex) {
  20. ex.printStackTrace(); 
  21. }
  22.  
  23. try {
  24. myPort.setEndpoint("http://localhost:6688/DatabaseServiceBkupAll-DatabaseServiceBkupAll-context- 
  25. root/DatabaseServiceBkupAllSoapHttpPort");
  26. exitVal = myPort.bkupAllDB();
  27. } catch (Exception e) {
  28. e.printStackTrace();
  29. }
  30.  
When I go to http://localhost:6688/DatabaseServic...pPortstub.html, under the Method Summary, it has
Expand|Select|Wrap|Line Numbers
  1. DatabaseServiceBkupAllSoapHttpPort_bkupAllDB
  2. int DatabaseServiceBkupAllSoapHttpPort_bkupAllDB ();
  3. DatabaseServiceBkupAllSoapHttpPort_bkupAllDBAsync
  4. void DatabaseServiceBkupAllSoapHttpPort_bkupAllDBAsync (function callback(int));
  5.  
To me that means the async version is out there and that I should be able to change "exitVal = myPort.bkupAllD B()" to "myPort.bkupAll DBAsync(somethi ng)" and everything should work. That's not the case. It doesn't recognize bkupAllDBAsync. Even if my "something" parameter isn't correct, I would at least think it would give me a different error.

Also, my other thought is maybe I needed to create the WS differently. For 11g JDeveloper, when you use the "Create J2EE Web Service" wizard, there's a step that asks you if you want to create it asynchronously, but that's not the case for 10g.

Maybe there's another solution, besides calling the WS asychronously, to make my portlet still be available while it waits for the WS to return. I was thinking threads, but if it's a timeout problem, I don't think threads would help, would it?

Any guidance would be greatly appreciated. This is my first project involving portlets and web service.
Dec 5 '08 #1
4 5641
Dököll
2,364 Recognized Expert Top Contributor
Hey there partner!

Sorry I could not help you too much with this one... But I did find you a link to an Oracle Tutorial, give it a look:

Calling an Asynchronous Web Service

Not too much info in my results, perhaps someone passing thorugh has an idea...

Sorry for your troubles:-)
Dec 8 '08 #2
dlc9s
3 New Member
Thank you for the tutorial. I did read it, but it uses BPEL which I cannot use (project restraint).
Dec 9 '08 #3
dlc9s
3 New Member
I got it to work using a thread. I'm not sure why my thread doesn't die, but it doesn't.

In DatabasePortlet .java:
private ThreadBean myThreadBean;
myThreadBean = new ThreadBean();
new Thread( myThreadBean ).start();

In ThreadBean.java :
public void run() {
try {
setStillAlive(1 );
setExitVal(1);
runScript();
setStillAlive(0 );
} finally {
}
}

private void runScript() {
DatabaseService BkupSoapHttpPor tClient myPort = null;
try {
myPort = new DatabaseService BkupSoapHttpPor tClient();
System.err.prin tln("Calling " + myPort.getEndpo int());
} catch (Exception ex) {
ex.printStackTr ace();
}
try {
myPort.setEndpo int("http://localhost:6688/DatabaseService Bkup-
DatabaseService Bkup-context-root/DatabaseService BkupSoapHttpPor t");
int temp = myPort.bkupAllD B();
setExitVal(temp );
} catch (Exception e) {
e.printStackTra ce();
}
}

In working.jsp:
<meta http-equiv="Refresh" content="3">
<!--Web Service is Done-->
<% if ( threadbean.getS tillAlive() == 0 ) { %>
<p>Process is Complete.<br><b r>
Press the button to continue.</p>
<!--Web Service is Busy-->
<% } else { %>
<p>Working... </p>
<p><font color="#ff0000" >Do not interrupt the process.</font></p>
<p>When the Continue button appears, the process is complete.</p>
<% } %>
Dec 21 '08 #4
Dököll
2,364 Recognized Expert Top Contributor
Dino-mite, dlc9s!

Good job getting it to work, and posting your finding...

Happy coding:-)

Dököll
Dec 21 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3455
by: John | last post by:
Hi, Has oracle published the DTD for the XML version of their Forms files? I can't find it in the documentation or online. thanks, John.
0
4272
by: Bryan Jackson | last post by:
Greetings, (I am an Oracle newbie -- been working with SQLServer for quite some time, however. I'm using Oracle9i and Oracle9i JDeveloper v9.0.3.1 (build 1107) for my programming environment). I'm trying to get an Oracle function to return XML to a JSP page, but am having some problems (mostly Oracle errors). Let me start by showing you what I've done so far.
0
2215
by: aychai | last post by:
Hi all, I am trying to make use Oracle9i db to call an external .Net Web Service from a JAva Stored Procedure. I created the .Net Web Service and use JDeveloper 9.0.3.4Build(1247) to create the Client Stub Java class(ie: serviceClientStub.java). Following the instruction from the article"Calling External Web Service from Java Stored Procedure",
0
2051
by: shay | last post by:
Oracle is proud to announce the immediate availability of Oracle JDeveloper 10g. This new version is focused on making J2EE development simpler by providing a visual and declarative development approach using the innovative Oracle Application Development Framework (Oracle ADF). Oracle JDeveloper 10g includes features that will appeal to both novice and experienced Java developers. Some of the new features in this release include:
4
3871
by: gengyue | last post by:
Hi, I need to call .Net webservice from my JSP page. My application is Struts application. It is deployed on Oracle application server. Here is the whole process. I have a login form. When user hit login button, my Action class will validate the user information and send his information to the other site by calling .Net web service, so the other site can extract these information. So, in my jsp, I am using Javascript and webservice.htc to...
4
4119
by: gengyue | last post by:
Hi, I need to call .Net webservice from my JSP page. My application is Struts application. It is deployed on Oracle application server. Here is the whole process. I have a login form. When user hit login button, my Action class will validate the user information and send his information to the other site by calling .Net web service, so the other site can extract these information. So, in my jsp, I am using Javascript and webservice.htc to...
0
1190
by: gengyue | last post by:
Hi, Refer to my previous post "Calling web serive from JSP", I found an article on msfn2.microsoft.com. "Using the WebService behavior, it is not possible to call a remote method directly on a server that resides in a different domain from the server hosting the Web page. However, Web servers can communicate directly with other Web servers, even if they reside in different domains. Therefore, it is possible to use the Web server that is...
18
3900
by: SteveHasel | last post by:
I'm trying to consume a web service that was generated by Oracle JDeveloper for a ASP.NET site in Visual Studio 2005. I used the Add Web Reference interface and everything seemed to work fine, but when I tried to reference the methods in the web service, they weren't there. In their stead were general web service functions and properties(like CreateObjRef, Discover, SoapVersion, etc). The url I used when adding the web reference was this:...
0
1394
by: The Doctor | last post by:
Hi everyone, I wondered if anyone has have experiences with using JDeveloper with Oracle 7.3.4. (Yeah, I know you are probably wondering why we are stilling 7.3.4....) I have written a simple JDBC application and ran it successfully in JDeveloper. I have also tested the Oracle connection from within JDeveloper. It worked after I modified jdev/bin/jdev.conf to use an older JDBC driver (classes111.zip). However, when I tried the...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.