-2

The code below is a web service call to ICEPortal which is in JScript.NET format. Currently Iceportal doesn't have a webservice call using javascript. Has anybody done this using javascript? I need your help to convert the code below to javascript format.

// JScript.NET
    var h:ICEPortal.ICEWebService = new ICEPortal.ICEWebService();
    var myHeader:ICEPortal.ICEAuthHeader = new ICEPortal.ICEAuthHeader();
    myHeader.Username = "distrib@distrib.com";
    myHeader.Password = "password";
    h.ICEAuthHeaderValue = myHeader;
    var brochure:ICEPortal.Brochure;
    var ErrorMsg;
    var result = h.GetBrochure("MyMappedID", ErrorMsg, brochure);
rojo
  • 24,000
  • 5
  • 55
  • 101
cronLancer
  • 349
  • 2
  • 3

1 Answers1

1

I think you just need to remove the type definitions (in bold below):

var myHeader :ICEPortal.ICEAuthHeader = new ICEPortal.ICEAuthHeader();)

No idea what the ICEPortal classes are, but if they are available to your Javascript in the global namespace, the following should work. I've added these stubs in for the ICEPortal to test and it works fine for me in Chrome.

You'll obviously want to remove the stubs.

// stubbing out ICEPortal(s)
ICEPortal = {};
ICEPortal.ICEWebService = function() { return true; };
ICEPortal.ICEAuthHeader = function() { return true; };
ICEPortal.ICEWebService.prototype.GetBrochure = function() { return true; };
// end stubbing ICEPortal(s)

var h = new ICEPortal.ICEWebService();
var myHeader = new ICEPortal.ICEAuthHeader();
myHeader.Username = "distrib@distrib.com";
myHeader.Password = "password";
h.ICEAuthHeaderValue = myHeader;
var brochure;
var ErrorMsg;
var result = h.GetBrochure("MyMappedID", ErrorMsg, brochure);
lathonez
  • 2,313
  • 1
  • 9
  • 12