Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving xml reply

Status
Not open for further replies.

christianhau

Programmer
Jul 19, 2007
2
0
0
NO
Hi!

I am building a single sign on solution that uses tickets to validate logins. A user wants to log in and is assigned a ticket, now the user has to validate this ticket and therefore goes to a validationpage with the ticket as a querystring. If the ticket is validated properly the validation site returns the username in xml form, like this:

<cas:serviceResponse xmlns:cas=' <cas:authenticationSuccess>
<cas:user>user@online.no </cas:user>

</cas:authenticationSuccess>
</cas:serviceResponse>

The validation request happens from one server while the validation and xml reply comes from the validation server. My question is how can I retrieve the <cas:authenticationSuccess> for example? If the validation is sucsessful then this is all I need.. I have code for it in asp.net but cannot seem to find anything equivalent to the httpwebrequest that you can perform in asp.net.. Any help is very much appreciated!!
 
Suppose oxml is the DOMDocument object you're using on the server which is done with retrieving the response (without parsing error I suppose). To determine the authentication, the main ingredients are contained in these sketch.
[tt]
with oxml 'suppose here oxml is not nothing
.setProperty "SelectionLanguage","XPath"
.setProperty "SelectionNamespaces","xmlns:cas='end with
set onode=oxml.selectSingleNode("/cas:serviceResponse/cas:authenticationSuccess/cas:user")
if onode is nothing
'authentication fails, do something
else
'authentication succeeds, do something else
end with
[/tt]
 
amendment
>[self]if onode is nothing
should be read, sure, like this.
[tt]if onode is nothing [red]then[/red][/tt]
 
Thank you!
Hmm, I have tried a similar approach before but somehow whenever I try to load the page using objXML.Load or any similar techniques I just get errors on retrieving the information... I have tried with a different page and it works but my page doesn't. Is it because my page has to be generated first? Since the server has to do some validation before the xml is returned. But I cannot see why it doesnt return my xml like it should...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top