John Santy

Greenhorn
+ Follow
since Nov 03, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Santy

Hi Paul,

Thank you very much for your reply..

I managed to make it work.

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.

9 years ago
Hi Paul,

Good day!


I was able to create a Web Service client using eclipse. It works fine. Then, I can also now run all the .class from the command line(DOS) without using the eclipse interface.

My question is since all my generated .class are configured to use only one Web services http link(which was provided when I create my web service client from eclipse), how can implement so that I can provide http link of web service when running my java class. In this way, it is possible to use different web service link.

Thanks in advance for your help.


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"

9 years ago
Hi all,

I was able to create a Web Service client using eclipse. It works fine. Then, I can also now run all the .class from the command line(DOS) without using the eclipse interface.

My question is since all my generated .class are configured to use only one Web services http link(which was provided when I create my web service client from eclipse), how can implement so that I can provide http link of web service when running my java class. In this way, it is possible to use different web service link.

Thanks in advance for your help.


John.
9 years ago
Hi Bear,

Thanks for the reply.

I'm a newbie :)

Ok, I will read about EL and JSTL.


Thanks again!


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.

11 years ago
JSP
Hi all,

I have JSP with the following content.

<tr>
<td>Please Enter name: <input type = "text" name = "name" value = ""></td>
</tr>

<tr>
<td>Please Enter Place: <input type = "text" name = "place" value = ""></td>
</tr>


I have also scriptlet on the same JSP. I would like to use the value of "name" and "place" within my scriptlet. Basically, to use them as a parameter to call a java function. Could you please let me know how to achieve it?
11 years ago
JSP
Hi Paul,

Just an update.. I have decided to deploy my web services on another tomcat. So for now, it is working.

Also, could you suggest a good tutorial for JSP? I know there's plenty out there but I rather use from someone who knows already JSP.

Thanks so much again!


John

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"

11 years ago
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"

11 years ago
Hi Paul,

Thanks for the reply.


On November 3, I did not create a Dynamic web project. I just created a web service client project. I now created Dynamic project first and deploy my web service. I will work on it and keep you update.

Thank you for our patience.

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"

11 years ago
Hi Paul,

For now, I will try option A. However, when I try to create a servlet, IDE asked to provide a project name. If I create a new project, it will automatically create a new folder outside the project in which my web service clients are located. Maybe, I m missing somehing..I'm new in using eclipse IDE. Thanks in advance for your help.


Thanks
John





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)

11 years ago
Hi Paul,

Thank you for the reply.

Based on my understanding, after reading the tutorial link you have provided, it is the Servlet(HelloDynaWebServelt.java) should be the one calling the methods from my web service client code, correct?

For now, I would most likely do the option below:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Question: All I have to do is create a .war out of my web service client code. Then put that file in WEB-INF/lib. After which, I can call or create object(s) of my web service client? or Do I need to import it within Servlet(HelloDynaWebServelt.java) as an example?

Sorry to ask but I'm kind of newbie...


Thanks
John


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.

11 years ago
Hi Paul,

I followed the procedure int he link below and I was able to make it work...after some time of troubleshooting.

I'm getting now the idea. In the process, I learned there were 3 files created which are .java, .jsp and .xml. So, The JSP serves as a html file and it takes the input from there. Then, the java class is somehow called and output the entered value.

However, I still don't see how I could used by deployed web service client because they belong to a different projects.


Thanks in advance for your help!



John



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.

11 years ago
Hi Paul,

Thanks a lot! I will try it out and let you know.


Thanks
John

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.

11 years ago
Hi Paul,

Thanks for your reply!

Yes, you are correct...just like in real situation.


Thanks
John

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?

11 years ago
Hi Paul,

I may be off topic but I have created a web service client using Eclipse and it is working fine. I have written a java code to access all the methods provided by the web service. Now, I would like to deploy my java code(web service client) to a html page. Is it even possible? Do you have any suggestion so I could share or deploy the web service client ?

Thanks
John
11 years ago
Hi all,

I have created a web service client using Eclipse and it is working fine. I have written a java code to access all the methods provided by the web service. Now, I would like to deploy my java code(web service client) to a html page. Is it even possible? Do you have any suggestion so I could share or deploy the web service client ?


Thanks
John

11 years ago