【发布时间】:2010-07-26 21:15:28
【问题描述】:
我有一个 SOAP WSDL(在此处找到:https://portal.bsh-partner.com/picenter/server/a2a/)并且我正在尝试使用 Web 服务。
var soapEnvelope = string.Empty;
soapEnvelope = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
soapEnvelope += "<soapenv:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:q0=\"http://thexmlhost.com\">";
soapEnvelope += "<q0:Connect>";
soapEnvelope += "<q0:Username>username</q0:Username>";
soapEnvelope += "<q0:Password>password</q0:Password>";
soapEnvelope += "</q0:Connect>";
soapEnvelope += "</soapenv:Body>";
soapEnvelope += "</soapenv:Envelope>";
var xmlHttp = new MSXML2.ServerXMLHTTP40();
xmlHttp.open("POST", "https://thexmlhost.com/", "", "");
xmlHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttp.setRequestHeader("SOAPAction", "thexmlhost.com/");
xmlHttp.send(soapEnvelope);
xmlHttp.waitForResponse(500);
var outXml = xmlHttp.responseText;
响应不断返回一般 HTTP 响应错误页面。知道我应该如何传递我的 Soap Envelope 以从 Web 服务获得正确的响应吗?
【问题讨论】:
-
你到底为什么要手工制作肥皂信息?
-
Idk 如果我应该对此表示赞成,因为它是一个很好的做错的例子,或者出于同样的原因反对它......
标签: c# web-services soap