Jump to content

SOAP Request Problem, Please help


garethhall

Recommended Posts

Hi

 

I have to use soap to query an api but I am having some trouble the get the right response.

 

 

Here is the API information I was supplied

 

M = mandatory

L = list parameter

1-M = list of values containing at least one value, and may contain many values

1-4 = list on values containing at least one value, and must contain no more than 4 values

 

 

Parameter                    M  L      Desciption

addressWordList            Y   1-4   A list of “keyword” elements. See table below for details.

addressTypeList            Y   1-M   May contain: “ROF”, “AFR”,”AFS” or ”ASR”

companyBodyTypeList  Y   1-M   May contain: “DOMESTIC”, “I”, “N”, “O” or “T”

companyStatusList     Y   1-M   May contain: “50”, “55”, “56,57”, “60”, “61,71”, “62”, “63,64,66”, “65”, “70”,”72”,”80”

 

"keyword" element:

Component    M    Description

keyword        Y    A word which must appear in the company’s address (any line of that address)

operation        Y    May contain: “CONTAINS”, “BEGINSWITH”

 

 

 

Notes:

1. for the “addressWordList” parameter:

a. each address word string must contain exactly one “word” (that is; do not put any <space> characters in the string)

b. every value in the list of keywords must appear in the target address data (that is; this is an “AND” search condition)

c. the list of keywords must be supplied in the same order as the words appear in the target address string. For example, for address “10 Ash Road, Nelson” enter the keywords in this order: “10”, “Ash”, “Road”, “Nelson”. Do not enter them in this order (for example):  “Nelson”, “10”, “Ash”, “Road”.

d. each address word string has leading and trailing blanks removed before being used in the search. The search is case-insensitive.

2. the element values within each “list” parameter above (other than the “addressWordList” parameter – described separately) will be used in an “OR” search condition (one or more of the individual element values must exist in the target data) to create the filter for that individual parameter. For example, the following partial filter condition is possible: (body_type = ‘U’ OR body_type = ‘X’ OR body_type = ‘P’ OR body_type = ‘L’ OR body_type = ‘O’) AND (status = ‘50’ OR status = ‘80’)

3. for the “addressTypeList” parameter: see the appendix for a description of each code

4. for the “companyBodyTypeList” parameter: the value “DOMESTIC” may be used to narrow the search to companies with body types of U, X, P or L (“unlisted company”, “private company”, “public company” or “listed”).

5. for the “companyStatusList” parameter: the value “61,71” is not a typing error. It may be used to narrow the search to companies with a status of 61 or 71.  The same applies for the values “63,64,66” and “56,57”.

 

 

This is my code

 

And I get this error:

"Fatal error: Uncaught SoapFault exception: [soapenv:Server.generalException] At least one address word must be specified, but no more than four in /Users/garethhall/Sites/querytool/public_html/index.php:58 Stack trace: #0 [internal function]: SoapClient->__call('performAddressS...', Array) #1 /Users/garethhall/Sites/querytool/public_html/index.php(58): SoapClient->performAddressSearch(Array) #2 {main} thrown in /Users/garethhall/Sites/querytool/public_html/index.php on line 58"

 

<?php
$CompanyMiscSearchService = new SoapClient('http://ws.eat.business.govt.nz/med-services/services/CompanyMiscSearchService.svc?wsdl');

$result = $CompanyMiscSearchService->performAddressSearch(array(
'addressWordList' => array('auckland'),
'addressTypeList' => 'ROF',
'directorStatus' => array('valueString' => 'CURRENT'),
'companyBodyTypeList' => array('valueString' => 'DOMESTIC'),
'companyStatusList' => array('valueString' => 50 ),
));

print '<pre>';
print_r($result);
print '</pre>';

?>

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/241617-soap-request-problem-please-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.