日志文件中显示以下错误消息。我的Web服务发布了许多方法,并且此堆栈跟踪未显示发生此异常时调用的方法。有太多的客户端使用这个Web服务,我无法告诉他们他们以错误的类型发送了什么内容,以及他们正在采用哪种方法。
是否可以以某种方式配置GlassFish,以便在抛出此异常时我知道调用了哪些Web服务方法?
[#|2013-03-27T14:13:20.910-0300|SEVERE|glassfish3.1.2|com.sun.xml.ws.transport.http.HttpAdapter|_ThreadID=27;_ThreadName=Thread-2;|Unsupported Content-Type: text/xml; charset="utf-8" Supported ones are: [application/soap+xml]
com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: text/xml; charset="utf-8" Supported ones are: [application/soap+xml]
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:315)
at com.sun.xml.ws.encoding.StreamSOAP12Codec.decode(StreamSOAP12Codec.java:102)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:149)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:361)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:343)
at com.sun.xml.ws.transport.http.HttpAdapter.access$400(HttpAdapter.java:99)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:623)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:263)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:163)
at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:145)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
|#]
答案 0 :(得分:2)
实际上qustion的答案“什么WS方法被称为?”是“无”。发生此异常时,尚未调用任何Web服务方法(在服务器端),因为它在尝试解析请求时事先失败。
关于将“?wsdl”附加到service参数的注释: “xxx / CentralWebService”可能是指您的服务端点,而“xxx / CentralWebService?wsdl”则为您提供 WSDL 。它是通过将“?wsdl”附加到服务端点来获取WSDL的常见约定,但它们完全不同。不要混淆它们。服务构造函数采用WSDL-URL,从中提取服务端点。后者可以通过属性BindingProvider.ENDPOINT_ADDRESS_PROPERTY在端口上覆盖。