我已经创建了一个示例Web服务
package com.faisal.webservices.register;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService()
public class RegisterService {
@WebMethod()
public String sayHello(String name) {
System.out.println("Hello: " + name);
return "Hello " + name + "!";
}
}
的web.xml
<servlet>
<display-name>RegisterService</display-name>
<servlet-name>RegisterService</servlet-name>
<servlet-class>com.faisal.webservices.register.RegisterService</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>RegisterService</servlet-name>
<url-pattern>/RegisterService</url-pattern>
</servlet-mapping>
当我尝试访问wsdl
网址http://osdbconn-faisal.rhcloud.com/RegisterService?WSDL
(作为mentioned here)时,它返回了异常
我如何获得端点?
答案 0 :(得分:4)
经过大量搜索后,Google this question向我指出In order to be able to access the WSDL file I had to create a file jboss-web.xml
所以,我在jboss-web.xml
下创建了WEB-INF
为(found here)
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/</context-root>
</jboss-web>