这是我的客户端代码。调用此函数时,我收到 400 错误请求错误。谁能帮助我。
var req_params="<?xml version=\"1.0\" encoding=\"utf-8\"?>";
req_params = req_params + "<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/\">";
req_params = req_params + "<soap:Header>";
req_params = req_params + "<UserDetails>";
req_params = req_params + "<Lastname>Abubakar</Lastname>";
req_params = req_params + "<Othernames>Uju, Ayo</Othernames>";
req_params = req_params + "<Email>me@me.com</Email>";
req_params = req_params + "<Phone>08032458829</Phone>";
req_params = req_params + "</UserDetails>";
req_params = req_params + "</soap:Body>";
req_params = req_params + "</soap:Envelope>";
console.log(req_params);
$.ajax({
type: "POST",
url: "http://testservices.interswitchng.com/quicktellerservice/quickteller.svc/CreateUser",
data: req_params,
processData:false,
contentType: "text/xml; charset=\"utf-8\"",
dataType: "xml",
success: function (data) {
console.log(data);
},
error: function (xhr, status, error) {
alert(error);
}
});