Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#无服务参考的WCF_C#_Web Services_Wcf_Wsdl - Fatal编程技术网

C#无服务参考的WCF

C#无服务参考的WCF,c#,web-services,wcf,wsdl,C#,Web Services,Wcf,Wsdl,我不知道如何使用WCF而不使用C#中的服务引用将其添加到项目中。我无法使用服务引用,因为我的项目没有此选项。有人能告诉我该怎么做吗? 我将使用的WSDL具有以下方法:登录、注销、GetData、GetDetails、GetCaptcha、CheckCaptcha 我尝试此解决方案,但我对ServiceContract有问题。我不能用这种类型 BasicHttpBinding binding = new BasicHttpBinding(); EndpointAddress address =

我不知道如何使用WCF而不使用C#中的服务引用将其添加到项目中。我无法使用服务引用,因为我的项目没有此选项。有人能告诉我该怎么做吗? 我将使用的WSDL具有以下方法:登录、注销、GetData、GetDetails、GetCaptcha、CheckCaptcha

我尝试此解决方案,但我对ServiceContract有问题。我不能用这种类型

 BasicHttpBinding binding = new BasicHttpBinding();
 EndpointAddress address = new EndpointAddress("www");
 ChannelFactory<ServiceContract> factory = new ChannelFactory<ServiceContract>(binding, address);
 ServiceContract channel = factory.CreateChannel();
BasicHttpBinding=new BasicHttpBinding();
EndpointAddress地址=新的EndpointAddress(“www”);
ChannelFactory工厂=新的ChannelFactory(绑定,地址);
ServiceContract channel=factory.CreateChannel();

有什么想法吗?

添加服务引用的另一种方法是使用

在中,您可以按如下方式生成代理:

svcutil http://localhost/service.svc /t:code /out:ServiceProxy.cs /config:ServiceProxy.config

然后,您可以将生成的代理类和配置添加到项目中,并开始使用客户端。

Okey。我还有一个问题。当我有一个.Net Core项目并且我想将消息编码更改为MTOM时,我应该怎么做?您可以将其用于.Net Core和.Net标准项目。生成后,您可以更新要使用的配置。编辑:看起来MTOM消息编码是