Jump to content

Still more help needed with SOAP client


tillman.stevens

Recommended Posts

Well, I'm trying to connect to this webservice but not getting any useful data returned.

 

My code is as follows:

 

<?php

 

// Connect to agwebservice/AgemniLogin

 

        $agLogURL =    "https://www.agemni.com/_snet/AgemniLogin.asmx?WSDL";

        $myLogin->dn =        "myDN";

        $myLogin->username =  "myUserName";

        $myLogin->password =      "myPassword";

 

        $agLogin = new SoapClient($agLogURL);

 

        $agLoginResults = $agLogin->aglogin($myLogin);

 

                echo '<h2> AgemniLogin Connection: </h2>';

 

                echo '<p style="color:red"> $agLogin { soap client - agemni session login } </p>';

                echo '<p style="color:blue"> print_r: </p>';

                print_r($agLogin);

                echo '<p style="color:blue"> var_dump: </p>';

                var_dump($agLogin);

     

                echo '<hr>';

 

// get cookie information from $agLogin session

     

        $agCookie = $agLogin->_cookies;

 

                echo '<p style="color:red"> $agCookie  = $agLogin->_cookies</p>';

                echo '<p style="color:blue"> print_r: </p>';

                print_r($agCookie);

                echo '<p style="color:blue"> var_dump: </p>';

                var_dump($agCookie);

 

                echo '<hr>';

 

        $agSession = $agCookie[AGSESSION];

 

                echo '<p style="color:red"> $agSession  = $agCookie[AGSESSION]</p>';

                echo '<p style="color:blue"> print_r: </p>';

                print_r($agSession);

                echo '<p style="color:blue"> var_dump: </p>';

                var_dump($agSession);

     

                echo '<p style="color:green"> $agSession[0] = ';

                echo $agSession[0];

                echo '</p>';

 

                echo '<p style="color:green"> $agSession[1] = ';

                echo $agSession[1];

                echo '</p>';

     

                echo '<p style="color:green"> $agSession[2] = ';

                echo $agSession[2];

                echo '</p>';

 

                echo '<hr>';

 

// now connect to agwebservice/ADBAccess

 

        echo '<h2> Connect to Agemni Data Access Service  ADBAccess</h2>';

 

        $agDataURL = "http://www.agemni.com/_anet/ADBAccess.asmx?WSDL";

        $agDataClient = new SoapClient($agDataURL);

     

                echo '<p style="color:red"> $agDataClient { soap client - agemni Data Connection } </p>';

                echo '<p style="color:blue"> print_r: </p>';

                print_r($agDataClient);

                echo '<p style="color:blue"> var_dump: </p>';

                var_dump($agDataClient);

     

                echo '<hr>';

 

// set cookie information for $agDataClient

 

                echo '<p style="color:green"> try setting cookies - $agDataClient->_cookies = $agCookie </p>';

                $agDataClient->_cookies = $agCookie;

 

                echo '<p style="color:green"> then look at contents of $agDataClient again </p>';

 

                echo '<p style="color:red"> $agDataClient { soap client - agemni Data Connection } </p>';

                echo '<p style="color:blue"> print_r: </p>';

                print_r($agDataClient);

                echo '<p style="color:blue"> var_dump: </p>';

                var_dump($agDataClient);

 

                echo '<hr>';

 

                echo '<p style="color:red"> $agDataSet = $agDataClient->getCMSData($agDataParams) </p>' ;

 

                $agDataParams->opName = 'appointment';

                $agDataParams->startDate = '12/29/2010 12:01:00 AM';

                $agDataParams->endDate = '12/29/2010 4:00:00 PM';

     

                $agDataSet = $agDataClient->getCMSData($agDataParams);

             

                        echo '<p style="color:blue"> print_r($agDataSet) </p>';

                        print_r($agDataSet);

                        echo '<p style="color:blue"> var_dump($agDataSet) </p>';

                        var_dump($agDataSet);

             

                        echo '<hr>';

                     

                $agDataResult = $agDataSet->getCMSDataResult;

 

                        echo '<p style="color:red"> $agDataResult = $agDataSet->getCMSDataReult </p>';

                        echo '<p style="color:blue"> print_r($agDataResult)</p>';

                        print_r($agDataResult);

                        echo '<p style="color:blue"> var_dump($agDataResult)</p>';

                        var_dump($agDataResult);

                     

                        echo '<hr>';

 

// do var_dump of $agLogin->__getLastResponse

                echo '<p style="color:green"> var_dump($agLogin->__getLastResponse()) </p>';

                var_dump($agLogin->__getLastResponse());

             

