Alcances 2012 Web Services

Example Code.
Demonstrating the rqGetCredentials.getCredentials Web Method Call.
Returns the following....

XML Output:
<AlcancesData>
  <ValidationRequest>
    <Status>Validated</Status>
    <UserId>xxxxxxxx</UserId>
    <Role>partner</Role>
  </ValidationRequest>
</AlcancesData>


Private Sub btnGetCredentials_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGetCredentials.Click

' get credentals

Const METHOD_NAME As String = "btnGetCredentials_Click"

Try

Dim oObj As New rqGetCredentials.getCredentials

Dim sXML As String = oObj.checkCredentials(stripIT(txtUID.Text), stripIT(txtPW.Text))

Dim dsXML As New DataSet

Dim oXMLDoc As New XmlDocument

oXMLDoc.LoadXml(sXML)

Dim oNode As XmlNode = oXMLDoc.DocumentElement.SelectSingleNode("ValidatedUser")

If Not oNode Is Nothing Then

If oNode.HasChildNodes = True Then

Dim oChild As XmlNode

For Each oChild In oNode.ChildNodes

If oChild.Name = "Status" Then

If oChild.InnerXml = "Validated" Then

lblCredential.Text = oXMLDoc.DocumentElement.SelectSingleNode("ValidatedUser/SystemCredential").InnerXml

'Store In Session Scope For Use Later??

Session.Add("ValidatedUserID", oXMLDoc.DocumentElement.SelectSingleNode("ValidatedUser/UserID").InnerXml)

Session.Add("SystemCredential", oXMLDoc.DocumentElement.SelectSingleNode("ValidatedUser/SystemCredential").InnerXml)

'Do Stuff??

Else

'Do Error Trap

End If

End If

Next

End If

End If

Catch ex As Exception

lblErrorMessage1.Text = ex.Message

'Exception occurred within this method, log it

Log.WriteLogEntry(ex, Me.CLASS_NAME, METHOD_NAME)

End Try

End Sub