wso2 esb 不支持的媒体类型
Posted
技术标签:
【中文标题】wso2 esb 不支持的媒体类型【英文标题】:wso2 esb Unsupported Media Type 【发布时间】:2012-09-16 23:30:03 【问题描述】:我希望我的公司使用Wso2ESB,但是我只有两天时间说服他们,并且创建Proxy不起作用!
我迫切需要真正的帮助来解决我的问题:我创建的每个代理似乎都会产生
HTTPSender Unable to sendViaPost to...
(为什么无法发送?)
Transport error: 415 Error: Unsupported Media Type
(是无法发送的结果?还是配置有问题?)
我全新安装的 WSO2 ESB 4.5 不适用于我尝试过的任何 Web 服务:JAXWS 和 C#。我总是有以下消息LOG:
[2012-05-09 08:42:19,381] INFO - LogMediator To: /services/NET.NETHttpSoap12Endpoint, WSAction: http://tempuri.org/Iuser/CheckUserExistsSimple, SOAPAction: http://tempuri.org/Iuser/CheckUserExistsSimple, MessageID: urn:uuid:6e46c985-3646-4441-ba8d-0c366c063c4b, Direction: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><p:CheckUserExistsSimple xmlns:p="http://tempuri.org/"><!--0 to 1 occurrence--><p:User>-</p:User></p:CheckUserExistsSimple></soapenv:Body></soapenv:Envelope>
[2012-05-09 08:42:19,437] INFO - HTTPSender Unable to sendViaPost to url[http://192.168.10.177:8280/services/NET.NETHttpSoap12Endpoint]
org.apache.axis2.AxisFault: Transport error: 415 Error: Unsupported Media Type
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:308)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:194)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:450)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:277)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:555)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:531)
at org.apache.jsp.admin.jsp.WSRequestXSSproxy_005fajaxprocessor_jsp._jspService(WSRequestXSSproxy_005fajaxprocessor_jsp.java:272)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:161)
at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:36)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:179)
at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:49)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Unsupported Media Type[2012-05-09 08:44:32,644] WARN - ClientHandler I/O error : Connection reset by peer For : 192.168.10.71:80
这是代理定义:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="NET" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="useOriginalwsdl" value="true" scope="default" type="STRING"/>
<log level="full"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<endpoint>
<address uri="omitted"/>
</endpoint>
</target>
<publishWSDL uri="omitted?wsdl"/>
<description></description>
</proxy>
当我尝试使用soapUI 调用代理服务时,我收到以下消息:
Error loading [NET?xsd=...?xsd=xsd0]: java.io.IOException: Attempted read from closed
流
但如果我直接在 Glassfish/IIS 上调用真正的服务,它就可以工作。
【问题讨论】:
您使用的是 soap 12 端点吗?能不能改成soap 11看看有没有报错? @nuvio:多次发布同一个问题(请参阅***.com/questions/12529757/…)不会增加获得答案的可能性。 @Andreas Veithen 到目前为止你还没有提供任何帮助,幸运的是有好心人帮助了我。还是谢谢 【参考方案1】:这是因为您在请求中发送了不受支持的消息类型,并且它与 ESB 的任何消息类型都不兼容..
您能否将 TCPmon 放置在您的客户端和 ESB 之间并捕获整个消息并检查您实际发送到 ESB 的内容?
您的 wsdl 是否导入任何模式?..如果您使用发布 wsdl 选项,您应该提供所有模式..
首先最好不要使用发布 wsld 选项,首先尝试向代理发送消息并查看服务是否正在接收
【讨论】:
非常感谢,我会照你说的做的。 如何提供架构?必须在特定的 ESB 文件夹中? 它在没有发布 WSDL + 的情况下工作,使用属性 useOriginalwsdl=true 并调用 HttpSoap11Endpoint。非常感谢您的耐心和知识! Publish wsdl 选项用于某些情况下,您可能需要隐藏一些后端操作/更改这些操作(在实际后端服务中可用)。因此,用户不能调用这些操作,由于您已经编辑了代理的wsdl。如果没有这样的需要,那么您不需要提供WSDL。如果您在创建代理时提供了wsdl,您必须上传所有要注册的相关模式,您需要提供“scemaloaction”和 wsdl 资源的注册表项。当您通过代理向导提供 wsdl 时,您将看到该选项。 在这种情况下,您必须获取实际后端服务的 wsdl 并创建响应(正如我之前所说,您可以使用 SOPAUI 来构造请求有效负载)例如:使用服务的 wsdl 创建soapui项目后(请注意,您不应获取代理的 wsdl ..您将只看到一个默认操作调用“调解”)您将看到针对特定操作的请求(即:HelloYou)将带有参数的 taht 请求有效负载发送到代理以上是关于wso2 esb 不支持的媒体类型的主要内容,如果未能解决你的问题,请参考以下文章