angularjs - I am not able to get response from web service using Angular javascript -


var msg = document.getelementbyid('inputxml').innerhtml;how pass input xml parameter web service , displaying response web service using angular javascript in html. here code, please help, m not able reponse web service.

<div ng-app="customerapp" ng-controller="customerscontroller">      <ul>         hi<br><br><li ng-repeat="x in names">{{x}}</li>     </ul>  </div>  <script> var app = angular.module('customerapp');  app.factory(         "setasxmlpost",         function() {             //prepare request data form post.             function transformrequest(data, getheaders) {                 var headers = getheaders();               headers[ "content-type" ] = "text/xml; charset=utf-8";                 // using parsexml xml                 return(jquery.parsexml(data));             }             return(transformrequest);         } );         function customerscontroller($scope, $http, setasxmlpost) {         var msg = document.getelementbyid('inputxml').innerhtml;         $http.post("url.asmx", msg, {transformrequest: setasxmlpost}).success(function(response) {                     $scope.names = response;                 });     } </script> <div id="inputxml">     <acord> <signonrq> <userid>cuser</userid> <password>xuvidgegi/ktgyjuxfumrw==</password>     <signonpswd> <custid> < </acord> </div> 

because not retriving content of div. extracting #inputxml node dom tree. can try

var msg = document.getelementbyid('inputxml').innerhtml; 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -