tobeyt23 Posted January 17, 2011 Share Posted January 17, 2011 I am trying to connect to ASC web service to do queries, however nothing seems to work. This is was i started with just to test and I am getting nothing also attached are the instructions I was provided: <?php $asc = new SoapClient('https://www.asc.gov/wsvc/ASCQuerySvc.asmx'); return $asc->GetQueryableFields(); ?> Any help would be appreciated. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/ Share on other sites More sharing options...
bh Posted January 17, 2011 Share Posted January 17, 2011 Hi, You need the WSDL file: <?php $asc = new SoapClient('https://www.asc.gov/wsvc/ASCQuerySvc.asmx?WSDL'); return $asc->GetQueryableFields(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1160669 Share on other sites More sharing options...
tobeyt23 Posted January 17, 2011 Author Share Posted January 17, 2011 How do i run a query I can't figure this out! Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1160687 Share on other sites More sharing options...
tobeyt23 Posted January 17, 2011 Author Share Posted January 17, 2011 This doesn't seem to work any suggestions? $asc = new SoapClient('https://www.asc.gov/wsvc/ASCQuerySvc.asmx?WSDL'); $fields = array('St_Abbr','Lic_Number','Lname','Fname','Mname','Name_Suffix','Eff_Date','Exp_Date','Lic_Type','Status','Company','Phone','Street','City','State','County_Code','Zip','Edi_Capability','Action_Code','Start_Date','End_Date'); $filters = array(array('FieldName'=>'Lname','Operator'=>'Equals','Operands'=>'Smith')); print_r($asc->RunQuery(null, $fields, $filters, true, 0)); Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1160722 Share on other sites More sharing options...
BlueSkyIS Posted January 17, 2011 Share Posted January 17, 2011 suggestion: explain what "doesn't work". are there errors? do you have error_reporting turned on? <?php error_reporting(E_ALL); ini_set("display_errors", -1); ?> Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1160782 Share on other sites More sharing options...
tobeyt23 Posted January 17, 2011 Author Share Posted January 17, 2011 Fatal error: Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object. at ASCv3WS.Utils.AreOutputFieldsValid(DataTable dt, String[] outputFields, Boolean& ShowDiscipline, Boolean isAuthenticated) at ASCv3WS.Utils.ConstructQuery(String[] outputFields, FilterCondition[] filters, Boolean& showDiscipline, Int32 maxResults, Boolean isAuthenticated, Boolean& bIsLicenseNumberSpecified, Boolean& bIsSt_AbbrSpecified, Boolean& bIsLicTypeSpecified) at ASCv3WS.Utils.ExecuteQuery(String[] outputFields, FilterCondition[] filters, Boolean showDiscipline, Int32 maxResults, Boolean isAuthenticated) at ASCv3WS.ASCQuerySvc.RunQuery(String[] outputFields, FilterCondition[] filters, Boolean showDiscipline, Int32 maxResults) --- End of inner exception stack trace --- in /Applications/MAMP/htdocs/asc.php:13 Stack trace: #0 [internal function]: SoapClient->__call('RunQuery', in /Applications/MAMP/htdocs/asc.php on line 13 Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1160850 Share on other sites More sharing options...
tobeyt23 Posted January 18, 2011 Author Share Posted January 18, 2011 Any ideas on this? Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1161346 Share on other sites More sharing options...
tobeyt23 Posted January 19, 2011 Author Share Posted January 19, 2011 here is my current code and error i am getting: $asc = new SoapClient('https://www.asc.gov/wsvc/ASCQuerySvc.asmx?WSDL'); $fields = array('St_Abbr','Lic_Number','Lname','Fname','Mname','Name_Suffix','Eff_Date','Exp_Date','Lic_Type','Status','Company','Phone','Street','City','State','County_Code','Zip','Edi_Capability','Action_Code','Start_Date','End_Date'); $filters = array(array('FieldName'=>'Lname','Operator'=>'Equals','Operands'=>'Smith'), array('FieldName'=>'Fname','Operator'=>'Equals','Operands'=>'Bob')); return $asc->RunQuery($fields, $filters, true, 0); Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object hasn't 'showDiscipline' property in /Applications/MAMP/htdocs/asc.php:11 Stack trace: #0 [internal function]: SoapClient->__call('RunQuery', Array) #1 /Applications/MAMP/htdocs/asc.php(11): SoapClient->RunQuery(Array, Array, true, 0) #2 {main} thrown in /Applications/MAMP/htdocs/asc.php on line 11 Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1162073 Share on other sites More sharing options...
tobeyt23 Posted January 20, 2011 Author Share Posted January 20, 2011 updated the code and still same error, i am banging my head what am i doing wrong: error_reporting(E_ALL); ini_set("display_errors", -1); class FilterCondition { public $FieldName; public $Operator; public $Operands; } $oFilter1 = new FilterCondition; $oFilter1 -> FieldName = 'Lname'; $oFilter1 -> Operator = 'Equals'; $oFilter1 -> Operands = 'Smith'; $oFilter2 = new FilterCondition; $oFilter2 -> FieldName = 'Fname'; $oFilter2 -> Operator = 'Equals'; $oFilter2 -> Operands = 'Bob'; $asc = new SoapClient('https://www.asc.gov/wsvc/ASCQuerySvc.asmx?WSDL'); $filters = (object)array($oFilter1, $oFilter2); $fields = array('St_Abbr','Lic_Number','Lname','Fname','Mname','Name_Suffix','Eff_Date','Exp_Date','Lic_Type','Status','Company','Phone','Street','City','State','County_Code','Zip','Edi_Capability','Action_Code','Start_Date','End_Date'); return $asc->RunQuery(null, $fields, $filters, true, 0); Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1162331 Share on other sites More sharing options...
BlueSkyIS Posted January 20, 2011 Share Posted January 20, 2011 what is the return supposed to do at the end of the script? do you mean echo? return should 'return' from a function. also, there doesn't appear to be a method RunQuery for SoapClient object: http://php.net/manual/en/class.soapclient.php Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1162351 Share on other sites More sharing options...
tobeyt23 Posted January 20, 2011 Author Share Posted January 20, 2011 When I run this it works fine, not sure what I am doing that is wrong: $asc = new SoapClient('https://www.asc.gov/wsvc/ASCQuerySvc.asmx?WSDL'); var_dump($asc->GetQueryableFields()); This returns the Queryable Fields the RunQuery gives me the error Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1162464 Share on other sites More sharing options...
Waheed Posted January 28, 2013 Share Posted January 28, 2013 I have the same Issue can any one suggest the solution ? Quote Link to comment https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1408690 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.