2011-03-12 103 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")