Moderadores: andre_luis, 51, guest2003, Renie
ivan escreveu:Francisco,
Dá uma olhada no lnk a seguir:
http://gsoap2.sourceforge.net/
Pode ser um pontapé inicial... posta ae o q achou!
POST /a2b/EventService HTTP/1.1
Host: a2b.example.questra.com
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn
SOAPAction: /a2b/EventService#SubmitEvent
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header>A2B Header</SOAP-ENV:Header> <SOAP-ENV:Body> <SubmitEventRequest> <Source>Copier54321</Source> <Description>MotorFailure</Description> </SubmitEventRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
HTTP/1.0 200 OK
Content-Type: text/xml
Content-Length: 316
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header>A2B Header</SOAP-ENV:Header>
<SOAP-ENV:Body> <SubmitEventResponse> <Status>OK</Status> </SubmitEventResponse> </SOAP-Env:Body>
</SOAP-ENV:Envelope>
POST /wsdemo/nusoap/server.php HTTP/1.0
Host: localhost
User-Agent: NuSOAP/0.7.2 (1.94)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: ""
Content-Length: 524
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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:Body><ns9817:hello xmlns:ns9817="http://tempuri.org"><__numeric_0 xsi:type="xsd:string">Jorge Francisco</__numeric_0></ns9817:hello></SOAP-ENV:Body></SOAP-ENV:Envelope>
HTTP/1.1 200 OK
Date: Thu, 30 Oct 2008 23:13:58 GMT
Server: Apache/2.2.8 (Win32) PHP/5.2.6
X-Powered-By: PHP/5.2.6
X-SOAP-Server: NuSOAP/0.7.2 (1.94)
Content-Length: 537
Connection: close
Content-Type: text/xml; charset=ISO-8859-1
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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:Body><ns1:helloResponse xmlns:ns1="http://tempuri.org"><return xsi:type="xsd:string">Ol&aacute Jorge Francisco</return></ns1:helloResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?php
// inclusão do arquivo de classes NuSOAP
require_once('nusoap.php');
// criação de uma instância do servidor
$server = new soap_server;
// registro do método
$server->register('hello');
// definição do método como uma função do PHP
function hello($name) {
return 'Olá '.$name;
}
// requisição para uso do serviço
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ?
$HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
GET /wsdemo/nusoap/cliente.php
host: localhost
Olá Jorge Francisco
Usuários navegando neste fórum: Google [Bot] e 1 visitante