有没有更好的方法在C#中形成soap请求?
这是真的吗有没有更好的方法在C#中形成soap请求?,c#,.net,soap,C#,.net,Soap,这是真的吗 XmlDocument doc = new XmlDocument(); doc.InnerXml = @"<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns
XmlDocument doc = new XmlDocument();
doc.InnerXml = @"<?xml version='1.0' encoding='utf-8'?><soap:Envelope
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<soap:Body><Authenticate xmlns='https://na.ntrsupport.com'>
<IdOwner>99999</IdOwner>
<Login>MyLogin</Login>" +
"<Pwd>myPass</Pwd>" +
"<PwdInterfaces>interfacePass</PwdInterfaces>" +
"<Platform>domain</Platform>" +
"<H>" + getMd5EncodedHash(NtrHash) + "</H>" +
"</Authenticate></soap:Body></soap:Envelope>";
XmlDocument doc=新的XmlDocument();
doc.InnerXml=@”
99999
“麦洛金”+
“我的通行证”+
“接口通行证”+
“域”+
“+getMd5EncodedHash(NtrHash)+”
"";
我刚从web服务返回一个未定义的错误…您可以使用SoapClient类。这样,您就不必自己创建消息。通过字符串操作手工创建XML会给您带来麻烦。什么是登录och Pwd包含以下任何字符:åäö&?请改用XmlDocument或类似文件
您可以访问web服务的WSDL吗?如果是这样,请使用Visual studio中的“添加服务引用”为您的web服务创建一个类型化代理。是否有更糟糕的方法可能是一个更好的问题…@Greg Beech-即使我也不得不对此进行投票。。对不起,我不是.net本地人-但我知道这不好。。。