WSIT / Metro不了解​​Security SOAP标头

我正在使用WSIT / Metro来创建一个简单的Web服务。 当客户端尝试使用简单的用户名/ passowrd身份validation方案连接时,我在服务器上收到以下错误:

2010.03.31. 19:10:33 com.sun.xml.ws.protocol.soap.MUTube getMisUnderstoodHeaders INFO: Element not understood={http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security 

我不知道如何让WSIT理解安全块。

我从客户那里得到的请求:

      admin admin   http://localhost:11122/services/TopJtapiRemoteMethods urn:uuid:D5C576F83D74F761311270055433217 urn:hasCallPolling    

服务器的WSDL:

                                     

我的代码,设置服务器:

 import java.io.InputStream; import java.util.Collections; import javax.jws.WebService; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import javax.xml.ws.Endpoint; import javax.xml.ws.Holder; import com.topdesk.cti.topjtapi.soapserver2.HasCallPollingResponse; import com.topdesk.cti.topjtapi.soapserver2.TopJtapiRemoteMethodsPortType; public class EndpointTester { @WebService(endpointInterface = "com.topdesk.cti.topjtapi.soapserver2.TopJtapiRemoteMethodsPortType") private static final class MockImplementation implements TopJtapiRemoteMethodsPortType { @Override public HasCallPollingResponse hasCallPolling() { return null; } } /** * @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING * @see https://jax-ws.dev.java.net/2.1.7/docs/soap12.html */ private static final String SOAP12_BINDING_ID = "http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/"; public static void main(String[] args) throws Exception { Endpoint endpoint = Endpoint.create(SOAP12_BINDING_ID, new MockImplementation()); InputStream wsdlStream = EndpointTester.class.getResourceAsStream("/topjtapi-webapp/wsdl/TopJtapiRemoteMethods.wsdl"); endpoint.setMetadata(Collections. singletonList(new StreamSource(wsdlStream, "http://soapserver.topjtapi.cti.topdesk.com"))); endpoint.publish("http://localhost/services/TopJtapiRemoteMethods"); System.in.read(); } } 

我刚遇到同样的问题,我通过将mi项目更新为METRO 2.0解决了这个问题。 在Netbeans上,项目属性 – >导入库 – > MEtro 2.0。

在glassfish上只需通过命令行更新相同的库。

我不确定错误,但我认为服务器不知道这个命名空间: http : //docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0 .xsd 。

你没有写过关于客户的文章。 我还假设Metro。 – 使用相同的版本? – 你用wsimport创建它吗?

如果不创建新客户端,请使用某个IDE向导创建它,也可以配置安全性。 如果是人为错误,这应该有效。