我是webservice的新手。我创建了一个带有以下WSDL定义的Web服务。
<wsdl:service name="InterfaceService">
<wsdl:port name="InterfaceSOAP"
binding="impl1InterfaceSOAP">
<soap:address
location="http://localhost:9080/MyWeb/services/MyInterface" />
</wsdl:port>
</wsdl:service>
发布网络服务时,网址服务可在网址http://localhost:9080/MyWeb/InterfaceService上找到,而不是http://localhost:9080/MyWeb/services/MyInterface URl。 我们如何更改Web服务发布的URL
答案 0 :(得分:0)
E.g。
<servlet id="...">
<servlet-name>mypkg.MyInterface</servlet-name>
<servlet-class>mypkg.MyInterface</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>mypkg.MyInterface</servlet-name>
<url-pattern>/services/MyInterface</url-pattern>
</servlet-mapping>
请参阅官方文档here
E.g。
<?xml version="1.0" encoding="UTF-8"?>
<webservices-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ws-bnd_1_0.xsd"
version="1.0">
<webservice-endpoint port-component-name="MyInterface" address="/services/MyInterface" />
</webservices-bnd>
请参阅官方文档here