 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
King Foo Blog: Using Complex Type with Zend_Soap
by Chris Cornutt September 23, 2011 @ 08:37:10
New from the King Foo blog there's a tutorial showing how to use complex types in a SOAP request with Zend_Soap, a component of the Zend Framework.
To be able to use complex types with Soap requests, they need to be fully defined in the WSDL file. Zend_Soap can automate this process, if you know how to define those complex types. Let us start without it Zend_Soap's magic and compare it with a fully discovered complex request type afterwards.
In their example, they have a collection of books (objects) that they want to send over to the web service. The code for both the server and client side are included with the WSDL automagically created by the Zend_Soap_Server component. By setting docblock comments on the properties of the Book objects, the SOAP components automatically know what types they are. Their example defines these, and sets up the web service on the other side with a classmap to define where the "tags" information for each book lies.
voice your opinion now!
zendsoap soap zendframework component autodiscover docblock
Ldeveloper Tech Blog: PHP - Fatal error Uncaught SoapFault exception Could not connect to host...
by Chris Cornutt August 12, 2011 @ 11:38:04
On the Ldeveloper Tech Blog today there's a helpful new post about an error PHP's SOAP extension could throw about not being able to connect to the host despite all settings being correct.
I receive this nasty error yesterday and it took me some time to figure out the problem: "Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in...". This ["new SoapClient"] line passes without any problems and this [var_dump on __getFunctions] shows the function prototypes correctly.
His script connects to the service as its supposed to but the "could not connect" is still thrown. He found a few references to OpenSSL issues that could cause it, but his code was correct so he turned to the other side - the service itself. As it turns out, it wasn't configured correctly.
It was configured to send invalid url and the function calls were using that invalid url. So there are two solutions [...] the first is to configure the server correctly. The other is to give __doReguest the correct location.
voice your opinion now!
soap connect host openssl service remote error
Eran Galperin's Blog: Breaking Down The PayPal API
by Chris Cornutt April 25, 2011 @ 09:50:54
In a recent post Eran Galperin takes a look at the PayPal API and breaks it down into smaller, easy to digest chunks to show you how to you can implement it in your application. Be warned, though - he mentions that it's the "among the worst API he's ever had to deal with" for several reasons.
PayPal is the most popular platform for receiving online payments. The relative ease of opening a PayPal account and receiving payments compared to opening a merchant account for a traditional payment gateway is the number one reason, and another is the comprehensive API they provide for their payment services. [...] There doesn't seem to be any better alternatives currently, so hopefully this guide will help ease the pain for some of you out there taking your lumps working the API into your applications.
Eran starts with a look at some of the different payment options, express, direct, recurring and mass, and what they're good for. From there, it's off to the code with his tool of choice being curl to make it simpler to make requests with headers, content and fetch the response message. He's put together a little custom function to make it easier to reuse. As an example, he shows how to make an Express Checkout request by grabbing a token and redirecting to the PayPal site for handling.
voice your opinion now!
paypal api connection tutorial payment soap request curl
Aaron McGowan' Blog: Geocoding search terms with Bing Maps
by Chris Cornutt November 17, 2010 @ 12:28:40
Aaron McGowan has a new post to his blog that looks at the work he's done interfacing with the Bing Maps API to do some geocoding for Emitter.ca.
One of the key features which was required for Emitter.ca, was the ability to geocode search terms like street addresses, cities, and postal codes, that a user enters so that Emitter.ca could easily return facilities that are nearby. To do this, we leveraged Bing Maps's API for performing the Geocode lookup. Microsoft offers a variety of APIs for allowing your application to interact with Bing Maps, however, for Geocoding search terms, we utilized Bing's SOAP API.
He shares the class he uses to pull the information out of the Bing Maps SOAP response and push the details into the properties of a class. The simpel class made interfacing with the API an easy task and allowed for string-based lookups on just about anywhere (like "Toronto, Ontario").
voice your opinion now!
geocode search bing maps soap api
Ahmed Shreef's Blog: Soap Web Services in PHP & hint on consuming from .Net
by Chris Cornutt November 03, 2010 @ 14:57:16
Ahmed Shreef has a post he's written up about using SOAP services in PHP (specifically in a CakePHP-based application using some Zend Framework libraries) and drops in a helpful hint at the end about getting .NET clients to play nicely with it.
Last week, I was working on implementing a SOAP server for one of our projects at work, this web service was built to be consumed by some other software that is built using .Net . It wasn't that easy and I faced some problems that made me go crazy for some hours and I wanted to share them here with the solutions.
He includes two snippets of code from his application - one is the SoapController that handles the incoming actions and the other is the handler class with a sample "doSomething" method to return an array. This is where the problem lies. .NET doesn't seem to understand the "Array" return type so it was throwing errors. In order to resolve the problem, hehad to tell the Zend library that he wanted to render the result as a type of "Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex" for the conversion.
voice your opinion now!
dotnet soap webservice zendframework cakephp array
Ibuildings techPortal: DPCRadio Web services for consumer devices
by Chris Cornutt September 07, 2010 @ 07:18:36
On the Ibuildings techPortal there's a new post with the latest episode in their DPCRadio series (as recorded at this past Dutch PHP Conference) - Melanie Rhianna Lewis' talk on web services and consumer devices.
A web service is an API provided by a site that allows a remote application to access data and use functionality without having to 'act like a web browser'. [...] The talk will describe how a web service targeted at consumer devices can be implemented. It will look at the different methods of calling remote functionality such as SOAP, XML-RPC, JSON and restful services. It will also consider the limitations of consumer devices, memory restrictions, communications bandwidth restrictions, and so on that have to be considered when designing a web service aimed at consumer devices. Finally it will have a brief look at how to make a service secure.
You can find the slides for the session here and you can either listen to the episode through the in-page player or buy downloading the mp3 directly.
voice your opinion now!
dpcradio webservice consumer device cellphone soap xmlrpc json dpc10
Lorna Mitchell's Blog: Accessing the Magento V2 API
by Chris Cornutt June 24, 2010 @ 11:44:18
Lorna Mitchell has a new post to her blog today looking at one of the differences she's found in her work with the Magento API between version 1 and version 2.
I must say that I am always pleased when I see that these products do include some kind of API. The Magento one is a bit interesting, although there is some half-decent API documentation for the original API. However they have then released a new version of the API, with very little documentation.
Her example code shows the difference in a call to grab a customer list from the SOAP interface - the version 1 method used a "customer.list" request while the version 2 method just made use of a normal SOAP method call to the "customerCustomerList" method on the service.
voice your opinion now!
magento version difference api soap
Rob Richards' Blog: WS-* for PHP
by Chris Cornutt March 23, 2010 @ 09:14:02
Rob Richards has posted about some updates that have been made to the WSE-PHP project to include support for dealing with encrypted SOAP messages. He talks some about the implementation and how it can help secure your application.
Support for dealing with encrypted SOAP messages was a feature that had been missing from my WS-* libraries pretty much due to my lack of time to implement it. When people ask for help interoperating with a SOAP server that requires encryption I typically just point them over to the WSF project. [...] I decided to finally set aside some time and implement the encryption/decryption portion of the library. Note that it was developed against some WCF services implementing message level security, so your mileage might vary against other platforms. Bug reports would be fastest way of getting any of those issues dealt with.
The WSE-PHP project lives on the Google Code site and provide support for a portion of WS-Addressing and WS-Security that can be used with ext/soap in PHP. TO use the library, you'll need to have the xmlseclibs library already installed.
voice your opinion now!
encrypted soap message wsf library wsephp
|
Community Events
Don't see your event here? Let us know!
|