需求:在客户端发起流程后,向另一个OA系统中发送一条代办服务的通知
Web系统提供了wsdl
1,获取对方web服务的地址:
处理方式,获取我方系统的服务器路径,然后在路径下添加文件配置对方web系统的调用地址
string path = System.AppDomain.CurrentDomain.BaseDirectory;
path += "JJWOA.txt";(这种方式很不标准了)
2,构建soap请求信息,按照对方提供的wsdl中的参数内容
//构造soap请求信息StringBuilder soap = new StringBuilder();soap.Append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"http://webservice.notify.sys.kmss.landray.com/\">");soap.Append("<soapenv:Header/>");soap.Append("<soapenv:Body>");soap.Append("<web:sendTodo>");soap.Append("<arg0>");soap.Append("<appName>XX系统appName>");soap.Append("<createTime>");soap.Append(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));soap.Append("createTime>");soap.Append("<docCreator>{\"LoginName\":\"");//发起人soap.Append(send);soap.Append("\"}docCreator>");soap.Append("<extendContent>extendContent>");soap.Append("<key>2key>");soap.Append("<level>3level>");soap.Append("<link>");soap.Append(prePath);soap.Append("link>");soap.Append("<modelId>NotifymodelId&