调用我的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);
对应的网络配置:
<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>