Web Services not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ArchAngel
Forum Newbie
Posts: 1
Joined: Wed Oct 18, 2006 5:15 am

Web Services not working

Post by ArchAngel »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello all!

I've been doing some stuff with web services and managed to call some Amazon web services using the Pear::SOAP library.  However, I've been trying to invoke a web service I created myself in Java and it's not working.   I have, however, managed to call it from a Java client.

I'm quite new to this SOAP stuff, so forgive me if this is a dumb question.  I'm trying to call the service using the following code:

Code: Select all

<?
  // Import library.
  require_once 'SOAP/Client.php';


  // Prepare arguments.
  $params   = array(
    'String_1'       => 'David'  // My Name
  );

  // Create WSDL object.
  $wsdl     = new SOAP_WSDL('http://192.168.49.64:8080/HiWS/HiWS?WSDL'); 
  $client   = $wsdl->getProxy(); 
  $results    = $client->sayHi($params);

  print_r($client); // Shows a 500 response (Internal Server Error).
?>
The client fails and the server displays the message: "javax.xml.rpc.soap.SOAPFaultException: Endpoint {urn:HiWS/wsdl}HiWSSEIPort does not contain operation meta data for: sayHi".

Here's the WSDL:

Code: Select all

- <definitions name="HiWS" targetNamespace="urn:HiWS/wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns2="urn:HiWS/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:HiWS/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <types>
- <schema targetNamespace="urn:HiWS/types" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:HiWS/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <complexType name="getTitleStockLevel">
- <sequence>
  <element name="String_1" nillable="true" type="string" /> 
  </sequence>
  </complexType>
- <complexType name="getTitleStockLevelResponse">
- <sequence>
  <element maxOccurs="unbounded" minOccurs="0" name="result" nillable="true" type="tns:Stock" /> 
  </sequence>
  </complexType>
- <complexType name="Stock">
- <sequence>
  <element name="issue" type="int" /> 
  <element name="level" type="int" /> 
  <element name="title" nillable="true" type="string" /> 
  </sequence>
  </complexType>
- <complexType name="sayHi">
- <sequence>
  <element name="String_1" nillable="true" type="string" /> 
  </sequence>
  </complexType>
+ <complexType name="sayHiResponse">
- <sequence>
  <element name="result" nillable="true" type="string" /> 
  </sequence>
  </complexType>
- <complexType name="sayHiArray">
- <sequence>
  <element maxOccurs="unbounded" minOccurs="0" name="arrayOfString_1" nillable="true" type="string" /> 
  </sequence>
  </complexType>
- <complexType name="sayHiArrayResponse">
- <sequence>
  <element name="result" nillable="true" type="string" /> 
  </sequence>
  </complexType>
  <element name="getTitleStockLevel" type="tns:getTitleStockLevel" /> 
  <element name="getTitleStockLevelResponse" type="tns:getTitleStockLevelResponse" /> 
  <element name="sayHi" type="tns:sayHi" /> 
  <element name="sayHiResponse" type="tns:sayHiResponse" /> 
  <element name="sayHiArray" type="tns:sayHiArray" /> 
  <element name="sayHiArrayResponse" type="tns:sayHiArrayResponse" /> 
  </schema>
  </types>
- <message name="HiWSSEI_sayHiArrayResponse">
  <part element="ns2:sayHiArrayResponse" name="result" /> 
  </message>
- <message name="HiWSSEI_sayHi">
  <part element="ns2:sayHi" name="parameters" /> 
  </message>
- <message name="HiWSSEI_sayHiResponse">
  <part element="ns2:sayHiResponse" name="result" /> 
  </message>
- <message name="HiWSSEI_sayHiArray">
  <part element="ns2:sayHiArray" name="parameters" /> 
  </message>
- <message name="HiWSSEI_getTitleStockLevel">
  <part element="ns2:getTitleStockLevel" name="parameters" /> 
  </message>
- <message name="HiWSSEI_getTitleStockLevelResponse">
  <part element="ns2:getTitleStockLevelResponse" name="result" /> 
  </message>
- <portType name="HiWSSEI">
- <operation name="getTitleStockLevel">
  <input message="tns:HiWSSEI_getTitleStockLevel" /> 
  <output message="tns:HiWSSEI_getTitleStockLevelResponse" /> 
  </operation>
- <operation name="sayHi">
  <input message="tns:HiWSSEI_sayHi" /> 
  <output message="tns:HiWSSEI_sayHiResponse" /> 
  </operation>
- <operation name="sayHiArray">
  <input message="tns:HiWSSEI_sayHiArray" /> 
  <output message="tns:HiWSSEI_sayHiArrayResponse" /> 
  </operation>
  </portType>
- <binding name="HiWSSEIBinding" type="tns:HiWSSEI">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
- <operation name="getTitleStockLevel">
  <soap:operation soapAction="" /> 
- <input>
  <soap:body use="literal" /> 
  </input>
- <output>
  <soap:body use="literal" /> 
  </output>
  </operation>
- <operation name="sayHi">
  <soap:operation soapAction="" /> 
- <input>
  <soap:body use="literal" /> 
  </input>
- <output>
  <soap:body use="literal" /> 
  </output>
  </operation>
- <operation name="sayHiArray">
  <soap:operation soapAction="" /> 
- <input>
  <soap:body use="literal" /> 
  </input>
- <output>
  <soap:body use="literal" /> 
  </output>
  </operation>
  </binding>
- <service name="HiWS">
- <port binding="tns:HiWSSEIBinding" name="HiWSSEIPort">
  <soap:address location="http://DFVGM71J:8080/HiWS/HiWS" /> 
  </port>
  </service>
  </definitions>
Any help would be appreciated.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Post Reply