如何在AngularJs中发送XML原始数据

时间:2016-03-11 11:31:54

标签: javascript php angularjs

这是我的角度js代码

var soapMessage = '<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns5862:clearTripHotelWrapper xmlns:ns5862="http://tempuri.org"><details><serviceName xsi:type="xsd:string">Cleartrip_HotelSearchService</serviceName><format xsi:type="xsd:string">json</format><checkIn xsi:type="xsd:string">2016-04-24</checkIn><checkOut xsi:type="xsd:string">2016-04-25</checkOut><noOfRooms xsi:type="xsd:string">1</noOfRooms><adultPerRoom xsi:type="xsd:string">1</adultPerRoom><childPerRoom xsi:type="xsd:string">1</childPerRoom><city xsi:type="xsd:string">Chennai</city><state xsi:type="xsd:string"></state><country xsi:type="xsd:string">IN</country></details></ns5862:clearTripHotelWrapper></SOAP-ENV:Body></SOAP-ENV:Envelope>';

var url = '';
var headers = {
    'Content-Type': 'text/xml; charset=utf-8'
};

var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
  $http.post(url, soapMessage ,{ "headers": headers }).success(function (data) {

  });
});

我的错误是

my php fatal error

console error

0 个答案:

没有答案