Joined: 09 Jun 2008 |
Posts: 1 |
|
|
|
Posted: Sun Jun 08, 2008 5:01 pm |
|
|
|
|
|
Hi all,
I've received a wsdl file from a customer who has running a service.
I've tested with SoapUI 2.0.2 and the service responds.
Unfortunately i cannot make the nusoap php client to work.
Is there anyone who can help me with this problem pls?
Thx,
Peter
This is the wsdl file which I stored on my server.
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions name="smb000_soapTest" targetNamespace="http://xxx.xxx.xxx.xxx/" xmlns:wsdns1="http://localhost/smb000/soapTest/hello_soapRPC" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://xxx.xxx.xxx.xxx/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
- <wsdl:types>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://localhost/smb000/soapTest/hello_soapRPC" xmlns:tns="http://localhost/smb000/soapTest/hello_soapRPC">
- <xsd:complexType name="__hello_soapRPCInput">
- <xsd:sequence>
<xsd:element name="inXml" nillable="true" type="tns:__SoapString" />
</xsd:sequence>
</xsd:complexType>
- <xsd:complexType name="__SoapString">
- <xsd:sequence>
<xsd:element name="SoapString" type="tns:__SoapString2" />
</xsd:sequence>
</xsd:complexType>
- <xsd:complexType name="__SoapString2">
- <xsd:sequence>
<xsd:element name="body" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
- <xsd:complexType name="__hello_soapRPCOutput">
- <xsd:sequence>
<xsd:element name="outXml" nillable="true" type="tns:__SoapString" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
- <wsdl:message name="hello_soapRPCInput">
<wsdl:part name="inXml" type="wsdns1:__SoapString" />
</wsdl:message>
- <wsdl:message name="hello_soapRPCOutput">
<wsdl:part name="outXml" type="wsdns1:__SoapString" />
</wsdl:message>
- <wsdl:portType name="smb000_soapTestPortType">
- <wsdl:operation name="hello_soapRPC">
<wsdl:input message="tns:hello_soapRPCInput" />
<wsdl:output message="tns:hello_soapRPCOutput" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="smb000_soapTestBinding" type="tns:smb000_soapTestPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="hello_soapRPC">
<soap:operation soapAction="" />
- <wsdl:input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://xxx.xxx.xxx.xxx/smb000.soapTest" use="encoded" />
</wsdl:input>
- <wsdl:output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://xxx.xxx.xxx.xxx/smb000.soapTest" use="encoded" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="smb000_soapTestService">
- <wsdl:port name="smb000_soapTestPort0" binding="tns:smb000_soapTestBinding">
<soap:address location="http://xxx.xxx.xxx.xxx:8090/soap/rpc" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
This is the PHP client:
<?php
// Pull in the NuSOAP code
require_once('../../SOAP/nusoap/lib/nusoap.php');
$ns="urn:smb000_soapTestService";
// Create the client instance
$client = new soapclient('hello_soapRPC_xxxxxxxx.wsdl','wsdl');
// Check for an error
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
// At this point, you know the call that follows will fail
}
// Call the SOAP method
$result = $client->call('hello_soapRPC', array('body' => 'Something'), $ns);
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}
}
// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
// Display the debug messages
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>
|
|