【问题标题】:SOAP Exception while invoking the service through proxy通过代理调用服务时出现 SOAP 异常
【发布时间】:2013-12-13 08:14:03
【问题描述】:

我们正在尝试调用 SOAPService。但是这个电话,有时有效,有时无效。当它不起作用时,没有明确的模式。以下是我们在它不起作用时得到的。我们正在使用 Oracle Metro 堆栈。

知道为什么它不起作用以及可能是什么错误。

javax.xml.ws.WebServiceException while invoking FetchDiagnosticEvent over SSP... 
com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type:     soap-env/xml;charset=utf-8 Supported ones are: [text/xml]
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:299)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:133)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:358)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.createResponsePacket(HttpTransportPipe.java:269)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:218)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:137)
at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:110)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
at com.sun.xml.ws.client.Stub.process(Stub.java:323)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:161)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:113)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:93)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:144)
at com.sun.proxy.$Proxy44.fetchDiagnosticEvent(Unknown Source)
at com.apple.ist.applecare.adr_integration.invoker.FetchDiagnosticEventApiInvoker.invokeApiOverSSPAndGenerateResponse(FetchDiagnosticEventApiInvoker.java:184)
at com.apple.ist.applecare.adr_integration.invoker.FetchDiagnosticEventApiInvoker.invokeApi(FetchDiagnosticEventApiInvoker.java:99)
at com.apple.ist.applecare.adr_integration.ADRIntegrationManager.fetchDiagnosticEvent(ADRIntegrationManager.java:204)
at com.apple.ist.applecare.adr_integration.test.FetchDiagnosticEventTest.invokeApi(FetchDiagnosticEventTest.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

【问题讨论】:

    标签: java xml web-services soap java-metro-framework


    【解决方案1】:

    问题在于调用 web 服务的 java 或 soap 适配器。 你听说过模块参数转换吗?您需要在调用 webservice 之前删除肥皂信封。

    我不知道你的具体情况是什么,但希望你能做到这一点,

    在调用 webservice 之前, 删除您的请求消息的肥皂信封。 是否有任何类可以将内容转换为纯文本/xml。

    您还可以配置处理 Web 服务的第三方工具,以接收带有肥皂信封的格式和纯文本格式。那么你就不会得到这个错误了。

    这里发生了什么,您的代理正在发送包裹在肥皂信封中的请求消息,而接收您的请求的第三方工具并不期望它在肥皂信封中,可能是在他们的末端包装肥皂信封。

    问候, 安布吉

    【讨论】:

    • @Ambuj,感谢您的回答。如果是这种情况,那么所有调用都应该失败。为什么有些调用失败?而且,当我接受同一个 SOAP 请求并通过 SOAPUI 执行它时,它一直工作正常。
    • 嘿 Philipp,其实我之前也遇到过这个问题。您能否在此处发布一条成功请求消息和一条失败请求消息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-04
    • 1970-01-01
    • 2023-03-03
    • 2011-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多