title: Meteor.call returning undefined from server to client
body: <p>I am trying to make a HTTP call to a remote server in my app</p>
  
  <p>i have a package with a function which handles the actual call and then converts the xml to json</p>
  
  <pre><code>myPackage = {
  baseUrl: "http://12.34.56.78:8080/api",
  
  getBatchList: function() {
      var url = this.baseUrl + "/batchList.xml";
  
      HTTP.get(url, {auth: "user:pass"}, function(err, res) {
          if (!err) {
              console.log(res);
              xml2js.parseStringSync(res.content, function(error, result){
                  if (!error) {
                      console.log(result); //the result is displayed
                      return result;
                  };
              });
          };
      });
  }
  }
  </code></pre>
  
  <p>i then have a Meteor.method declared on the server so I can invoke the function from the client since myPackage is only available on the server (which it must be, since its making http calls to outside the domain which i cant do from the client).</p>
  
  <pre><code>if (Meteor.isServer) {
  Meteor.methods({
      getBatchList: function() {
          myPackage.getBatchList(function(error, result) {
              if (!error &amp;&amp; result) {
                  console.log(result); //nothing is logged to the console
                  return result;
              };
          });
      }
  })
  }
  </code></pre>
  
  <p>however it seems that results are not being passed into the <code>getBatchList</code> method for some reason, which i suspect is that the i have something wrong with the way the callback is being structured (i have no clue);</p>
  
  <p>and lastly on the client is calling the method</p>
  
  <pre><code>if (Meteor.isClient) {
  Template.hello.events({
      'click input' : function () {
  
          Meteor.call("getBatchList", function(error, result) {
              if (result &amp;&amp; !error) {
                  console.log(result);
              } else {
                  console.log("nothing returned!!!");
              };
          });
      }
  });
  }
  </code></pre>
  
  <p>which would also not get any results from the server no error or result.</p>
  
  <p>any help would be appreciated.</p>
  
  <p>thanks.</p>