我目前正在与租赁服务提供商进行集成,该服务提供商运行(我假设)Java 服务。
当我在 Visual Studio 2012 中添加服务引用时,引用已正确创建,我可以调用服务中指定的方法。
当我得到服务的响应时,问题就出现了。
假设我用错误的参数调用服务getCalculation
并得到 JSON 响应JSONException
。问题是,Visual Studio 抛出异常There was an error reflecting 'JSONException'.
并作为 InnerException:{"Namespace='http://service.ecommerce.cetelem.hu/' is not supported with rpc\\literal SOAP. The wrapper element has to be unqualified."}
这是 web.config 代码:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="EcommerceServiceImplPortBinding">
<security mode="Transport" />
</binding>
<binding name="EcommerceServiceImplPortBinding1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://ecomdemo.cetelem.hu:443/ecommerce/EcommerceService"
binding="basicHttpBinding" bindingConfiguration="EcommerceServiceImplPortBinding"
contract="CetelemInstallmentsService.EcommerceService" name="EcommerceServiceImplPort" />
</client>
</system.serviceModel>
如果这有任何帮助,我正在WebAPI
为用户“前端”使用。
谢谢大家的回答!