• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Web service question: Integrating a web service client in existing Tomcat app

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I created a web service client ( of a WSDL based offsite web service) using Eclipse WTP and tested it using same WTP work bench. When testing Eclipse created an instance of Tomcat and the whole thing run independent of the over all tomcat web project.

My question is , I now wants to make my project become the client so I called the proxy like this

TestServiceSoapProxy myLocalTest = new TestServiceSoapProxy();

and called the method like this..

myLOcalTest.testMethod(500, 200)

all is fine and compiled but I am getting servletException error...

Any idea
 
Ted Addis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok to put my question in different way, Eclipse created the following and run successfully using its own testing

TestService.java
TestServiceLocator.java
TestServiceSoap.java
TestServiceSoap12Stub.java
TestServiceSoapProxy.java
TestServiceSoapStub.java

My servlet application throws exception the moment I try to instantiate any of the classes from the above.
Any idea ?
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exception stack trace might help others to see the cause of problem.
 
Ted Addis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vinod,
Thanks for your reply.. Here is my problem. It is too catastrophic that it doesn't even reach to my first statement before my try statement as below..

I have a method inside my helper class that I haven't even start calling in my servlet class.

I introduced a new method in my HelperA.java and doesn't even print my info message. And remeber I am not even calling this method anywhere in my application.

public int getTestRemote()
{
message.info("About to instantiate a TestServiceSoapStub");
try {
TestServiceSoapStub myStub = new TestServiceSoapStub();


}

}

What are the preparations to run a web service client from a Tomcat based application? I mean it looks like some major error. And like I previously said, Eclipse created its own tomcat instant when testing and it worked.. What do I need to do on my Tomcat configuration? in my web.xml or server.xml ? or anywhere ?

Thanks,
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are no required Apache Tomcat procedures for allowing an object to call a web service.

I suggest creating a plain old Java class that can be run from a command-line and call the web service from this class (using command line). Once this is working, copy the code into a class that is part of the web application. (Make sure that you have all of the required classes in the Tomcat classpath)
[ November 20, 2008: Message edited by: James Clark ]
 
Ted Addis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks James,
I see your point on using POJO in stead of relying on Eclipse WTP. But this is my situation,
1. I have a Tomcat application that is running on Eclipse 3.4/ Tomcat 5.5/ Jdk 1.5 so I thought WTP would be a good choice to be able to integrate easily.

2. I have zero experience with web service. So there is no way I can generate all the Stubs, Proxy, etc classes in short period of time.

3. Axis2 despite its easy look, may be it is me or I don't know but I just can't get it.

And when I was able to test the web service on its own using WTP explorer, it just made sense to me to try to make it to work with in my existing application.

Since my last question, I made sure I include all Axis2 jar files same as WTP has it in my class path but still getting same error.
Do I need to mess with my web.xml file ? But I am calling the generated Stub class with in my existing Helper class so I don't see the need. Please let me know any suggestions you may have.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is unclear why and how you have chosen Eclipse for the "client." The client of a web service is another application. You should engage with someone with knowledge of what this WTP thing is and figure out how it relates to the client application that calls the web service.

Axis2 is not a good pick for beginner's. I suggest that you look to Axis1. This is a simpler implementation which makes it eary to learn with. The strength is in the service itself. Axis1 implements and provides all of the services required by the SOAP Engine API. This includes complex handler support for WS-Security, XMLSignature, and the other relevant service-based API.

There are no modifications to any of the Tomcat configuration files.

Your best bet is to learn how to develop web service client code with straight Java classes/objects. Once you understand this, you will not be confined by a tool such as Eclipse.
[ November 20, 2008: Message edited by: James Clark ]
 
Vinod K Singh
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See if this helps in anyway-
http://blog.vinodsingh.com/2008/09/building-jax-ws-web-service.html
http://blog.vinodsingh.com/2008/09/jax-ws-web-service-and-jboss.html
reply
    Bookmark Topic Watch Topic
  • New Topic