WSDL to SOAP Envelope
WSDL to SOAP Envelope
我有一个WSDL web服务http://portal.strongtech.com/i/services/ivos?wsdl,我想使用AJAX向函数发送请求。我知道如何使用AJAX或JQuery发送请求,虽然我不确定如何为我想要请求的功能编写SOAP信封。
你能帮我写SOAP信封从给定的服务URL登录功能?非常感谢。
检查call- SOAP - xml -web-services-with- jQuery -ajax和jQuery Plugin SOAP
下面是一个来自http://www.icloud.com/wiki/index.php/Getting_started_-_jquery_ajax_guide
的例子<html>
<head>
<script type="text/javascript" src="http://os.icloud.com/live/jqueryloader.js"></script>
<script type="text/javascript">
function printResult(doc, status, xhr) {
var p = document.getElementById("output");
if( status == "error" ) {
p.innerHTML = doc.responseText.replace(/</g, "<");
login("/", "/"); // reset username
} else {
p.innerHTML = xhr.responseText.replace(/</g, "<");
}
}
function createSoapEnvelope(contents) {
return '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ' +
'SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' +
'<SOAP-ENV:Body>' + contents + '</SOAP-ENV:Body></SOAP-ENV:Envelope>';
}
function login(username, password, callback, errback) {
icloud.ajax({
type: "POST",
async: true,
cache: false,
contentType: "text/xml; charset=utf-8",
dataType: "xml",
processData: false,
url: "http://os.icloud.com/v1/",
username: username,
password: password,
data: createSoapEnvelope("<login/>"),
beforeSend: function(xhr) {
xhr.setRequestHeader("SOAPAction", "login");
},
success: callback,
error: errback
});
}
function buttonClicked() {
login(document.getElementById("username").value, document.getElementById("password").value, printResult, printResult);
}
initIcloudAPI();
</script>
</head>
<body>
<h2>Login example</h2>
username:<input type="text" name="username" id="username"/>
password:<input type="password" name="password" id="password"/>
<input type="submit" name="login" value="Login" onclick="buttonClicked()"/>
<p id="output"/>
</body>
</html>
相关文章:
- 使用带有JavaScript的SOAP WebService
- 如何通过安全的https连接在javascript中使用基于soap xml的Web服务
- 从Javascript连接到SOAP Web服务
- 显示IIS上javascript文件(SOAP请求)的XML响应
- 如何使用java脚本或jquery发送跨域SOAP请求
- 无法获取SOAP请求的响应文本
- 如何在javascript或jquery中调用 asp.net 基于3.5 soap xml的Web服务
- 通过jQueryAJAX的SOAP请求
- 在 Node-soap (node.js) 中发送带有数组的请求
- JavaScript SOAP客户端接收到null
- 如何使用JavaScript创建带有SOAP消息的请求
- 执行SOAP xml请求
- 对SOAP服务的Preflight OPTIONS请求不起作用
- 为初学者实现基本REST/SOAP服务器和客户端的最快速方法
- 使用XPath在JavaScript中解析(基于SOAP的)XML
- 将php-soap请求转换为javascript
- 响应字段包含一个子级时的节点 SOAP 强制数组
- Meteor js using webservices SOAP using package zardak/soap
- 允许从 JavaScript 到 GlassFish 上的 SOAP Web 服务的跨源
- WSDL to SOAP Envelope