How can I view a SOAP response?
Posted: Fri Aug 08, 2014 8:20 pm
Hey guys,
I'm stuck on this problem. I think I'm getting a SOAP exception as a response but I can't view it. I tried logging the response but it just shows "[object Network8::SOAP_ex]". Does anyone know how I could examine this response?
I tried taking the response and using writeToFile() but that function just returns a boolean on success and I don't know how to see the contents of that file. I also tried parseBody() but I don't know what the documentation means by the "element name".
Anyone have any idea how I can see what's in that response?
var wsdl = 'http://192.168.1.XX/EnterpriseWebServic ... .asmx?wsdl';
try{
var soap = new SOAP();
var xml = '<?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>' +
'<GetDetailJobStatus xmlns="http://localhost/EnterpriseWebService/Enterprise Connect">' +
'<Credentials>' +
'<Username>myusername</Username>' +
'<Password>mypass</Password>' +
'</Credentials>' +
'<JobNumber>123456</JobNumber>' +
'</GetDetailJobStatus>' +
'</soap:Body>' +
'</soap:Envelope>';
soap.setBody(xml);
var response = soap.requestMessage(wsdl, 'http://localhost/EnterpriseWebService/E ... lJobStatus');
s.log(2, "Result is...");
s.log(2, response);
soap.writeToFile('request.xml');
response.writeToFile('response.xml');
} catch ( exception ) {
s.log(3, exception );
}
I'm stuck on this problem. I think I'm getting a SOAP exception as a response but I can't view it. I tried logging the response but it just shows "[object Network8::SOAP_ex]". Does anyone know how I could examine this response?
I tried taking the response and using writeToFile() but that function just returns a boolean on success and I don't know how to see the contents of that file. I also tried parseBody() but I don't know what the documentation means by the "element name".
Anyone have any idea how I can see what's in that response?
var wsdl = 'http://192.168.1.XX/EnterpriseWebServic ... .asmx?wsdl';
try{
var soap = new SOAP();
var xml = '<?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>' +
'<GetDetailJobStatus xmlns="http://localhost/EnterpriseWebService/Enterprise Connect">' +
'<Credentials>' +
'<Username>myusername</Username>' +
'<Password>mypass</Password>' +
'</Credentials>' +
'<JobNumber>123456</JobNumber>' +
'</GetDetailJobStatus>' +
'</soap:Body>' +
'</soap:Envelope>';
soap.setBody(xml);
var response = soap.requestMessage(wsdl, 'http://localhost/EnterpriseWebService/E ... lJobStatus');
s.log(2, "Result is...");
s.log(2, response);
soap.writeToFile('request.xml');
response.writeToFile('response.xml');
} catch ( exception ) {
s.log(3, exception );
}