簡體   English   中英

SOAP服務:缺少WS-Addressing標頭

[英]SOAP Service: Missing WS-Addressing header

我有一個可以無問題部署的Netbeans SOAP服務和一個Silverlight客戶端。

當我從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 v3域將響應以下無法解密的問題:

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)

我正在使用Metro 2.1,經過大量的搜索后,我懷疑問題可能與它有關...

我可以看到服務的wsdl,因此我相信它不會是實現問題。 但是該警告的堆棧歸因於Thread類oO?

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

請幫助闡明一些; 我已經有一些與此客戶合作的日食肥皂服務,但是我沒有Netbeans,GlassFish和Metro的經驗,也無法弄清楚是什么原因造成的...

不知道是否為時已晚,但有時它可以幫助我添加

@Addressing(啟用= true,必填= false)

到WebService(類注釋)。 然后異常通常會消失。

有關尋址內容的更多信息,請參考1

我收到了同樣的警告,並認為這可能會對其他人有所幫助。

如果您在Netbeans可視Web服務設計器中使用“可靠的消息傳遞”選項,則可能會收到此警告。

如果您不需要“可靠的郵件傳遞”,則可以將其關閉。

我今天遇到了這個問題,並且通過使用soap標頭上的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>

如果我們沒有傳遞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標頭的值由web方法上的@Action確定。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM