cgishack Posted April 18, 2007 Share Posted April 18, 2007 I am trying to connect to a Web Service using SOAP. Right now I connect using the code below.... $client = new SoapClient( $wsdlUrl ); But the first thing I must do is call a method called Connect_v1. But it takes a TOKEN ? So it should look like so.... $client->Connect_v1( $token ); But what is a token ? How can I create a Token ? I did the same program in ASP.NET C# and the token was like so. (but it was something I found online) byte[] token = new byte[1]; Can someone help me make a token in php ? Thanks Drew Link to comment https://forums.phpfreaks.com/topic/47629-what-is-a-token/ Share on other sites More sharing options...
boo_lolly Posted April 18, 2007 Share Posted April 18, 2007 where are you getting this code from? i don't see it in the manual http://us.php.net/soap Link to comment https://forums.phpfreaks.com/topic/47629-what-is-a-token/#findComment-232576 Share on other sites More sharing options...
cgishack Posted April 18, 2007 Author Share Posted April 18, 2007 The Connect_v1() is a method in the web service I am connecting too. I have to connect to an image warehouse , it requires this to be done. any ideas ? Drew Link to comment https://forums.phpfreaks.com/topic/47629-what-is-a-token/#findComment-232645 Share on other sites More sharing options...
cgishack Posted April 18, 2007 Author Share Posted April 18, 2007 Below is the error I am getting PHP Fatal error: Uncaught SoapFault exception: [soap:Server] Server was unable to process request. --> Object reference not set to an instance of an object. in C:\ArcIMS\Website\PhpPicto\test.php:27 Stack trace: #0 [internal function]: SoapClient->__call('Connect_v1', Array) #1 C:\ArcIMS\Website\PhpPicto\test.php(27): SoapClient->Connect_v1(Array) #2 {main} thrown in C:\ArcIMS\Website\PhpPicto\test.php on line 27 Link to comment https://forums.phpfreaks.com/topic/47629-what-is-a-token/#findComment-232650 Share on other sites More sharing options...
per1os Posted April 18, 2007 Share Posted April 18, 2007 A token...isn't that a black child on South Park? Anyhow a Token is generally a encrypted string that houses important data to login to a system remotely. Generally used for API/web services. They pass tokens back and forth so you know that the person is valid. So lets say I am accessing site 2 from site 1. In order for site 2 to know I am a valid user a token must have been created and sent to site 1 to use for each of it's call to site 1. The tokens usually expire in 20 minutes or so for security reasons, but are generally never seen from the public. In order to retrieve a valid token you must have access to the API/Web service which may require a KEY of some type that you enter in as your HOST KEY or something that needs to be passed to the site so it knows that your site can indeed receive and dish out tokens for users using your website. Fun stuff anyhow. I would look at the FAQ or contact the image warehouse and ask them about the token. Link to comment https://forums.phpfreaks.com/topic/47629-what-is-a-token/#findComment-232652 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.