See more articles about "web service "

Tutorial Addendum on Web Account and SOAP - PHP SOAP Addendum - Server Applications



 31 December 18:00   

    



    



    

To analysis my server application, I wrote this applicant application, HelloClient.php:

    

 

    

<?php # HelloClient.php

    

# Absorb (c) 2005 by Dr. Yang

    

#

    

$client = new SoapClient(null, array(

    

area => "http://localhost/HelloServer.php",

    

uri => "urn://www..home/req",

    

trace => 1 ));

    

$return = $client->__soapCall("hello",array("world"));

    

echo("
Returning amount of __soapCall() call: ".$return);

    

echo("
Dumping appeal headers:
"

    

.$client->__getLastRequestHeaders());

    

echo("
Dumping request:
".$client->__getLastRequest());

    

echo("
Dumping acknowledgment headers:
"

    

.$client->__getLastResponseHeaders());

    

echo("
Dumping response:
".$client->__getLastResponse());

    

?>

    



    



    

Check your IIS server to create abiding it is running. Then run HelloClient.php. You will get:

    

 

    

Returning amount of __soapCall() call: Accost world!

    

Dumping appeal headers:

    

POST /HelloServer.php HTTP/1.1

    

Host: localhost

    

Connection: Keep-Alive

    

User-Agent: PHP SOAP 0.1

    

Content-Type: text/xml; charset=utf-8

    

SOAPAction: "urn://www..home/req#hello"

    

Content-Length: 499

    

Dumping request:

    

<?xml version="1.0" encoding="UTF-8"?>

    

<SOAP-ENV:Envelope

    

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

    

xmlns:ns1="urn://www..home/req"

    

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    

xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"

    

SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

    

<SOAP-ENV:Body><ns1:hello>

    

<param0 xsi:type="xsd:string">world</param0>

    

</ns1:hello></SOAP-ENV:Body>

    

</SOAP-ENV:Envelope>

    

Dumping acknowledgment headers:

    

HTTP/1.1 200 OK

    

Server: Microsoft-IIS/5.1

    

Connection: close

    

Content-Type: text/xml; charset=utf-8

    

X-Powered-

Content-Length: 522

    

Dumping response:

    

<?xml version="1.0" encoding="UTF-8"?>

    

<SOAP-ENV:Envelope

    

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

    

xmlns:ns1="urn://www..home/res"

    

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    

xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"

    

SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

    

<SOAP-ENV:Body><ns1:helloResponse>

    

<return xsi:type="xsd:string">Hello world!</return>

    

</ns1:helloResponse></SOAP-ENV:Body>

    

</SOAP-ENV:Envelope>

    



    



    

Very exciting, right? Both server and applicant plan nicely.

    



    

If you are absorbed in how the beheading was agitated out on the server,

    

I accept a simplified beheading breeze diagram on the server side:

    

 

    

IIS PHP (SOAP Extension) HelloServer.php

    

HTTP appeal |

    

-------------->|

    

SOAP bulletin |

    

| CGI | PHP CGI API

    

|------->|------------------------>|

    

| addFunction()

    

|

    

SOAP Addendum API | handle()

    

|<------------------------|

    

|

    

| SOAP Addendum API

    

|------------------------>|

    

SOAP Addendum API | hello()

    

|<------------------------|

    

CGI |

    

|<-------|

    

HTTP acknowledgment |

    

<--------------|

    

SOAP bulletin |

    



    



    



    

HelloServer12.php - SOAP 1.2 Server Application

    



    

So far, we accept approved alone with SOAP 1.1. Can we do some tests with SOAP 1.2? Sure.

    

Here is my accost server adapted for SOAP 1.2, HelloServer12.php:

    

 

    

<?php # HelloServer12.php

    

# Absorb (c) 2005 by Dr. Yang

    

#

    

function hello($someone) {

    

acknowledgment "Hello " . $someone . "! - SOAP 1.2";

    

}

    

$server = new SoapServer(null, array(

    

uri => "urn://www..home/res",

    

soap_version => SOAP_1_2));

    

$server->addFunction("hello");

    

$server->handle();

    

?>

    



    



    

Here is my accost applicant adapted for SOAP 1.2, HelloClient12.php:

    

 

    

<?php # HelloClient12.php

    

# Absorb (c) 2005 by Dr. Yang

    

#

    

$client = new SoapClient(null, array(

    

area => "http://localhost/HelloServer12.php",

    

uri => "urn://www..home/req",

    

soap_version => SOAP_1_2,

    

trace => 1 ));

    

$return = $client->__soapCall("hello",array("world"));

    

echo("
Returning amount of __soapCall() call: ".$return);

    

echo("
Dumping appeal headers:
"

    

.$client->__getLastRequestHeaders());

    

echo("
Dumping request:
".$client->__getLastRequest());

    

echo("
Dumping acknowledgment headers:
"

    

.$client->__getLastResponseHeaders());

    

echo("
Dumping response:
".$client->__getLastResponse());

    

?>

    



    



 


 client, server, xmlns, dumping, response, request, return, xmlsoap, encoding, envelope, schemas, headers, extension, array, soapcall, xmlschema, version, helloserver12, world, copyright, helloclient, value, helloserver, , soap env, < soap, echo dumping, urn www, xmlsoap org, soap extension, www home, org soap, schemas xmlsoap, http schemas, php soap, dumping response, envelope xmlns, xmlns soap, env envelope, http www, env body, < ns1, helloserver12 php, dumping request, soap encoding, home req, org 2001, 2001 xmlschema, extension api, response headers, < php, php <, helloclient php, php copyright, null array, soapcall call, uri urn, helloserver php, request headers, http schemas xmlsoap, echo dumping request, echo dumping response, org soap encoding, org 2001 xmlschema, php soap extension, envelope xmlns soap, encodingstyle http schemas, env envelope xmlns, env http schemas, getlastresponseheaders echo dumping, soap version soap, client getlastresponseheaders echo, env encodingstyle http, org soap envelope, xmlschema instance xmlns, instance xmlns soap, enc http schemas, 2001 xmlschema instance, 2001 xmlschema xmlns, soap envelope xmlns, dumping response headers, soap encoding soap, getlastrequest echo dumping, array location http, location http localhost, return client soapcall, null array location, soapclient null array, soap extension server, extension server applications, new soapclient null, client soapcall hello, soapcall hello array, dumping request headers, client getlastrequestheaders echo, getlastrequestheaders echo dumping, return echo dumping, soapcall call return, array world echo, world echo returning, echo returning value, client getlastrequest echo,

Share Tutorial Addendum on Web Account and SOAP - PHP SOAP Addendum - Server Applications:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Tutorial Addendum on Web Account and SOAP - SOAP Encoding
This affiliate describes:What is SOAP encoding?How to handle assorted references and annular references?How to specify bulge types?How to using SOAP encoding

Tutorial Addendum on Web Account and SOAP - SOAP Encoding
Multiple References and Annular References To advice serializing assorted reference, SOAP encoding blueprint offers the afterward rule:6. If serializing an labeled entering edge,

Tutorial Addendum on Web Account and SOAP - SOAP Java Implementations
This affiliate describes:Java Implementations of SOAP.Axis Accession Requirements on Windows.Installing Arbor 1.2.1 on Windows.Installing JAF 1.0.2./

Tutorial Addendum on Web Account and SOAP - SOAP Java Implementations
Installing Arbor 1.2.1 on WindowsBefore installing Axis, you should attending at your accepted JDK and Bobcat installations. Actuality is what I accept on my system:Name Ada

Tutorial Addendum on Web Account and SOAP - SOAP Bulletin Barter Patterns
This affiliate describes:What are SOAP bulletin barter patterns?What is Request Response Bulletin Barter Pattern?What is Acknowledgment Bulletin Barter Pattern?

Tutorial Addendum on Web Account and SOAP - SOAP Bulletin Barter Patterns
Rule 2: At the responding SOAP node, there will be addition set of SOAP backdrop with the afterward antecedent values: http://www.w3.org/2003/05/soap/bindingFramework/ExchangeContext /ExchangePatternName

Tutorial Addendum on Web Account and SOAP - SOAP Bulletin Anatomy
This affiliate describes:Generic SOAP bulletin structure.SOAP accountability bulletin structure.SOAP Bulletin Structure

Tutorial Addendum on Web Account and SOAP - SOAP Bulletin Anatomy
SOAP Accountability MessageA SOAP accountability bulletin is a appropriate SOAP bulletin acclimated to backpack absurdity information. It haveto accept alone one physique adolescent aspect alleged "Fault

Tutorial Addendum on Web Account and SOAP - SOAP Perl Implementations
This affiliate describes:Available Perl implemations of SOAP.SOAP::Lite for Perl on Windows.Installing ActivePerl v5.8.7 on Windows.SOAP::Lite 0.55 in Active

Tutorial Addendum on Web Account and SOAP - SOAP Perl Implementations
SOAP::Lite 0.55 in ActivePerl 5.8.7Now, let s analysis afresh the SOAP::Lite amalgamation in ActivePerl v5.8.7: dir perlsitelibSOAP...12/08/2003 09:13 AM