How to access parameters when building web services?

This is my first time developing a web service with IDEA, so please be gentle.

I followed

and created a hello world web service. I can access it in browser using http://localhost:8080/services/HelloWorld?method=sayHelloWorldFrom

Now then web service method sayHelloWorldFrom, takes a parameters "from"

  public String sayHelloWorldFrom(String from) {
    String result = "Hello, world, from " + from;
    return result;

How can I specify the value of from using the URL?  I tried http://localhost:8080/services/HelloWorld?method=sayHelloWorldFrom&from=test and it generates an error message:

faultcode: soapenv:Server.userException
faultstring:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.

Can you please assist me? thanks!


Comment actions Permalink

Can anyone please help?

Comment actions Permalink

Hello Frank!

This very helpful guide about Web Services

Why don't you:
1. Get WSDL from server that describes your WebService
2. Generate a client from that WSDL
3. Pass a parameter "from" into that client.

This very good example how to create such a client:


Please sign in to leave a comment.