Hi -
Just to make sure we're all on the same page,
1. You're probably using the SOAP extension with PHP 5, and you're probably creating your client object something like this:
http://www.herongyang.com/php/php_soap.html
Code:
<?php # GetTemp.php
# Copyright (c) 2005 by Dr. Herong Yang, http://www.herongyang.com/
#
$client = new SoapClient
("http://www.xmethods.net/sd/2001/DemoTemperatureService.wsdl");
2. If so, PHP will automagically read the .wsdl, and your client object can read the SOAP data with "get" methods like this:
Code:
echo("\nReturning value of getTemp() call: ".
$client->getTemp());
3. Your client's "getTemp()" call will have generated a SOAP request to the server, and the SOAP response will look something like this:[quote]
Quote:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getTempResponse xmlns:ns1="urn:xmethods-Temperature-Demo"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:float">52.0</return>
</ns1:getTempResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
|
The result you'll see in the browser will look something like this:
Quote:
Returning value of getTemp() call: 52
|
4. Now:
Q: How do you
set a SOAP value?
A: Easy. You make a method call from your client object to the server (just like above). Only you pass one or more
parameters in your argument:
Code:
echo("\nReturning value of getTemp() call: ".
$client->getTemp("123456"));
In other words:
1. The WSDL defines the "protocol" - describing the *methods* client and server will use to exchange data, and the data these methods will exchange
2. The PHP SOAP extension "wraps" the WSDL-specific protocol for you, permitting you to read (and, implicitly, write) data to and from the server with the appropriate method calls.
I hope that helps (at least a little bit).
IMHO .. PSM