H Paul wrote:Hi John,
1. I'm not sure if I understand what you asked.
2. So my guess: regardless of which way (eclipse/command line/or any other way), you can generate/create the client code from a given wsdl.
3. The given wsdl is deployed in a machine A, so your client code is pointing to machine A and worked.
4. Now if the same given wsdl is deployed into another machine B, your code is still working as it WITH only 1 change:
change the web service URL to point to the new machine B.
5. Now you have see how to do that with Axis API. Just Google, you should find an example.
H Paul wrote:1. Select the Project where it has WS Client code - This is a Dynamic web project.
(see the post dated posted Thursday, November 03, 2011 12:52:41 PM)
2. Right click on the selected project and select New and select Servlet.Now you need to enter the package name and a servlet name.
This Step 2 is actually the same you follow in the link that I gave earlier post dated posted Saturday, December 10, 2011 8:31:19 AM
http://besthowtodo.com/blog/2010/05/how-to-create-...ic-web-project-in-eclipse.html
See picture with caption "Create Servlet"
Bear Bibeault wrote:Where will these values come from? Input from the user?
If so, please read this article to find out why that is impossible.
Also, this is 2011 -- scriptlets have been discredited for almost 10 years now. More than passed time to move on and use modern techniques such as the EL and JSTL.
John Santy wrote:Hi Paul,
Bit by bit I'm getting the idea. I did a small test..What I noticed is that my web service client needs to run on tomcat that is started as a windows service. However, the dynamic web project(servlet) needs to run as a shell mode. When I stopped Tomcat service(windows service), the web service will not be able to find the web service. If I start Tomcat service(windows service), the servlet will complain that the another service is using the same port. By the way, I use the same tomcat for the servlet and for my web servie deplyment.. Have you seen this issue before?
Thanks in advance!
Regards,
John
H Paul wrote:1. Select the Project where it has WS Client code - This is a Dynamic web project.
(see the post dated posted Thursday, November 03, 2011 12:52:41 PM)
2. Right click on the selected project and select New and select Servlet.Now you need to enter the package name and a servlet name.
This Step 2 is actually the same you follow in the link that I gave earlier post dated posted Saturday, December 10, 2011 8:31:19 AM
http://besthowtodo.com/blog/2010/05/how-to-create-...ic-web-project-in-eclipse.html
See picture with caption "Create Servlet"
H Paul wrote:1. Select the Project where it has WS Client code - This is a Dynamic web project.
(see the post dated posted Thursday, November 03, 2011 12:52:41 PM)
2. Right click on the selected project and select New and select Servlet.Now you need to enter the package name and a servlet name.
This Step 2 is actually the same you follow in the link that I gave earlier post dated posted Saturday, December 10, 2011 8:31:19 AM
http://besthowtodo.com/blog/2010/05/how-to-create-...ic-web-project-in-eclipse.html
See picture with caption "Create Servlet"
H Paul wrote:1. Select the Project where it has WS Client code - This is a Dynamic web project.
(see the post dated posted Thursday, November 03, 2011 12:52:41 PM)
2. Right click on the selected project and select New and select Servlet.Now you need to enter the package name and a servlet name.
This Step 2 is actually the same you follow in the link that I gave earlier post dated posted Saturday, December 10, 2011 8:31:19 AM
http://besthowtodo.com/blog/2010/05/how-to-create-...ic-web-project-in-eclipse.html
See picture with caption "Create Servlet"
H Paul wrote:1. The servlet (controller) is using your WS client code to call WS provider: correct.
2. Two ways for re-use your WS client code:
A. Use the existing WS client code project that works,
add new JSP(view) and servlet (controller), then from the servlet re-use WS client code.
Now, every thing is 1 project and 1 deployable war file.
OR
B. Remember the steps - see posted Thursday, November 03, 2011 12:52:41 PM -
where you tried to generate AXIS client code, the IDE ask for the client project.
Now, try to do the same steps but this time, tell (or select) IDE to use the new Dynamic web site project.
In this way, you now have both WS client code and Dynamic web site code together in 1 project and deployed
as a war for Tomcat. Here you re-use the WS client code from the servlet (controller)
H Paul wrote:So
1. You have setup a JSP (view) where you have a form to allow the user to enter
(say requester, address, requestedAccuracy, acceptableAccuracy, maximumAge, responseTime, tolerance)
2. Once the user submit the form to the server, the Servlet (controller) take the inputs
from the user. Now, the Servlet (controller) will make use of the web service client code to call the web service provider.
Options:
-Deploy as 1 single WAR file: (on Tomcat web server for example.)
1. If you deploy the whole functionality in 1 war file, then you put the web service client code in a different package
in the same dynamic web project (war file)
OR
you can create a jar file that consist of web service client code and put it in the WEB-INF/lib folder of the
dynamic web project (war file)
By either way, the visibility is there for you to use web service client code.
-Deploy as 1 single EAR file: (consist of dynamic web project and the different web service client code project) (on any J2EE app server)
1. From the dynamic web project, you can put a reference to the project A (where you have web service client code)
By this way, the visibility is there for you to use web service client code from the different project.
H Paul wrote:There are options...
Option 1:
1. Here is an example to set up a dynamic web site.
Have it set up and running to get familiar with Eclipse IDE way of creating a dynamic web site.
http://besthowtodo.com/blog/2010/05/how-to-create-dynamic-web-project-in-eclipse.html
2. Once step 1 is done, you'll know what do to for your requirement
in terms of creating new fields for data entry and submiting to the server
for the server (your ws client code) to use those entered data to call the web service provider.
For now, have step 1 done first.
H Paul wrote:There are options...
Option 1:
1. Here is an example to set up a dynamic web site.
Have it set up and running to get familiar with Eclipse IDE way of creating a dynamic web site.
http://besthowtodo.com/blog/2010/05/how-to-create-dynamic-web-project-in-eclipse.html
2. Once step 1 is done, you'll know what do to for your requirement
in terms of creating new fields for data entry and submiting to the server
for the server (your ws client code) to use those entered data to call the web service provider.
For now, have step 1 done first.
H Paul wrote:1. Can we postpone your above question for few minutes?
2. Clarification: Are you trying to do:
A. Show a web page where the user can enter some data/field/values
(say requester, address, requestedAccuracy, acceptableAccuracy, maximumAge, responseTime, tolerance)
B. Upon submission, the server get the submitted data and re-use your web service client code
to call the web service provider and show to the user the result
(say location)
Is this correct?