Help with Pear Soap Client to weather service [message #186373] |
Thu, 10 July 2014 07:16 |
|
Hello,
I am trying to do a simple soap call to a weather service and I keep getting Invalid ZIP error. Can someone tell me what I am doing wrong below is my code.
Thanks
require_once 'SOAP/Client.php';
$client = new Soap_Client('http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL');
$method = 'GetCityWeatherByZIP';
$params = array('ZIP' => '07108');
$result = $client->call($method, $params);
if (PEAR::isError($result)) {
echo $result->getMessage();
} else {
print_r($result);
}
|
|
|
|
|
|
Re: Help with Pear Soap Client to weather service [message #186377 is a reply to message #186375] |
Thu, 10 July 2014 10:33 |
|
On 7/10/2014 9:40 AM, mceexpert(at)gmail(dot)com wrote:
>> On Thursday, July 10, 2014 8:45:57 AM UTC-4, Jerry Stuckle wrote:
>> Did you ask cdyne? They know their APIs better than anyone else.
>>
>
> There is no problem with cdyne webservice because it works from my desktop app.
>
I didn't say there was a problem with their web service. I asked if you
asked THEM for help with THEIR APIs.
Also, please learn to trim appropriately - or better yet, get a real
usenet reader.
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
|
|
|
|
|
Re: Help with Pear Soap Client to weather service [message #186380 is a reply to message #186379] |
Thu, 10 July 2014 14:47 |
Doug Miller
Messages: 171 Registered: August 2011
Karma: 0
|
Senior Member |
add to buddy list ignore all messages by this user
|
|
Doug Miller <doug_at_milmac_dot_com(at)example(dot)com> wrote in
news:XnsA366945EB2C55dougmilmaccom(at)78(dot)46(dot)70(dot)116:
> mceexpert(at)gmail(dot)com wrote in
> news:bb68260a-cb54-4763-8fe6-dde47f1ae42a(at)googlegroups(dot)com:
>
>> I am trying to do a simple soap call to a weather service and I
>> keep getting Invalid ZIP error. Can someone tell me what I am
>> doing wrong below is my code.
>>
> [...]
>> $method = 'GetCityWeatherByZIP';
>> $params = array('ZIP' => '07108');
>> $result = $client->call($method, $params);
>
> Four obvious possible explanations for the error message you're seeing:
> 1) an associative array is not the correct structure to use for passing this parameter
> 2) 'ZIP' is the wrong name
> 3) a five-character string is not the expected format for the zip code data
> 4) 07108 is not a valid zip code
Let me add a fifth obvious possible explanation:
5) everything you have is correct, but it's incomplete: some required label/value pair is
missing, such as a userID or password
>
> What have you done to eliminate each of these as a possible cause of the problem?
>
|
|
|
Re: Help with Pear Soap Client to weather service [message #186381 is a reply to message #186380] |
Thu, 10 July 2014 15:31 |
|
I appreciate the responses and I was able to get the web service to work with Microsoft.Net and the built-in PHP SoapClient on my local server. I am not familar with Pear but unfortunately my client hosting company does not support the built-in PHP SoapClient. From my research the code I created should work. Also 07108 is a valid zip code.
Thanks
|
|
|
|
|
|