• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Testing a web service

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Currently I have a scenario where in the external system to which I have
to send data over web services has published its web service wsdl.
something like this
http://mysite/webservice/legacy.cfc?WSDL

Now I have to test the service. I am new to web service & would want to know how do i invoke this web service to test the same. I mean understanding what data should be the input for this service.
This is not a comprehensive test just a preliminary one to understand if the web service is working & can be reached properly as expected.

Do post your thoughts on the same


Regards,
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by manish ahuja:

Currently I have a scenario where in the external system to which I have
to send data over web services has published its web service wsdl.
something like this
http://mysite/webservice/legacy.cfc?WSDL

Now I have to test the service.


Most current IDEs (Eclipse and Netbeans, anyway) have a facility that will generate a test client for you, given a WSDL descriptor. The generated client should be able to marshall and unmarshall the data appropriately for you, and the WSDL should give you a good idea as to what the WS will accept for input.
 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I hope this question does not sound naive.
Since I am using a java based approach, most examples I have seen actually talk about the corresponding java interface which is implemented by the java web service we are trying to invoke.

In my case if you see I just have a WSDL. I do not have anything else & moreover the file name is legacy.cfc?WSDL which is the Cold fusion file.

I tried using the Eclipse IDE but it expects a URL which is only from the one of the projects created within Eclipse.
I tried xfire but again the sample was having knowledge of all the methods & corresponding classes to invoke.

From the WSDL I would want to create a Java client class. I reckon we need a lot of other artifacts which ideally are generated(stubs skeletons etc). So I want to aceive something like this wehre in send this above URL as an input & it automatically creates all the boiler plate code for the same.

Please do post your thoughts on the same.


Thanks,
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
same question. I guess there is an easy way to test web services like just use web browser. I am thinking whether we can just send a request at browser's address. because web service use http protocol.

if we can use web browser to access wsdl file. why can't we use it to pass in requests?
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok to ellaborate what i am looking for is a utility to create the web service client side artifacts.
We are using Eclipse (WS Explorer) but somehow we are not able to get the related details like what all services & bindings are available for the same.
We tried doing an import of the WSDL to the workbench & made it part of our project but still its not giving us what all services are provided by the webservice but when I type the URL in the web browser it shows the WSDL properly.

I am looking for a utility something like JAXRPC to create a WS Client & all web service related client (java) artifacts. From the JAXRPC I downloaded the Java web service development pack but it did not help as it requires java version 1.5 & above & we are using 1.4.2

Do let me know your suggestions
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JAX/RPC generated stub is the best option.

Other way to test the servic is HttpURLConnection but in this as input, you have to pass soap request message.
 
Tracy Nelson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mohit Sinha:

We tried doing an import of the WSDL to the workbench & made it part of our project but still its not giving us what all services are provided by the webservice



How do you know it's not giving you all the services? If a service isn't listed in the WSDL, then it doesn't exist. If someone tries to tell you otherwise, make them give you a WSDL file that shows that service.

Try getting a copy of NetBeans from NetBeans Home. Create a new Web project, and set your Java EE version to 1.4. Then right-click on the project and select "New -> Web Service Client". It'll prompt you for the WSDL URL. Enter that and it'll generate the proper client stubs.

Oh, and I'd push hard to get a current version of Java on your server. WS development with JAX-WS is an order of magnitude easier than writing all those interfaces and specifying endpoints and all the other housekeeping you used to have to do. IBM should have WebSphere 6.1 figured out in a couple of months (it's out now, but largely unusable until they get a profile for Eclipse/RAD figured out, and get their app manager patched up), it supports Java 1.5 (just as 1.6 comes out, hmmmm....)
 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you need to test all your web service is a generic client.

If you can create SOAP request for web service you can use:
Stylus stuido tool or www.SOAPCLIENT.com web site they provide way to execute your WS.

If you need something for web service execution(WS client) you should develope one for your self.

In java 5 you can use Dispatch or Proxy object (JAX-WS) in java 1.4 you can use DII, Stub or proxy object (JAX-RPC)

There is framework in apache web site named WSIF implemented as generic client for java 1.4 if you like to use that frame work(I don't) you can use it, I don't like to use nonstandard framework, or tool's feature to do my task.
[ January 17, 2007: Message edited by: Reza Rawassizadeh ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic