【问题标题】:WSO2 ESB - Proxies do not work when Soap Tracing is turned offWSO2 ESB - 关闭 Soap 跟踪时代理不起作用
【发布时间】:2013-10-29 16:49:50
【问题描述】:

我已下载并正在试用 WSO2 ESB 并使用 wsHttpBindings 为 WCF 服务设置代理。当我启用 Soap Tracing 时,一切正常 - 当我关闭它时,我每次都会收到 500 个内部服务器错误。我完全坚持这一点,无法理解为什么会这样。

我尝试设置通过代理和基于 WCF 的代理,但我总是遇到完全相同的问题 - 启用 Soap Tracing 后,一切看起来都很棒并且运行良好。如果我关闭它并且不触摸任何东西,我会收到 500 错误:

System.ServiceModel.ProtocolException: An HTTP Content-Type header is required for SOAP messaging and none was found. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

我已经用 basicHttpBinding 尝试过,它似乎在开启或关闭 Soap Tracing 时都能正常工作。问题似乎只出在 wsHttpBindings 上。

这是代理的完整来源:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="ContactService"
       transports="http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <outSequence>
         <send/>
      </outSequence>
      <endpoint>
         <wsdl service="ContactService"
               port="ContactService_WsHttp"
               uri="http://localhost/Actions/ContactService.svc?singleWsdl"/>
      </endpoint>
   </target>
   <publishWSDL uri="http://localhost/Actions/ContactService.svc?singleWsdl"/>
   <description/>
</proxy>

【问题讨论】:

    标签: wcf wso2 wso2esb wshttpbinding


    【解决方案1】:

    您可以在您正在使用的代理的 inSequence 中尝试一下吗?

    谢谢你, 1G

    【讨论】:

    • 我已将代理的完整源代码添加到原始问题中 - 很奇怪,它在 ESB 中启用 SOAP Tracer 时按预期 100% 工作,但是当我将其关闭时它不会根本不工作,我收到 500 错误!我不认为跟踪器应该改变 ESB 的工作方式?
    【解决方案2】:

    我遇到了同样的问题,这里是有问题的代理:

    <proxy name="cx.partner.usps.RateV4"
          transports="https http"
          startOnLoad="true"
          trace="disable">
      <description/>
      <target>
         <inSequence>
            <property name="CONTENT_TYPE"
                      value="application/xml"
                      scope="axis2-client"
                      type="STRING"/>
            <property name="FORCE_HTTP_1.0" value="true" scope="axis2"/>
            <log level="full"/>
            <send>
               <endpoint key="partner.usps.prd.endpoint"/>
            </send>
         </inSequence>
         <outSequence>
            <class name="cx.wso2.mediators.addNamespace">
               <property name="soapPartName" value=""/>
               <property name="nsToAdd" value="http://xmlns.usps.com"/>
            </class>
            <send/>
         </outSequence>
      </target>
      <publishWSDL key="conf:/esb-resources/wsdl/usps/RateV4.wsdl">
         <resource location="RateV4.xsd" key="conf:/esb-resources/schema/usps/RateV4.xsd"/>
      </publishWSDL>
    

    这在 3.x 上无需跟踪即可工作,但在迁移到 4.7 后,我必须启用 SOAP 跟踪器。

    【讨论】:

    • 嗨@Wiredness,我在4.9.0版遇到了同样的问题,你能找到解决办法吗?
    【解决方案3】:

    试试这个,它对我们有用:

    <parameter name="enforceWSAddressing">true</parameter>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多