我正在尝试学习特别是那些用于SOAP的Web服务。我喜欢春天!我从这里阅读教程!
http://docs.spring.io/spring-ws/sites/2.0/reference/html/tutorial.html
已经尝试了一些Ajax代码,但没有真正出现! 这个soap测试消息是由soapUI生成的,效果很好!
function callsoap()
{
var soapMessage =
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\
xmlns:sch="http://mycompany.com/hr/schemas">\
<soapenv:Header/>\
<soapenv:Body>\
<sch:HolidayRequest>\
<sch:Holiday>\
<sch:StartDate>2006-07-03</sch:StartDate>\
<sch:EndDate>2006-07-04</sch:EndDate>\
</sch:Holiday>\
<sch:Employee>\
<sch:Number>32</sch:Number>\
<sch:FirstName>ee</sch:FirstName>\
<sch:LastName>dd</sch:LastName>\
</sch:Employee>\
</sch:HolidayRequest>\
</soapenv:Body>\
</soapenv:Envelope>';
$.ajax( "http://localhost:8080/holidayService/holidayService", {
contentType: "application/soap+xml; charset=utf-8",
type: "POST", //important
dataType: "xml",
data: soapMessage
});
alert("Called Soap!");
}