调用https Web服务(C#) [英] Calling a https web service (C#)

查看:142
本文介绍了调用https Web服务(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实施了一个在某些https网址下提供的网络服务。客户端(控制台应用程序)调用它,但抛出以下错误:

I implemented a web service which is available under some https url. The client (a console app) calls it, but the following error is thrown:

提供的URI方案https无效;预期'http'。

我在网上搜索过,但我不确定如何解决它?这是通过向Web服务添加一些代码来解决的吗?

I searched that in the net, but I am not really sure how to solve it? Is this solved by adding some code to the web service?

谢谢: - )

推荐答案

绑定上有< security mode =Transport> 。这意味着它使用https。更改< endpoint address = ...> 以达成一致,或更改为非传输安全性http绑定。

You have <security mode="Transport"> on the binding. This means it uses https. Change the <endpoint address=...> to agree, or change to a non-transport-security http binding.

这是svcutil生成的(Add Web Referenc)配置吗?服务器配置是什么样的?令人惊讶的是从元数据生成这样的不一致配置。

Was this svcutil-generated (Add Web Referenc) config? What does the server config look like? It is surprising to generate 'inconsistent' config like this from the metadata.

问候

Karan Shah

这篇关于调用https Web服务(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