Before accessing a customer’s information, you may want to check to see if a user is authorized to access the customer. All gateway methods check to ensure the supplied username has the necessary access with attempting to access data. Based on the business case a separate check before making a series of calls could be beneficial.
Here is an example of how you check a user’s authorization for a customer:
/* Get a reference to the web service */
using (GatewaySample.net.clearstar.gateway.user.User gwService = new GatewaySample.net.clearstar.gateway.user.User())
{
/* Check user authorization for a customer. */
XmlNode nodeUser = gwUser.AuthorizeUser("myUserName", "myPassword", myBOID, “LoginNameToCheck”, “LoginPassword”,"myCustID");
}
XML Response:
<AuthorizeUser xmlns="">
<ErrorStatus>
<Code></Code>
<Type></Type>
<Message></Message>
</ErrorStatus>
<User>
<sFirstName></sFirstName>
<sLastName></sLastName>
<bAuthorized></bAuthorized>
</User>
</AuthorizeUser>
Additional information is provided in the documentation and more example code is provided in the Gateway Sample application.