0% found this document useful (0 votes)
21 views2 pages

Ow To Call/test A Web Service From A Browser

The document discusses how to test a web service from a browser by calling its methods. It explains how to view the WSDL of a sample web service called UserService by entering its URL in a browser. It also demonstrates how to call the service's setTwoNumbers method to set two parameters by appending parameters to the URL. Finally, it shows how to call the getNum1 and getNum2 methods to retrieve the set parameters from the browser.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Ow To Call/test A Web Service From A Browser

The document discusses how to test a web service from a browser by calling its methods. It explains how to view the WSDL of a sample web service called UserService by entering its URL in a browser. It also demonstrates how to call the service's setTwoNumbers method to set two parameters by appending parameters to the URL. Finally, it shows how to call the getNum1 and getNum2 methods to retrieve the set parameters from the browser.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

ow to call/test a web service from a browser

By Alvin Alexander. Last updated: May 4, 2015

Web service FAQ: How can I test a web service from a browser?
Ive been working with web services a lot this past week, specifically
with Apache Axis2, and here are a few notes I've learned about hitting one of
my web services from a browser.

Looking at the WSDL for a web service from a browser


To view the WSDL document for a web service I created
named UserService, I just went to the following URL in my browser:
http://localhost:8080/axis2/services/UserService?wsdl

For my purposes Im running the web service using the Axis2 server (as
opposed to running it through Tomcat, Glassfish, or other), so
my UserServiceweb service is available at that URL.

Calling a web service SET method from a browser


To call a method on my web service named setTwoNumbers, which shows up
in the WSDL assetTwoNumbers(int param0, int param1), I typed this
as a URL in my browser:
http://localhost:8080/axis2/services/UserService/setTwoNumbers?param0=5&param1=10

Calling a web service GET method from a browser


After first calling my method to set the two parameters, I was then able to call
these two methods and get my numbers (5 and 10) back from them:

http://localhost:8080/axis2/services/UserService/getNum1
http://localhost:8080/axis2/services/UserService/getNum2

Follow-up

While this tip works just fine when you're using Axis or Axis2, it does not work
if youre using XFire. There are other ways to test XFire web services from
tools like Eclipse, but personally I like the browser approach as a quick test. I
hope you can use this same browser-based technique to test your web services
with whatever server-side tool youre using.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy