POST /ProductService.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://sh.inobido.com/SaveProduct"
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>
<SaveProduct xmlns="http://sh.inobido.com/">
<productID>intproductID>
<productName>stringproductName>
<manufactureDate>dateTimemanufactureDate>
SaveProduct>
soap:Body>
soap:Envelope>
var productServiceUrl = ‘http://localhost:57299/ProductService.asmx?op=SaveProduct‘; // Preferably write this out from server side
function beginSaveProduct(productID, productName, manufactureDate){
var soapMessage =
‘ ‘ + productID + ‘ ‘ + productName + ‘ ‘ + manufactureDate + ‘ ‘;
$.ajax({
url: productServiceUrl,
type: "POST",
dataType: "xml",
data: soapMessage,
complete: endSaveProduct,
contentType: "text/xml; charset=\"utf-8\""
});
return false;
}
function endSaveProduct(xmlHttpRequest, status){
$(xmlHttpRequest.responseXML)
.find(‘SaveProductResult‘)
.each(function() {
var name = $(this).find(‘Name‘).text();
});
}
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
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>
<SaveProductResponse xmlns="http://sh.inobido.com/">
<SaveProductResult>
<ID>intID>
<Name>stringName>
<ManufactureDate>dateTimeManufactureDate>
SaveProductResult>
SaveProductResponse>
soap:Body>
soap:Envelope>
使用JQuery的Ajax调用SOAP-XML Web Services(Call SOAP-XML Web Services With jQuery Ajax)(译+摘录),,
使用JQuery的Ajax调用SOAP-XML Web Services(Call SOAP-XML Web Services With jQuery Ajax)(译+摘录)