Publishing Web Service on WebSphere

2019-08-02 13:59发布

问题:

I am pretty new in web services. I created a simple SOAP web service with JAX-WS (RPC style) by following this tutorial and I want to publish my endpoint on WebSphere. I know where my app is:

[AUDIT   ] CWWKT0016I: Web application available (default_host): http://localhost:9080/belediye-liberty/

and I assigned my publish url like:

import javax.xml.ws.Endpoint;
import com.ibm.cloudoe.services.HelloImp;

//Endpoint publisher
public class HelloPub{

    public static void main(String[] args) {
       Endpoint.publish("http://localhost:9080/belediye-liberty/ws/hello", new HelloImp());
    }     
}

But I cannot access wsdl and getting an error like:

[WARNING ] SRVE8093W: The servlet class name is null for the servlet named [javax.ws.rs.core.Application] so the request cannot be handled.
[WARNING ] SRVE0190E: File not found: /ws/hello

I guess I am assigning url in a wrong way. How should I do this? Thanks for help.

回答1:

Use this tutorial istead.

See Building and deploying the service section of above article.

Basically you need to build and deploy your code in proper directory/folder structure on websphere server.

As per your implemenation, websphere is looking for your webservice in belediye-liberty/ws/hello folder, which doesn't exist yet. That's why the error.

Although, if you will run this code in Eclipse, Net beans etc. it will work.



回答2:

You have to select Deploy Webservice option while deploy in Step1 page