我遇到了在Glassfish 3.1.2中部署@WebServiceProvider Web服务的问题。
我按照以下方式为我的服务配置了glassfish-ejb-jar.xml。
<ejb>
<ejb-name>TestWebService</ejb-name>
<webservice-endpoint>
<port-component-name>TestWebService</port-component-name>
<endpoint-address-uri>HEAD/TestWebService</endpoint-address-uri>
<transport-guarantee>NONE</transport-guarantee>
</webservice-endpoint>
</ejb>
Web服务实现如下。
package test.ws.services;
import [...left out for brevity...]
@WebServiceProvider(
targetNamespace = "http://ws.test.com"
, serviceName = "HEAD/TestWebService"
, portName = "TestServicePort")
@ServiceMode(value = Service.Mode.PAYLOAD)
@Stateless
@HandlerChain(file = "test_handlers.xml")
@Interceptors({ TestInterceptor.class })
public class TestWebService implements Provider<Source> {
@WebMethod
public Source invoke(Source request) {
return calcResponseSource(request);
}
}
启动glassfish服务器时,glassfish server.log中会显示以下错误。
SEVERE javax.enterprise.system.tools.deployment.org.glassfish.deployment.common DPL5041:Unknown port-component-name TestWebServiceService port, all sub elements will be ignored
WARNING javax.enterprise.system.tools.deployment.org.glassfish.deployment.common DPL8007: Unsupported deployment descriptors element endpoint-address-uri value HEAD/TestWebService
WARNING javax.enterprise.system.tools.deployment.org.glassfish.deployment.common DPL8007: Unsupported deployment descriptors element transport-guarantee value NONE
稍后,该服务将部署在显示完全限定类名的“技术”URL中。
INFO javax.enterprise.webservices.org.glassfish.webservices WS00019: EJB Endpoint deployed
server listening at address at http://test:10280/HEAD/TestWebService/test.ws.services.TestWebService
我在网上搜索过,但找不到任何设置glassfish服务器进行部署而没有错误的解决方案。
PS:这个问题似乎也阻止我为网络服务启用HTTPS。
此致 埃格伯