Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.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服务程序绑定与Web配置_C#_.net_Wcf_Nettcpbinding - Fatal编程技术网

C# WCF服务程序绑定与Web配置

C# WCF服务程序绑定与Web配置,c#,.net,wcf,nettcpbinding,C#,.net,Wcf,Nettcpbinding,这两种方法调用我的WCF服务有区别吗 1) 编程绑定: var xml = "my xml string"; var ep = new EndpointAddress("http://myendpoint"); xml = new Proxy.ServiceClient(new NetTcpBinding(), ep).getNewXML(new Proxy.CallContext(), xml); 2) web配置: var xml = "my xml string"; xml = new

这两种方法调用我的WCF服务有区别吗

1) 编程绑定:

var xml = "my xml string";
var ep = new EndpointAddress("http://myendpoint");
xml = new Proxy.ServiceClient(new NetTcpBinding(), ep).getNewXML(new Proxy.CallContext(), xml);
2) web配置:

var xml = "my xml string";
xml = new Proxy.ServiceClient().getNewXML(new Proxy.CallContext(), xml);
相应的web配置:

  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="NetTcpBinding_SCSService">
        </binding>
      </netTcpBinding>
    </bindings>
    <client>
      <endpoint address="myendpoint"
       binding="netTcpBinding" bindingConfiguration="NetTcpBinding_SCSService"
       contract="SCSProxy.SCSService" name="NetTcpBinding_SCSService">
      </endpoint>
    </client>
  </system.serviceModel>