wso2 esb不支持的媒体类型

时间:2012-09-25 12:37:06

标签: axis2 wso2 esb wso2esb

我希望我的公司能够使用Wso2ESB,但我还有两天的时间来说服他们,并且代理的创建不起作用!

我迫切需要为我的问题提供真正的帮助:我创建的每个代理似乎都会产生

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 stream

但如果我直接在Glassfish / IIS上调用真实服务,它就可以工作。

1 个答案:

答案 0 :(得分:2)

这是因为您在请求中发送了不受支持的消息类型,并且它与ESB的消息类型不兼容。

您可以将TCPmon放在客户端和ESB之间并捕获整个消息并检查您实际发送给ESB的内容吗?

您的wsdl是否导入了任何模式?如果您使用publish wsdl选项,您应该提供所有模式。

首先,最好不要使用publish wsld,option并首先尝试向代理发送消息并查看服务是否正在接收