我试图通过生成代理客户机来使用Jdev中SoapUI的模拟服务,但在Jdev中不断出现以下异常:
Exception in thread "main" com.sun.xml.internal.ws.server.UnsupportedMediaException: Unsupported Content-Type: text/html; charset=iso-8859-1 Supported ones are: [text/xml]
at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:284)
at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:118)
at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:278)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:180)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:124)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy33.searchOrder(Unknown Source)
at beans.util.search.ShowOrderSearchResults.getOrderSearchResults(ShowOrderSearchResults.java:43)
at beans.util.search.ShowOrderSearchResults.main(ShowOrderSearchResults.java:32)
谁能告诉我这是什么可能的原因,因为我是新的网络服务。
2条答案
按热度按时间tpxzln5u1#
此错误 * 与请求无关 *,而是与响应有关。JAX-WS * 客户端 * 运行时已发送请求,并且即将处理响应,但响应不是预期的text/xml(SOAP响应)。两个可能的根本原因:
1.您为Web服务使用了错误的URL,Web服务器会发送HTML响应,其中包含URL的内容或错误页面,例如404 Not found。
k4ymrczo2#
我在回答以下问题时详细说明了处理这些无效响应的可能原因、变通方法和解决方案:
UnsupportedMediaException -> how do you get the actual response?
答案总结:
Content-type
,以更好地适应您获取的内容