I am using the http xml/rest sensor

The xml result is: <int>15</int>

I configured the sensor with "int" as the XML Node

However, I get the error: Node int not found in xml result.

In another case, the xml result is: <AddResponse><AddResult>50</AddResult></AddResponse>

I configured the sensor with "AddResponse AddResult" as the XML Node

However, I get the error" Node AddResponse AddResult not found in the xml result.

Can anyone please advise on what I may be doing wrong. Or make some suggestions on how I can debug this.

Thank you.


Article Comments

What is the url you are using? I would like to reproduce this.

Regards,


Nov, 2011 - Permalink

The url: http://myprtg.swiftng.com:8691/RestService1.svc/

Result: <AddResponse><AddResult>50</AddResult></AddResponse>

The url: http://myprtg.swiftng.com:8691/RestService1.svc/get2/

Result: <int>15</int>


Thanks,


Nov, 2011 - Permalink

These url's are not public accessible, so I cannot do any testing with them.

Are you sure that the result you are mentioning is the complete result you are getting (I seem to be missing a root element here) or is this just a part of the result?

I would like to see the complete xml result you are getting.

Regards,


Nov, 2011 - Permalink

Thanks for your prompt response Gerard.

The urls are available publicly. Perhaps the dns has not fully propagated as I only did the mapping a few hours ago. Anyway, I am able to access them using the anonymous proxy: www.kproxy.com. Can you try accessing them from this proxy?

Thank you, Bassey


Nov, 2011 - Permalink

Hi Bassey,

Using the proxy I can access the url's.

I now also noticed the xml namespaces that are included in both xml results.

<AddResponse xmlns="http://tempuri.org/"><AddResult>50</AddResult></AddResponse>

They are the reason why the sensor is not working as they are not formatted as expected.

If you have any influence on the xml that is produced by the web service, please omit the namespace and the sensor will work. If not, no worries, it will also be fixed in the next PRTG version.

Regards,


Nov, 2011 - Permalink

Ok. I don't think I have any influence over the namespace as it seems to be browser dependent. I use firefox and didn't see the namespace. However, I notice that when i use ie, it shows up.

I also tried using the "Characters to Remove" field by specifying the name space in this field in the hope that it will be removed but that didn't seem to work. Can you think of any work around as I really need this to work as soon as possible.

Thanks a lot for your help.

Bassey


Nov, 2011 - Permalink

Hi Bassey,

If you contact me directly, I'll drop you a link to an updated version of the sensor. My email address can be found at http://code.google.com/p/prtg-addons/wiki/PTF_Custom_Sensors in the left pane under "feedback"

Regards,


Nov, 2011 - Permalink