1
所以在我们公司,我们使用SOAP API来连接到我们的系统,并且我很好地排练过它,并且可以使用所有的调用。执行SOAP xml请求
我只想知道从哪里开始,如果我想构建一个可以执行API查询的测试着陆页。
如果可能,我宁愿用JavaScript来做,因为我们没有在我们的服务器上安装PHP。
寻找从哪里开始一些方向 - 我只是打算从一个文本框和地方采取XML请求中的值,并执行它:)
赞赏任何指针!
所以在我们公司,我们使用SOAP API来连接到我们的系统,并且我很好地排练过它,并且可以使用所有的调用。执行SOAP xml请求
我只想知道从哪里开始,如果我想构建一个可以执行API查询的测试着陆页。
如果可能,我宁愿用JavaScript来做,因为我们没有在我们的服务器上安装PHP。
寻找从哪里开始一些方向 - 我只是打算从一个文本框和地方采取XML请求中的值,并执行它:)
赞赏任何指针!
<script>
function fireRequest(){
..
//parse your SOAP Request and set the request with 'dataContent'
...
var url = //your target gateway here Java/PHP or your web service recpetor
var postStr =//xml SOAP resquest ;
makeRequest(url, postStr);
}
function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest(); //Mozilla, Safari ...
} else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP"); //IE
} else {
alert("Your Browser does not support XMLHTTP");
}
}
function makeRequest(url, param) {
//If our readystate is either not started or finished, initiate a new request
//clearing all divs
receiveReq = getXmlHttpRequestObject();
if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
//Set up the connection to captcha_test.html. True sets the request to asyncronous(default)
receiveReq.open("POST", url, true);
//Set the function that will be called when the XmlHttpRequest objects state changes
receiveReq.onreadystatechange = responseHandler;
//Add HTTP headers to the request
receiveReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
receiveReq.setRequestHeader("Content-length", param.length);
receiveReq.setRequestHeader("Connection", "close");
//Make the request
receiveReq.send(param);
}
}
function responseHandler(){
if (receiveReq.readyState == 4) {
var response = receiveReq.responseText;
if(response){
//do what ever you want with the response XML
}
}
}
</script>
这对你的情况就足够了。使用您网页上的方法。