What would be the best way to process a return from an http api login
function that returns one of the following two XML streams?
Successful login with a session ID returned
<?xml version="1.0" encoding="UTF-8" ?>
<CreateSessionR esponse>
<result>0</result>
<warning>Create Session succeeded</warning>
<return>
<SessionID>1126 765227212</SessionID>
</return>
</CreateSessionRe sponse>
Unsuccessful return with a fault code and message
<?xml version="1.0" encoding="UTF-8" ?>
<CreateSessionR esponse>
<fault>
<faultcode>8000 4005</faultcode>
<faultstring>Ag entIntegration error : Login failed. Reason is:
Invalid User Name or Password. Please try again.</faultstring>
</fault>
</CreateSessionRe sponse>
function that returns one of the following two XML streams?
Successful login with a session ID returned
<?xml version="1.0" encoding="UTF-8" ?>
<CreateSessionR esponse>
<result>0</result>
<warning>Create Session succeeded</warning>
<return>
<SessionID>1126 765227212</SessionID>
</return>
</CreateSessionRe sponse>
Unsuccessful return with a fault code and message
<?xml version="1.0" encoding="UTF-8" ?>
<CreateSessionR esponse>
<fault>
<faultcode>8000 4005</faultcode>
<faultstring>Ag entIntegration error : Login failed. Reason is:
Invalid User Name or Password. Please try again.</faultstring>
</fault>
</CreateSessionRe sponse>
Comment