Indice del forum Olimpo Informatico
I Forum di Zeus News
Leggi la newsletter gratuita - Attiva il Menu compatto
 
 FAQFAQ   CercaCerca   Lista utentiLista utenti   GruppiGruppi   RegistratiRegistrati 
 ProfiloProfilo   Messaggi privatiMessaggi privati   Log inLog in 

    Newsletter RSS Facebook Twitter Contatti Ricerca
Problema php con wsdl
Nuovo argomento   Rispondi    Indice del forum -> Linguaggi per Internet
Precedente :: Successivo  
Autore Messaggio
stena
Comune mortale
Comune mortale


Registrato: 09/07/10 13:55
Messaggi: 1

MessaggioInviato: 09 Lug 2010 13:58    Oggetto: Problema php con wsdl Rispondi

Salve a tutti; sto facendo delle prove per capire il funzionamento di un web service in php.
ho creato due unit php e un file wsdl.
Il file pippo.wsdl è stato creato tramite il tool di designer presente in zend studio php per eclipse.
Il problema è il seguente: la PortType Prova in input richiede due parametri di tipo int
per poi restituire la loro somma.
Non so per quale motivo ma il secondo parametro di input non viene visto; è come se fosse sempre
impostato a zero.
Ho fatto varie prove ma non riesco a capire dove sta l'errore.

requestor.php
$requestor = new SoapClient("http://localhost/webphp/pippo.wsdl");
echo "somma: " . $requestor->converti(14,5);

provider.php
function converti($T,$E) {
return $T + $E;
}
$server = new SoapServer("pippo.wsdl");
$server->addFunction("converti");
$server->handle();

pippo.wsdl

Codice:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://localhost/webphp/pippo/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="pippo" targetNamespace="http://localhost/webphp/pippo/" xmlns:p="http://schemas.xmlsoap.org/wsdl/http/">

  <wsdl:message name="convertiRequest">
    <wsdl:part name="primo" type="xsd:int"></wsdl:part>
    <wsdl:part name="secondo" type="xsd:int"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="convertiResponse">
    <wsdl:part name="uscita" type="xsd:int"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="converti_faultMsg">

  </wsdl:message>
  <wsdl:portType name="prova">
    <wsdl:operation name="converti">
      <wsdl:input message="tns:convertiRequest"/>
      <wsdl:output message="tns:convertiResponse"/>
        </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="pippoSOAP" type="tns:prova">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="converti">
      <soap:operation soapAction="http://localhost/webphp/pippo/converti"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="pippo">
    <wsdl:port binding="tns:pippoSOAP" name="pippoSOAP">
      <soap:address location="http://localhost/webphp/provider.php/"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
Top
Profilo Invia messaggio privato
Mostra prima i messaggi di:   
Nuovo argomento   Rispondi    Indice del forum -> Linguaggi per Internet Tutti i fusi orari sono GMT + 1 ora
Pagina 1 di 1

 
Vai a:  
Non puoi inserire nuovi argomenti
Non puoi rispondere a nessun argomento
Non puoi modificare i tuoi messaggi
Non puoi cancellare i tuoi messaggi
Non puoi votare nei sondaggi