Question

I created a Webservice with Axis2 in Eclipse. The Code for the Webservice is:

package server.services;

import server.jsons.User;

import com.google.gson.Gson;

public class Authentication {

    public String register(String text){

        Gson json = new Gson();
        User u = json.fromJson(text, User.class);

        return u.getName();
    }
}

Now I create the .wsdl file and run it under Tomcat. So far everything works. But how do I invoke the Webservice now with a parameter ?

e.g.

http://localhost:8080/Web/Authentication/register?text={attr1:="Test";attr2:="12"}

This doesn't work. I always get the answer that there is no such webservice. If I test the Webservice with the Eclipse WebClient the service works though.

Was it helpful?

Solution

I also could recreate this issue, look like REST style not working properly here. However if you call your webservice as normal soap call it works, example use SoapUI to test your webservice giving WSDL file to SoapUI tool, this is working.

If you need to access Web Service in REST style (even support SOAP style) , go for POJO deployment model,it has worked for me. (refer http://axis.apache.org/axis2/java/core/docs/pojoguide.html )

OTHER TIPS

Thank you for the suggestion. I will definately try this out. For the moment I decided to go with Jersey Webservice which works great for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top