且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用XML文件在PHP中请求和获取响应

更新时间:2022-11-27 18:41:49

scope.getVisaDetails = function(){


scope.formData = {};

scope.formData.ID = TESTID;

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();
       }

       };

scope.getVisaDetails = function () {


scope.formData={};


scope.formData.ID="TESTID";