Link to home
Start Free TrialLog in
Avatar of PaultheBroker
PaultheBrokerFlag for Afghanistan

asked on

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:

http://www.oreillynet.com/pub/a/php/2007/07/26/php-web-services.html

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'/>
to
<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'
  targetNamespace='http://mydomain.com/webservice/catalog'
  xmlns:tns='http://mydomain.com/webservice/catalog'
  xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
  xmlns:xsd='http://www.w3.org/2001/XMLSchema'
  xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding'
  xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' 
  xmlns='http://schemas.xmlsoap.org/wsdl/'> 
 
<message name='getCatalogRequest'> 
  <part name='catalogId' type='xsd:string'/> 
</message> 
<message name='getCatalogResponse'> 
  <part name='Result' type='xsd:string'/> 
</message> 
 
<portType name='CatalogPortType'> 
  <operation name='getCatalogEntry'> 
    <input message='tns:getCatalogRequest'/> 
    <output message='tns:getCatalogResponse'/> 
  </operation> 
</portType> 
 
<binding name='CatalogBinding' type='tns:CatalogPortType'> 
  <soap:binding style='rpc' 
    transport='http://schemas.xmlsoap.org/soap/http'
  /> 
  <operation name='getCatalogEntry'> 
    <soap:operation soapAction='urn:localhost-catalog#getCatalogEntry'/> 
    <input> 
      <soap:body use='encoded' namespace='urn:localhost-catalog' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </input> 
    <output> 
      <soap:body use='encoded' namespace='urn:localhost-catalog' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </output> 
  </operation> 
</binding> 
 
<service name='CatalogService'> 
  <port name='CatalogPort' binding='CatalogBinding'> 
    <soap:address location='http://mydomain.com/webservice/soap-server.php'/> 
  </port> 
</service>
</definitions>

Open in new window

Avatar of PaultheBroker
PaultheBroker
Flag of Afghanistan image

ASKER

php is version 5.2.6
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
Thanks for the points - as you may have guessed, I am a bit of a REST evangelist.  I hope the answer was helpful, ~Ray