Tôi có một WSDL SOAP (được tìm thấy ở đây: https://portal.bsh-partner.com/picenter/server/a2a/) và tôi đang cố gắng sử dụng các dịch vụ web.Tiêu thụ dịch vụ web SOAP trong ASP.NET
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;
Phản hồi tiếp tục trả lại trang lỗi phản hồi HTTP chung. Bất kỳ ý tưởng làm thế nào tôi nên đi qua Soap Envelope của tôi để có được phản ứng thích hợp trở lại từ các dịch vụ web?
Tại sao trên thế giới bạn lại chế tác một thông điệp xà phòng? –
Idk nếu tôi nên upvote này bởi vì một ví dụ tuyệt vời của nó làm sai hoặc downvote nó cho cùng một lý do ... –