Richard Quadling
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|versi ons)(\?(ws dl|doc))?$ /ServiceManager.php?servic e=\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.
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_?
In my code, I use ...
$this->s_Service = ucfirst(strtolower($_GET['
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Richard, thanks for the points, and best of luck with it! ~Ray
ASKER
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.
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.
ASKER