2 Replies - 347 Views - Last Post: 02 October 2012 - 09:10 AM Rate Topic: -----

#1 awebb  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 12
  • Joined: 08-March 09

Soapclient

Posted 02 October 2012 - 08:08 AM

I have struggled for a couple days trying to get a php page to properly utilize a web service. The web service is working properly as it can be consumed by a vb.net application with no issues. The problem with this page is the $result always evaluates to true even if incorrect username and password are entered. $_REQUEST["txtUN"] and $_REQUEST["txtPW"] contain the username and password entered by user. Here is the php code

function login()
		{					
		$test = array('UN' => $_REQUEST["txtUN"], 'PW' => $_REQUEST["txtPW"]);
		$objClient = new SoapClient('http://www.example.org/services/LoginWS/Service.asmx?wsdl');
		$result = $objClient->isAuthenticated($test);
		var_dump($result);
					
		if ($result == true){
		     print '<script type="text/javascript">alert("Success")</script>';}




Also, var_dump($result) displays: "object(stdClass)#2 (1) { ["isAuthenticatedResult"]=> bool(false) }"
Thanks in advance for your help. I am a .net developer and not familiar with php.

I should have also noted that var_dump($result) displays: "object(stdClass)#2 (1) { ["isAuthenticatedResult"]=> bool(true) }" when a correct username/password pair are entered. So it seems the web service is returning a proper response I am just not evaluating it properly.

This post has been edited by Dormilich: 03 October 2012 - 12:10 AM
Reason for edit:: changed domain


Is This A Good Question/Topic? 0
  • +

Replies To: Soapclient

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6058
  • View blog
  • Posts: 23,495
  • Joined: 23-August 08

Re: Soapclient

Posted 02 October 2012 - 08:37 AM

Well, the return value is an object, as you can see. Looks like you probably want

if ($result->isAuthenticatedResult)

Was This Post Helpful? 2
  • +
  • -

#3 awebb  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 12
  • Joined: 08-March 09

Re: Soapclient

Posted 02 October 2012 - 09:10 AM

Thanks Jack, that corrected the problem. I could tell it was an object but wasn't sure what to change.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1