.net and pear soap
| From: | William Harrison | Date: | Tue, 15 Apr 2003 18:43:44 +0000 |
| Subject: | .net and pear soap | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-561@lists.php.net to get a copy of this message | ||
What am I missing here? My php client talks to my php server, but I can't
for the life of me get a .net client to talk to it. What am I doing wrong
in my WSDL? I can't be the only one having so much trouble with such a
simple example...
I've got a soap server in php:
<?php
require_once('SOAP/Server.php');
$ss = new SOAP_Server();
$sc = new SOAP_hello();
$ss->addObjectMap($sc, 'urn:SOAP_hello');
$ss->service($HTTP_RAW_POST_DATA);
// SOAP Hello World Class
class SOAP_hello
{
function hello_soap($blah)
{
return "Hello $blah!\n";
}
}
?>
I've got a soap client in php:
<?php
require_once('SOAP/Client.php');
$endpoint = 'http://66.159.81.10/pearsoap/soapserver.php';
$sc = new SOAP_Client($endpoint);
$method = 'hello_soap';
$params = array('p_one' => 'World');
$options = array('namespace' => 'urn:SOAP_hello');
$result = $sc->call($method, $params, $options);
print_r($result);
echo "\n";
?>
Soap client in .net:
Set soapclient = CreateObject("MSSOAP.SoapClient")
soapclient.ClientProperty("ServerHTTPRequest") = True
soapclient.mssoapinit "http://66.159.81.10/pearsoap/hello.wsdl"
Response.Write soapclient.hello_soap(Request("name")) & "<p>"
WSDL file:
<?xml version="1.0" ?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSc
hema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd"
xmlns:tns="http://66.159.81.10/pearsoap/" xmln
s:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://
66.159.81.10/pearsoap/">
<message name="hello_soapRequest">
<part name="name" type="xsd:string" />
</message>
<message name="hello_soapResponse">
<part name="return" type="xsd:string" />
</message>
<portType name="hello_soapPortType">
<operation name="hello_soap">
<input message="tns:hello_soapRequest" />
<output message="tns:hello_soapResponse" />
</operation>
</portType>
<binding name="hello_soapBinding" type="tns:hello_soapPortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"
/>
<operation name="hello_soap">
<soap:operation
soapAction="http://66.159.81.10/pearsoap/soapserver.php"
style="rpc" />
<input>
<soap:body use="encoded"
namespace="http://66.159.81.10/pearsoap/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
</input>
<output>
<soap:body use="encoded"
namespace="http://66.159.81.10/pearsoap/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
</output>
</operation>
</binding>
<service name="hello_soap">
<port name="hello_soapport" binding="tns:hello_soapBinding">
<soap:address
location="http://66.159.81.10/pearsoap/soapserver.php"
/>
</port>
</service>
</definitions>
====================================================================
DEADLINE: "a line drawn around a military prison beyond which
a prisoner may be shot"
-Oxford English Dictionary, 1868
====================================================================
William C. Harrison, Jr. [billfrog@toad.net]
ToadNet - Want to go fast?
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net