Link to home
Start Free TrialLog in
Avatar of Richard Quadling
Richard QuadlingFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Creating SOAP webservices

Hi.

I'm using PHP + Zend Framework on Microsoft IIS7 (with URL Rewrite extension - similar in functionality to Apache's mod_rewrite).

I'm creating some web services. Currently we have 3 specific services - many more are coming.

1 - Authentication - allows a remote system to gain a temporary authentication token. This service has 3 methods : Login, Authenticate, Logout

2 - Supply - allows a remote system to retrieve specific types of data from our databases. This service has many methods, each one related to a specific type of data.

3 - Versions - allows a remote system to retrieve human-readable data about the versions of the various services.

In addition, there are WSDL and documentation responses.



What I am looking for is what is the standard that I need to adhere to for the public addresses of these services?

Currently, the IIS server is set to ...

^/(authentication|supply_?data|versions)(\?(wsdl|doc))?$ /ServiceManager.php?service=\1&\3 [NC]

In my code, I use ...

$this->s_Service = ucfirst(strtolower($_GET['service']));

to identify the specific service that has been requested.



The ServiceManager script is essentially a SOAP Proxy. It collects and examines the request to determine what version is required (our services require a version block (all services) and an authentication block (all except the Authentication service)). Once the service has been correctly identified, it passes everything on to a normal Zend_Soap_Service class as if it was the primary handler. Works very nicely.


So, I'm fine on _my_ side, but I don't know what format the URLs _SHOULD_ be on the public side.

Any suggestions would be appreciated.

Regards,

Richard Quadling.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Quadling

ASKER

Hi Ray. I'm fine. Just busy.I have to use SOAP. The services I create have counterparts in our clients systems. We all agreed on SOAP.I've heard many complain about SOAP, but it is a sort of standard, more so that REST (from what I've read - not my F.O.E.). I don't know what's wrong with SOAP. One thing though is that MS seem to want to do things differently - not sure how to handle that yet.As REST seems to put everything in the URL, this limits what can be sent. Currently, my services are, in the main, data providers. But I will be writing a service to allow significant amounts of data to be imported into our systems.The client generates an order and "pushes" it to our system.This is a significant amount of data and includes a base64_encoded TIFF or PDF file. Not something a URL can handle.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
None of these services are for the use of a "front end". It is all business-to-business with automated systems doing all the communication.

The reason we intend to use SOAP, is that the service content is still in development.

So, today, we have V1 of all the services.

Tomorrow, we may find a bug which can be fixed (V1.1).
Tomorrow, we may find a bug where we find that the data being output was wrong (V1.2 and V1.1 has a killbit set).
Tomorrow, we may want to add some new functionality (V2).

etc.

By using SOAP, I have a controller which is essentially a single class to act as a SOAP proxy which extracts the version and authentication data and then calls the appropriate class. Each class's constructor deals with the killbit.

By simply dropping classes into the appropriate folder, I can add functionality.

I've also got the ability to do LIVE, TEST and DEV versioning.

I'm sure that REST would do the trick, but I don't know how to describe the services (WSDL) in REST. WSDL can be converted to a class.

But, basically, you are saying the URL mechanism is whatever.

Which is fine.

I think I'll stick with my simply URLs and structured XML.

At least for the time being.

Regards,

Richard.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Richard, thanks for the points, and best of luck with it! ~Ray
I've found that the majority of the third parties use .net.

Which based upon what I've read doesn't support (natively at least) RPC-encoding, only document/literal encoding.

Personally, I've no idea what this means, just that the number of posts I've read from people pulling their hair out getting PHP+SOAP<->.NET+SOAP working...

Add to that, I'm using ZendFramework.

I _THINK_ it is doable, but I think the WSDL file needs to advertise different URLS for different encodings.

I think.

But, the I've pointed them all to my notes and we are waiting to hear back if the issue is FUD or a real issue.

As I don't have a .net build environment or skill set, I can't test this and none of the .netters have PHP skills.

Argh! Time to re-train.