是否可以使用一个端点运行两个 ws 实现?
我有两个共享一些命名空间的 Web 服务实现(使用相同的对象 - 例如对象 C)。 我想发布它,所以
1) 将为客户端共享生成的对象(相同的对象 C 存根)
2) 我可以在一个端口上运行 Booth Web 服务并访问它们,只需更改 url,如下所示
http://localhost:6690/WS/A?wsdl
http://localhost:6690/WS/B?wsdl
package a.wsdl.xxx.com;
@WebService(targetNamespace = "a.wsdl.xxx.com", serviceName = "A", name = "A")
public class A{
@WebMethod
public C a(){...}
}
//------ -------------------------------------------------- --------
package a.wsdl.xxx.com;
@WebService(targetNamespace = "b.wsdl.xxx.com", serviceName = "B", name = "B")
public class B{
@WebMethod
public C b(){...}
}
//---------------------------------------- ------------------------
package xxx.com;
public class C{
String s;
....
}
I have two webservices implementations that shares some namespaces(Uses same objects - object C in example).
I whant to publish it so
1) There will be shared generated objects for the client side (the same object C stub)
2) I can run booth webservices on one port and access them just changing url like bellow
http://localhost:6690/WS/A?wsdl
http://localhost:6690/WS/B?wsdl
package a.wsdl.xxx.com;
@WebService(targetNamespace = "a.wsdl.xxx.com", serviceName = "A", name = "A")
public class A{
@WebMethod
public C a(){...}
}
//----------------------------------------------------------------
package a.wsdl.xxx.com;
@WebService(targetNamespace = "b.wsdl.xxx.com", serviceName = "B", name = "B")
public class B{
@WebMethod
public C b(){...}
}
//----------------------------------------------------------------
package xxx.com;
public class C{
String s;
....
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,我刚刚创建了两个war文件greeting1.war和greeting2.war。它们都实现了一个 hello-world 接口,如下所示,只是类名
Greeting1
和Greeting2
不同。然后我将两者都部署到jboss。两者都可以通过 http://localhost:8080/greeting1?wsdl 和 http://localhost:8080/greeting2?wsdlYes, I just created two war files greeting1.war and greeting2.war. Each of them implements a hello-world interface as shown below, only class names are different
Greeting1
andGreeting2
. Then I deployed both to jboss. Both are accessible via http://localhost:8080/greeting1?wsdl and http://localhost:8080/greeting2?wsdl两个或多个应用程序无法侦听同一端口。
Two or more applications can't listen same port.