2011-03-12 102 views
0

我有一个Netbeans SOAP服务,我可以在没有问题的情况下部署并使用Silverlight客户端。SOAP服务:缺少WS-Addressing标头

当我打电话Silverlight的服务,我获得(在Silverlight):客户端调用服务

new DiscourseParserWSClient created; 
event handler added; 
service called; Service State is: Open 
http://localhost:8080/DiscourseParserWS/DiscourseParserWSService 
An exception occurred during the operation, making the result invalid. 
The remote server returned an error: NotFound. 

后,GlassFish的第三版域与下面的问题回答我无法破译:

WARNING: A required header representing a Message Addressing Property is not present, Problem header:{http://www.w3.org/2005/08/addressing}Action 
com.sun.xml.ws.addressing.model.MissingAddressingHeaderException: Missing WS-Addressing header: "{http://www.w3.org/2005/08/addressing}Action" 
     at com.sun.xml.ws.addressing.WsaTube.checkCardinality(WsaTube.java:235) 
     at com.sun.xml.ws.addressing.WsaTube.checkMessageAddressingProperties(WsaTube.java:183) 
     at com.sun.xml.ws.addressing.WsaServerTube.checkMessageAddressingProperties(WsaServerTube.java:281) 
     at com.sun.xml.ws.addressing.WsaTube.validateInboundHeaders(WsaTube.java:140) 
     at com.sun.xml.ws.addressing.WsaServerTube.processRequest(WsaServerTube.java:147) 
     at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629) 
     at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588) 
     at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573) 
     at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470) 
     at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:112) 
     at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:195) 
     at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:127) 
     at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115) 
     at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629) 
     at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588) 
     at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573) 
     at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470) 
     at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:295) 
     at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:515) 
     at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:285) 
     at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:143) 
     at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:147) 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
     at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523) 
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279) 
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188) 
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641) 
     at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97) 
     at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85) 
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185) 
     at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332) 
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233) 
     at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165) 
     at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) 
     at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) 
     at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) 
     at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) 
     at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) 
     at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) 
     at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) 
     at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) 
     at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) 
     at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) 
     at com.sun.grizzly.ContextTask.run(ContextTask.java:69) 
     at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) 
     at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) 
     at java.lang.Thread.run(Thread.java:619) 

我使用地铁2.1和相当长的一段谷歌上搜索后,我怀疑问题可能有一些用它做...

我可以看到服务的WSDL,所以我BELI前夕它不能是一个实现问题。但是,这个警告的堆栈下降到Thread类o.O?

public void run() { 
if (target != null) { 
    target.run(); // <-- to this line to be exact 
} 
} 

请帮忙摆脱一下光;我已经有一些eclipse soap服务与这个客户端工作,但我没有Netbeans,GlassFish和Metro的经验,并且不知道是什么原因造成了这个...

+0

我接收相同的警告http://stackoverflow.com/questions/38306108/java-missing-ws-addressing-header-http-www-w3-org-2005-08-addressingaction – 2016-07-11 11:59:26

回答

4

不知道是否这是为时已晚,但它帮助我有时添加

@Addressing(启用= true,则需要= FALSE )

的WebService(类注释)。然后,异常通常会消失。

有关寻址内容的更多信息,请参阅1

2

我收到了同样的警告,并认为这可能会帮助其他人。

如果您在Netbeans可视化Web服务设计器中使用“可靠消息传递”选项,那么您可能会收到此警告。

如果您不需要“可靠的邮件传递”,您可以简单地将其关闭。

0

我今天面对这个问题,并通过在肥皂头上使用Action属性解决了问题。我已经使用SoapUI证实了这一点。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mal="http://example.com"> 
    <soapenv:Header> 
    <MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:2c7ea154-668e-4c8b-abaa-8b119f91b8dd</MessageID> 
    <Action xmlns="http://www.w3.org/2005/08/addressing">http://example.com/input</Action> 
    </soapenv:Header> 
    <soapenv:Body> 
     ...... 
    </soapenv:Body> 
</soapenv:Envelope> 

如果我们的arent传递action属性比我们得到错误信息:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> 
    <S:Header> 
     <FaultDetail xmlns="http://www.w3.org/2005/08/addressing"> 
     <ProblemHeaderQName>{http://www.w3.org/2005/08/addressing}Action</ProblemHeaderQName> 
     </FaultDetail> 
    </S:Header> 
    <S:Body> 
     <SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> 
     <faultcode xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:MessageAddressingHeaderRequired</faultcode> 
     <faultstring>A required header representing a Message Addressing Property is not present</faultstring> 
     </SOAP-ENV:Fault> 
    </S:Body> 
</S:Envelope> 

Action头的值从@Action确定上的WebMethod。

@Action(input = "http://example.com/input", output = "http://example.com/output")