Jump to content

Recommended Posts

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]

Link to comment
https://forums.phpfreaks.com/topic/224712-soap-help/
Share on other sites

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));

Link to comment
https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1160722
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1160850
Share on other sites

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

 

Link to comment
https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1162073
Share on other sites

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);

Link to comment
https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1162331
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/224712-soap-help/#findComment-1162464
Share on other sites

  • 2 years later...
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.