Bonjour,
je cherche a resoudre mon probleme pour un webservice creé en java, En fait , j'ai le WSDL mai je trouve pas la methode pour interroger le webservice avec une requetre XML.
j'essayé de fair ça:
$req='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
<http://schemas.xmlsoap.org/soap/envelope/> xmlns:web="http://webservices.bravofly.com/"
<http://webservices.bravofly.com/> > <soapenv:Header/> <soapenv:Body> <web:searchFlights>
<idBusinessProfile>toto</idBusinessProfile>
<password>toto</password>
<departureAirport>LON</departureAirport>
<arrivalAirport>MIL</arrivalAirport>
<roundTrip>true</roundTrip>
<outboundDate>2011-02-19</outboundDate>
<returnDate>2011-03-19</returnDate>
<adults>1</adults>
<childs>0</childs>
<infants>0</infants>
<numberOfResults>3</numberOfResults>
<language>it</language>
</web:searchFlights>
</soapenv:Body>
</soapenv:Envelope>';
$wsdl="http://wstest.viaggiare.it/vws/BravoFlySearchWs?WSDL";
$clientSOAP = new SoapClient($wsdl);
$result=$clientSOAP->__doRequest($req,$wsdl,'soapXml',SOAP_1_2);
print_r($result);
Voila le wsdl:
<definitions targetNamespace="http://webservices.bravofly.com/" name="BravoFlySearchWsService">
<types>
<xsd:schema>
<xsd:import namespace="http://webservices.bravofly.com/" schemaLocation="http://wstest.viaggiare.it:80/vws/BravoFlySearchWs?xsd=1"/>
</xsd:schema>
</types>
<message name="searchFlights">
<part name="parameters" element="tns:searchFlights"/>
</message>
<message name="searchFlightsResponse">
<part name="parameters" element="tns:searchFlightsResponse"/>
</message>
<portType name="BravoFlySearchWs">
<operation name="searchFlights">
<input message="tns:searchFlights"/>
<output message="tns:searchFlightsResponse"/>
</operation>
</portType>
<binding name="BravoFlySearchWsPortBinding" type="tns:BravoFlySearchWs">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="searchFlights">
<soapperation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="BravoFlySearchWsService">
<port name="BravoFlySearchWsPort" binding="tns:BravoFlySearchWsPortBinding">
<soap:address location="http://wstest.viaggiare.it:80/vws/BravoFlySearchWs"/>
</port>
</service>
</definitions>
Mais je rien reçue, que des erreurs tel que:
ncaught SoapFault exception: java.lang.NullPointerException in /homez.....
Aussi je crois que je mal utiliser le __doRequest
Pouvez vous m'aidé?
Merci d'avance :wink:
Cordialement
je cherche a resoudre mon probleme pour un webservice creé en java, En fait , j'ai le WSDL mai je trouve pas la methode pour interroger le webservice avec une requetre XML.
j'essayé de fair ça:
$req='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
<http://schemas.xmlsoap.org/soap/envelope/> xmlns:web="http://webservices.bravofly.com/"
<http://webservices.bravofly.com/> > <soapenv:Header/> <soapenv:Body> <web:searchFlights>
<idBusinessProfile>toto</idBusinessProfile>
<password>toto</password>
<departureAirport>LON</departureAirport>
<arrivalAirport>MIL</arrivalAirport>
<roundTrip>true</roundTrip>
<outboundDate>2011-02-19</outboundDate>
<returnDate>2011-03-19</returnDate>
<adults>1</adults>
<childs>0</childs>
<infants>0</infants>
<numberOfResults>3</numberOfResults>
<language>it</language>
</web:searchFlights>
</soapenv:Body>
</soapenv:Envelope>';
$wsdl="http://wstest.viaggiare.it/vws/BravoFlySearchWs?WSDL";
$clientSOAP = new SoapClient($wsdl);
$result=$clientSOAP->__doRequest($req,$wsdl,'soapXml',SOAP_1_2);
print_r($result);
Voila le wsdl:
<definitions targetNamespace="http://webservices.bravofly.com/" name="BravoFlySearchWsService">
<types>
<xsd:schema>
<xsd:import namespace="http://webservices.bravofly.com/" schemaLocation="http://wstest.viaggiare.it:80/vws/BravoFlySearchWs?xsd=1"/>
</xsd:schema>
</types>
<message name="searchFlights">
<part name="parameters" element="tns:searchFlights"/>
</message>
<message name="searchFlightsResponse">
<part name="parameters" element="tns:searchFlightsResponse"/>
</message>
<portType name="BravoFlySearchWs">
<operation name="searchFlights">
<input message="tns:searchFlights"/>
<output message="tns:searchFlightsResponse"/>
</operation>
</portType>
<binding name="BravoFlySearchWsPortBinding" type="tns:BravoFlySearchWs">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="searchFlights">
<soapperation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="BravoFlySearchWsService">
<port name="BravoFlySearchWsPort" binding="tns:BravoFlySearchWsPortBinding">
<soap:address location="http://wstest.viaggiare.it:80/vws/BravoFlySearchWs"/>
</port>
</service>
</definitions>
Mais je rien reçue, que des erreurs tel que:
ncaught SoapFault exception:
Aussi je crois que je mal utiliser le __doRequest
Pouvez vous m'aidé?
Merci d'avance :wink:
Cordialement