本文介绍了如何使用XML文件在PHP中请求和获取响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用此URL上的xml文件通过以下凭据请求以获得PHP响应请帮助我。



您可以使用以下方式连接到IVA Visa XML服务以下测试服务点URL: - http://app.ivsource.com/services/visa



测试POS凭据是: -



Id =TESTID



UserName =TESTUSER



密码=TESTPASSWORD



搜索请求样本XML



< soap:envelope xmlns: soap =http://schemas.xmlsoap.org/soap/envelope/soap:encodingstyle =http://schemas.xmlsoap.org/soap/encoding/> <肥皂:体> < ivsource xmlns =http://www.IVSource.com/IVACONT/Global> < iva_visasearchrequest> < POS> < source id =TESTIDusername =TESTUSERpassword =TESTPASSWORD/> < visasearchrequest> < countrydetails> < country code =SG>



我的尝试:



 $ scope.getVisaDetails = function(){

$ scope.formData = {};
$ scope.formData.ID =TESTID;
$ scope.formData.Username =TESTUSER;
$ scope.formData.Password =TESTPASSWORD;
$ scope.formData.Countrycode =SG;

var res = $ http.post('http://app.ivsource.com/services/visa',$scope.formDatas);


res.success(函数(数据,状态,标题,配置){

$ scope.data = data;

});
res.error(function(data,status,headers,config){
});

else {

$ scope.alertMessage();
}

};
解决方案




How to request by below credential with xml file on this URL to get response in PHP please help me.

You can connect to IVA Visa XML services with the following test service point URL:- http://app.ivsource.com/services/visa

And the test POS credentials are:-

Id = "TESTID"

UserName = "TESTUSER"

Password = "TESTPASSWORD"

Search Request Sample XML

<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"> <soap:body> <ivsource xmlns="http://www.IVSource.com/IVACONT/Global"> <iva_visasearchrequest> <pos> <source id="TESTID" username="TESTUSER" password="TESTPASSWORD" /> <visasearchrequest> <countrydetails> <country code="SG">

What I have tried:

$scope.getVisaDetails = function () {

           $scope.formData={};
           $scope.formData.ID="TESTID";
           $scope.formData.Username="TESTUSER";
           $scope.formData.Password="TESTPASSWORD";
           $scope.formData.Countrycode="SG";

           var res = $http.post('http://app.ivsource.com/services/visa',$scope.formDatas );


       res.success(function(data, status, headers, config) {

           $scope.data = data;

       });
       res.error(function(data, status, headers, config) {
       });

       else{

           $scope.alertMessage();
       }

       };
解决方案




这篇关于如何使用XML文件在PHP中请求和获取响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 20:25