Publishing Web Service on WebSphere

2019-08-02 13:38发布

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.

2条回答
虎瘦雄心在
2楼-- · 2019-08-02 14:17

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

查看更多
小情绪 Triste *
3楼-- · 2019-08-02 14:24

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.

查看更多
登录 后发表回答