【问题标题】:Amadeus Enterprise API The provided URI scheme 'https' is invalid; expected 'http'. (Parameter 'via')Amadeus Enterprise API 提供的 URI 方案“https”无效;预期的“http”。 (参数“通过”)
【发布时间】:2019-12-24 15:25:28
【问题描述】:

我正在尝试在 ASP.NET MVC C# 中连接 Amadeus Enterprise API,但出现以下错误:

'提供的URI方案'https'无效;预期的“http”。 (参数'via')'

这是网络配置,自定义

  <system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="AmadeusWebServicesBinding" />
  </basicHttpBinding>
  <customBinding>
    <binding name="AmadeusWebServices_AmadeusWebServicesPort">
      <textMessageEncoding messageVersion="Soap11WSAddressing10" />
      <httpTransport />
    </binding>
  </customBinding>
</bindings>
<client>
  <endpoint address="https://nodeD1.test.webservices.amadeus.com/WSAPHERE"
    binding="customBinding" bindingConfiguration="AmadeusWebServices_AmadeusWebServicesPort"
    contract="Amadeus_API.AmadeusWebServicesPT" name="AmadeusWebServicesPort" />
</client>

如何解决这个问题?

【问题讨论】:

    标签: c# asp.net asp.net-mvc amadeus


    【解决方案1】:

    您如何确定所需的绑定配置?这是猜测,是由某些工具生成的,还是由文档指定的?

    因为有httpTransporthttpsTransport 绑定元素,所以httpsTransport 是可以使用的,因为您的服务URL 是一个https 地址。

    【讨论】:

    • 嗨,Tom,此代码是在项目中添加 WSDL 作为参考并匹配 Amadeus 文档后生成的。但没有用我会尝试将 httpTransport 更改为 httpsTransport
    • 您可以共享 WSDL 吗?我很想看看它对服务的描述以及它是否指定了不安全的 HTTP。有时,添加服务引用对于服务实际需要的内容并不完全准确,因此这可能是它只是生成错误配置的情况之一。
    • 嗨,汤姆,感谢您的帮助,我必须使用 httpsTransport,但我仍然面临其他错误
    猜你喜欢
    • 2015-11-19
    • 2012-02-19
    • 2010-12-14
    • 1970-01-01
    • 1970-01-01
    • 2012-04-09
    • 2011-01-27
    • 1970-01-01
    • 2021-11-03
    相关资源
    最近更新 更多