2012-08-07 57 views
0

我尝试在Glassfish上部署Web服务。一切正常。该网络服务使用befor定义的WSDL文件我做到这一点与注释:使用不同的URL部署Web服务

@WebService(serviceName = "Daten", portName = "DatenSOAP", wsdlLocation = "Daten.wsdl", 
    targetNamespace = "http://foo.blub.com/ws/test/Service", 
    endpointInterface = "com.blub.foo.ws.test.service.Daten") 

,并在我的WSDL文件,我定义

<soap:address location="http://localhost:8080/servlet/test/Daten" /> 

但是当我部署这个WSDL部署在http://localhost:8080/foo/Daten

有什么问题我可以在哪里定义位置?

回答

0

正如您发现的那样,默认情况下,JAX-WS将使用上下文根和服务名称作为发布的端点位置。您的项目部署的上下文根是'foo','Daten'来自@WebService注释的serviceName属性。 这实际上非常方便,我建议您坚持使用默认值,除非您有强烈的要求。

如果你有这样的要求,对于使用这里描述(http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.wsfep.multiplatform.doc%2Finfo%2Fae%2Fae%2Ftwbs_customwebxml.html

希望帮助的web.xml servlet映射定制终端的过程。