We help IT Professionals succeed at work.

Creating SOAP webservices

Richard Quadling
on
725 Views
Last Modified: 2013-11-10
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.
Comment
Watch Question

Most Valuable Expert 2011
Author of the Year 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Richard QuadlingSenior Software Developer

Author

Commented:
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.
Most Valuable Expert 2011
Author of the Year 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Richard QuadlingSenior Software Developer

Author

Commented:
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.
Most Valuable Expert 2011
Author of the Year 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Most Valuable Expert 2011
Author of the Year 2014

Commented:
Richard, thanks for the points, and best of luck with it! ~Ray
Richard QuadlingSenior Software Developer

Author

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

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.