Daniel Sousa
Daniel Sousa

Reputation: 81

Java WebService - WebSphere Application Server

I need to run a webservice on a WebSphere Application Server (Liberty Profile) so I can get the wsdl and use it to make tests on SoapUI. I'm using WebSphere Developer Tools on Eclipse Luna.

I have the code for this webservice, as follows:

Communicate.java

package xpto;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public interface Communicate {
        @WebMethod String initiate(String var);
}

CommunicateImpl.java

package xpto;

import javax.jws.WebService;

@WebService(endpointInterface = "xpto.Communicate")
public class CommunicateImpl implements Communicate {
    @Override
    public String initiate(String var){
        System.out.println("Communicating");
        return "S";
    }
}

Now, what should I do to run the webservice and get the wsdl file?

Upvotes: 0

Views: 1546

Answers (3)

Rishi Singh
Rishi Singh

Reputation: 27

CREATE a WAR file.DEPLOY it on WEBSPHERE.give context path name then access the webservice in url using Http:// ipadress:port/contextpath/webservice name?wsdl

Upvotes: 0

Gas
Gas

Reputation: 18020

You can check your web service name in the Eclipse. Expand your web project then JAX-WS Web Services > Web Services. Your service is probably called CommunicateImplService, so wsdl should be accessible by: http://host:port/context/serviceName?wsdl in your case probably CommunicateImplService?wsdl. Also make sure that your project is added to the server.

Upvotes: 2

Bejoy
Bejoy

Reputation: 11

Daniel,

Try giving an action attribute to the webmethod annotation.

http://docs.oracle.com/cd/E17802_01/webservices/webservices/reference/tutorials/wsit/doc/Examples_netbeans3.html

Upvotes: 0

Related Questions