• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1016
  • Last Modified:

When attempting a sample webservice (SOAP request, using PHP), I'm getting an error that the function is Not Found

I'm trying to follow the sample script here:


I'm using my ISP account, and I've created a folder called 'webservice' under the main root (http://mydomain.com/webservice/) under which I have placed the sample files catalog.wsdl, soap_client.php, and soap_server.php

I'm a novice at php and know NOTHING about soap, so this is a stretch assignment for me.  In the service block of the WSDL (posted below) I cnaged the tag:
<soap:address location='http://localhost/soap-server.php'/>
<soap:address location='http://mydomain.com/webservice/soap-server.php'/>

but  Istill get the error message:

Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in /home/paul/public_html/webservice/soap-client.php:4 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://localhos...', 'urn:localhost-c...', 1, 0) #1 [internal function]: SoapClient->__call('getCatalogEntry', Array) #2 /home/paul/public_html/webservice/soap-client.php(4): SoapClient->getCatalogEntry('catalog1') #3 {main} thrown in /home/paul/public_html/webservice/soap-client.php on line 4
<?xml version ='1.0' encoding ='UTF-8' ?> 
<definitions name='Catalog'
<message name='getCatalogRequest'> 
  <part name='catalogId' type='xsd:string'/> 
<message name='getCatalogResponse'> 
  <part name='Result' type='xsd:string'/> 
<portType name='CatalogPortType'> 
  <operation name='getCatalogEntry'> 
    <input message='tns:getCatalogRequest'/> 
    <output message='tns:getCatalogResponse'/> 
<binding name='CatalogBinding' type='tns:CatalogPortType'> 
  <soap:binding style='rpc' 
  <operation name='getCatalogEntry'> 
    <soap:operation soapAction='urn:localhost-catalog#getCatalogEntry'/> 
      <soap:body use='encoded' namespace='urn:localhost-catalog' 
      <soap:body use='encoded' namespace='urn:localhost-catalog' 
<service name='CatalogService'> 
  <port name='CatalogPort' binding='CatalogBinding'> 
    <soap:address location='http://mydomain.com/webservice/soap-server.php'/> 

Open in new window

  • 2
1 Solution
PaultheBrokerAuthor Commented:
php is version 5.2.6
Ray PaseurCommented:
No offense meant, but why are you using SOAP?  As you can see, it is one of the most complicated ways to consume web services because it requires the calling programs to have some knowledge of the structure and behavior of the service.

A simpler way to do this is called "REST" and without writing a huge post, let me outline the basics.

The calling program sends all its inquiry parameters via the URL, including an API key that authenticates the identity of the caller.

The web service returns all its response data in a comma-separated string (CSV) or XML.  

There are no "exposed internals" on the web service side, every call is atomic and complete.  The result is a simple and dependable interface that works every time.

The "Hello World" of RESTful web services is the Yahoo Geocoder API.  You can read about it here:

Hope that helps, ~Ray
Ray PaseurCommented:
Thanks for the points - as you may have guessed, I am a bit of a REST evangelist.  I hope the answer was helpful, ~Ray

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now