// do var_dump of $agDataClient->__getLastResponse

                echo '<p style="color:green"> var_dump($agDataClient->__getLastResponse()) </p>';

                var_dump($agDataClient->__getLastResponse());

?>     

 

Below you will find the resulting output:

 

AgemniLogin Connection:

 

$agLogin { soap client - agemni session login }

 

print_r:

SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #4 [httpsocket] => Resource id #5 [_use_proxy] => 0 [httpurl] => Resource id #6 [_cookies] => Array ( [AGSESSION] => Array ( [0] => AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A== [1] => / [2] => www.agemni.com ) ) )

 

var_dump:

object(SoapClient)#2 (6) { ["_soap_version"]=> int(1) ["sdl"]=> resource(4) of type (Unknown) ["httpsocket"]=> resource(5) of type (stream) ["_use_proxy"]=> int(0) ["httpurl"]=> resource(6) of type (Unknown) ["_cookies"]=> array(1) { ["AGSESSION"]=> array(3) { [0]=> string(56) "AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A==" [1]=> string(1) "/" [2]=> string(14) "www.agemni.com" } } }

 

$agCookie = $agLogin->_cookies

 

print_r:

Array ( [AGSESSION] => Array ( [0] => AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A== [1] => / [2] => www.agemni.com ) )

 

var_dump:

array(1) { ["AGSESSION"]=> array(3) { [0]=> string(56) "AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A==" [1]=> string(1) "/" [2]=> string(14) "www.agemni.com" } }

 

$agSession = $agCookie[AGSESSION]

 

print_r:

Array ( [0] => AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A== [1] => / [2] => www.agemni.com )

 

var_dump:

array(3) { [0]=> string(56) "AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A==" [1]=> string(1) "/" [2]=> string(14) "www.agemni.com" }

 

$agSession[0] = AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A==

 

$agSession[1] = /

 

$agSession[2] = www.agemni.com

Connect to Agemni Data Access Service ADBAccess

 

$agDataClient { soap client - agemni Data Connection }

 

print_r:

SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #9 )

 

var_dump:

object(SoapClient)#5 (2) { ["_soap_version"]=> int(1) ["sdl"]=> resource(9) of type (Unknown) }

 

try setting cookies - $agDataClient->_cookies = $agCookie

 

then look at contents of $agDataClient again

 

$agDataClient { soap client - agemni Data Connection }

 

print_r:

SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #9 [_cookies] => Array ( [AGSESSION] => Array ( [0] => AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A== [1] => / [2] => www.agemni.com ) ) )

 

var_dump:

object(SoapClient)#5 (3) { ["_soap_version"]=> int(1) ["sdl"]=> resource(9) of type (Unknown) ["_cookies"]=> array(1) { ["AGSESSION"]=> array(3) { [0]=> string(56) "AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A==" [1]=> string(1) "/" [2]=> string(14) "www.agemni.com" } } }

 

$agDataSet = $agDataClient->getCMSData($agDataParams)

 

print_r($agDataSet)

stdClass Object ( [getCMSDataResult] => stdClass Object ( [any] => 12/29/2010 12:01:00 AM12/29/2010 4:00:00 PM ) )

 

var_dump($agDataSet)

object(stdClass)#7 (1) { ["getCMSDataResult"]=> object(stdClass)#8 (1) { ["any"]=> string(296) "12/29/2010 12:01:00 AM12/29/2010 4:00:00 PM" } }

 

$agDataResult = $agDataSet->getCMSDataReult

 

print_r($agDataResult)

stdClass Object ( [any] => 12/29/2010 12:01:00 AM12/29/2010 4:00:00 PM )

 

var_dump($agDataResult)

object(stdClass)#8 (1) { ["any"]=> string(296) "12/29/2010 12:01:00 AM12/29/2010 4:00:00 PM" }

 

var_dump($agLogin->__getLastResponse())

NULL

 

var_dump($agDataClient->__getLastResponse())

NULL

 

it should be returning data somewhere in $agDataSet or $agDataResult, but there is no data except what I submitted. I'm not certain I'm setting the cookies right, or what I might be doing wrong here.

 

Again, the documentation for their webservice is here: http://wiki.agemni.com/Getting_Started/APIs/Agemni_CMS_Sync

 

Near the bottom is an example of how to access the service using vb.net and at the bottom is an example given in Python. Not sure if they provide any additional insight, I don't do python or VB.Net so they are little help to me.

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.