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

Posted on 2009-04-20
Last Modified: 2013-11-19
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 ( 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=''/>

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=''/> 




Open in new window

Question by:PaultheBroker
    LVL 6

    Author Comment

    php is version 5.2.6
    LVL 107

    Accepted Solution

    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
    LVL 107

    Expert Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now