Help with soap

(imported topic written by SystemAdmin)

Hello,

I’m new to BigFix and soap but have been tasked to learn everything about both, so bear with me. We’re on bes 7.2

I’ve created a .hta with some basic code I found on these forums to begin testing soap requests.

I’m using the files; RelevanceLogic.js and soapclient.js and they are in the same folder as my .hta. I keep getting a ‘null’ response when the .hta is run. I don’t know if I need to modify these two scripts or if they should work as is.

I’ve tested with ‘soapUI’ and am able to send and receive a response back.

I’m looking for suggestions or any other documentation that might be out there.

thanks,

Baraq

Here’s what’s in the .hta i’m using.

Result:

(imported comment written by BenKus)

Is there an error returned or just null?

Ben

(imported comment written by SystemAdmin)

I wish there was an error but null is the only thing that’s returned.

Is there a way to debug the script to see where it’s failing?

(imported comment written by MattBoyd)

bisbell

I wish there was an error but null is the only thing that’s returned.

Is there a way to debug the script to see where it’s failing?

You can debug Javascript with the Firebug extension for Firefox. I’d also recommend the Web Developer toolbar. You would probably have to (temporarily) convert your .hta file to .html.

If you don’t mind me asking, where did you get RelevanceLogic.js and soapclient.js from?

(imported comment written by SystemAdmin)

I was watching the vid for the soap api and the vista gadget, downloaded the gadget and took the two files out of it.

(imported comment written by SystemAdmin)

My .hta is correct and referencing the correct .js files. I pretty much copied exactly from what the vid on bes gadget did in it’s example.

As a different approach Boyd, I also tried out the vbs you posted here:

http://forum.bigfix.com/viewtopic.php?id=5287

It worked with no problems.

I’m checking out firebug as well.

I guess what i’m wondering is that all things being equal should I have to debug the two .js files? I was under the impression based on the vid anyway that they should work as is.

I am very new at this, am I just missing something here in my train of thought?

–Baraq

(imported comment written by MattBoyd)

I was a little curious, because I didn’t think this Javascript would work, since I thought most browsers did not allow cross-domain AJAX requests. I tested the scripts, and it looks like that may in fact be your issue. Here’s the error I receive in the javascript console:

XMLHttpRequest cannot load https://mybeswebreportsserver/webreports?wsdl. Origin null is not allowed by Access-Control-Allow-Origin.

This seems to indicate to me that this type of request isn’t allowed in a standard web browser (and presumably an hta). Maybe someone at BigFix can confirm this.

(imported comment written by SystemAdmin)

Ok, that makes sense. So I would have to make the call from within the domain the web reports server was on? or… find work around or a different method…i.e. vbs

(imported comment written by MattBoyd)

I’m hoping someone from BigFix will chime in to confirm this. Yes, you could still use vbs, php, perl, or just about anything else that send soap requests.

A good test might be to see if it will run if you put it on the same domain as the web reports server, as you suggested.

(imported comment written by SystemAdmin)

I’ll test it out next week and let ya know how it goes. I suspect it will work just fine. I did some reading on ajax and cross-domain requests, there really isn’t a viable secure method to use as a workaround.

thanks for the help Boyd.

-Baraq

(imported comment written by MattBoyd)

No problem, Baraq. Good luck!