FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Help with Pear Soap Client to weather service
Show: Today's Messages :: Unread Messages :: Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Help with Pear Soap Client to weather service [message #186373] Thu, 10 July 2014 07:16 Go to next message
mceexpert is currently offline  mceexpert
Messages: 3
Registered: July 2014
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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);
}
Message by Jerry Stuckle is ignored  [reveal message]  [reveal all messages by Jerry Stuckle]  [stop ignoring this user] Go to previous messageGo to next message
Re: Help with Pear Soap Client to weather service [message #186375 is a reply to message #186374] Thu, 10 July 2014 09:40 Go to previous messageGo to next message
mceexpert is currently offline  mceexpert
Messages: 3
Registered: July 2014
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
> 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.
>
>
>
>
>
> --
>
> ==================
>
> Remove the "x" from my email address
>
> Jerry Stuckle
>
> jstucklex(at)attglobal(dot)net
>
> ==================

There is no problem with cdyne webservice because it works from my desktop app.
Re: Help with Pear Soap Client to weather service [message #186376 is a reply to message #186375] Thu, 10 July 2014 10:00 Go to previous messageGo to next message
Christoph Michael Bec is currently offline  Christoph Michael Bec
Messages: 207
Registered: June 2013
Karma: 0
Senior Member
remove from buddy list
stop ignoring messages by this user
Am 10.07.2014 15:40, schrieb mceexpert(at)gmail(dot)com:

> There is no problem with cdyne webservice because it works from my
> desktop app.

Well, the summary on <http://pear.php.net/package/SOAP/redirected> says:

| **Use PHP's in-built SOAP client!**

They may have good reasons to recommend that. :)

Please avoid the broken Google Groups when posting to Usenet.

--
Christoph M. Becker
Message by Jerry Stuckle is ignored  [reveal message]  [reveal all messages by Jerry Stuckle]  [stop ignoring this user] Go to previous messageGo to next message
Re: Help with Pear Soap Client to weather service [message #186378 is a reply to message #186375] Thu, 10 July 2014 14:28 Go to previous messageGo to next message
Doug Miller is currently offline  Doug Miller
Messages: 171
Registered: August 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
mceexpert(at)gmail(dot)com wrote in news:da408cbc-5d59-473b-8284-
064c8dc90b8e(at)googlegroups(dot)com:

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

Who suggested there *was* a problem with cdyne webservice? The point is that if you're
having trouble using their API, you should ask them for help with it.
Re: Help with Pear Soap Client to weather service [message #186379 is a reply to message #186373] Thu, 10 July 2014 14:35 Go to previous messageGo to next message
Doug Miller is currently offline  Doug Miller
Messages: 171
Registered: August 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
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

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 #186380 is a reply to message #186379] Thu, 10 July 2014 14:47 Go to previous messageGo to next message
Doug Miller is currently offline  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 Go to previous messageGo to next message
mceexpert is currently offline  mceexpert
Messages: 3
Registered: July 2014
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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
Message by Luuk is ignored  [reveal message]  [reveal all messages by Luuk]  [stop ignoring this user] Go to previous messageGo to next message
Message by Jerry Stuckle is ignored  [reveal message]  [reveal all messages by Jerry Stuckle]  [stop ignoring this user] Go to previous messageGo to next message
Re: Help with Pear Soap Client to weather service [message #186386 is a reply to message #186381] Fri, 11 July 2014 07:25 Go to previous message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 7/10/2014 3:31 PM, mceexpert(at)gmail(dot)com wrote:
> 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
>
They suggest you contact them if you are having a problem:
http://www.cdyne.com/company/contact.aspx
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Repository pattern implementation that knows nothing (Jon Snow) about the database table and column names
Next Topic: Encoding Problems
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 08 20:04:11 EST 2024

Total time taken to generate the page: 0.04890 seconds