Tengo un SOAP WSDL (que se encuentra aquí: https://portal.bsh-partner.com/picenter/server/a2a/) y estoy tratando de consumir los servicios web.Consumir el servicio web SOAP en 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;
La respuesta sigue volviendo una página de error de respuesta HTTP general. ¿Alguna idea de cómo debería pasar mi Soap Envelope para obtener la respuesta adecuada del servicio web?
¿Por qué demonios haces manualidades con un mensaje de jabón? –
Idk si debería votar esto porque es un gran ejemplo de hacerlo mal o menospreciarlo por la misma razón ... –