第一步:生成接口
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin>svcutil http://localhost:52141/BasicCalculator.asmx /out:d:\abc
第二步:调用
PrimaryServiceSoap proxy = ChannelFactory<PrimaryServiceSoap>.CreateChannel(
new BasicHttpBinding(), new EndpointAddress(MBCommon.SessionManage.ROUTERURL));//路由地址
using (OperationContextScope scope = new OperationContextScope((IContextChannel)proxy))
{
MessageHeader mgh = MessageHeader.CreateHeader("业务功能", "http://company.ESB.FN/", "业务系统.获取信息");//服务标识
OperationContext.Current.OutgoingMessageHeaders.Add(mgh);
GetGeneral3Request request = new GetGeneral3Request(new GetGeneral3RequestBody(strUserCert));
GetGeneral3Response result = proxy.GetGeneral3(request);//webserver上的函数
}