SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 321 | Next

Raymond Yee

"Pro Web 2.0 Mashups: Remixing Data and Web Services"

us/dist/eg/clients/GeoCoderPHP.wsdl'
server = WSDL.Proxy(wsdl_url)
# let's see what operations are supported
server.show_methods()
# geocode the Apress address
address = "2855 Telegraph Ave, Berkeley, CA"
result = server.geocode(location=address)
print "latitude and longitude: %s, %s" % (result[0]['lat'], result[0]['long'])
This produces the following output (edited for clarity):
Method Name: geocode_intersection
In #0: intersection ((u'http://www.w3.org/2001/XMLSchema', u'string'))
Out #0: results ((u'http://rpc.geocoder.us/Geo/Coder/US/',
u'ArrayOfGeocoderIntersectionResult'))
Method Name: geocode_address
In #0: address ((u'http://www.w3.org/2001/XMLSchema', u'string'))
Out #0: results ((u'http://rpc.geocoder.us/Geo/Coder/US/',
u'ArrayOfGeocoderAddressResult'))
Method Name: geocode
In #0: location ((u'http://www.w3.org/2001/XMLSchema', u'string'))
Out #0: results ((u'http://rpc.geocoder.us/Geo/Coder/US/',
u'ArrayOfGeocoderResult'))
latitude and longitude: 37.858276, -122.26007
Notice the reference to XML schema types in describing the location parameter for
geocode. The type definitions come, as one expects, from the WSDL document.
The concision of this code shows WSDL and SOAP in good light.
CHAPTER 7 ?–  EXPLORING OTHER WEB APIS 189
USING SOAP FROM PHP
There are several choices of libraries for consuming SOAP in PHP:
??? NuSOAP (http://sourceforge.


Pages:
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333