Serveur Java - Client PHP5
Bonjour,
J'ai un problème lors de l'appel de mon webservice avec un client PHP.
Voici ma conf:
Tout tourne en local pour l'instant sur un Ubuntu.
J'utilise Axis2 déployer sur un serveur Tomcat.
Pour l'instant je n'utilise qu'une seule fonction:
public Double getFDP(String sku)
Le problème est que lorsque j'apelle ma fonction, le parametre est tout le temps null.
[Edit] J'ai fait un test, et lorsque j'apelle mon Webservice via URL, tout fonctionne bien, du coup je pense que le problème vient du PHP[/Edit]
Voici le code du client PHP:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
<?php
try {
$client = new SoapClient($wsdl);
$sku = 'id';
$result = $client->getFDP($sku);
echo('Resultat: ');
echo $result;
}
catch(Exception $e){
echo "Error!<br />";
echo $e -> getMessage ();
}
?> |
Merci pour vos réponses
[Edit]
Voici également le code WSDL généré par Axis2:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
| <?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://server" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://server">
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://server">
<xs:element name="getFDP">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="sku" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getFDPResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:double"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="getFDPRequest">
<wsdl:part name="parameters" element="ns:getFDP"/>
</wsdl:message>
<wsdl:message name="getFDPResponse">
<wsdl:part name="parameters" element="ns:getFDPResponse"/>
</wsdl:message>
<wsdl:portType name="vdiPortType">
<wsdl:operation name="getFDP">
<wsdl:input message="ns:getFDPRequest" wsaw:Action="urn:getFDP"/>
<wsdl:output message="ns:getFDPResponse" wsaw:Action="urn:getFDPResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="vdiSoap11Binding" type="ns:vdiPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="getFDP">
<soap:operation soapAction="urn:getFDP" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="vdiSoap12Binding" type="ns:vdiPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="getFDP">
<soap12:operation soapAction="urn:getFDP" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="vdiHttpBinding" type="ns:vdiPortType">
<http:binding verb="POST"/>
<wsdl:operation name="getFDP">
<http:operation location="vdi/getFDP"/>
<wsdl:input>
<mime:content type="text/xml" part="getFDP"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="getFDP"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="vdi">
<wsdl:port name="vdiHttpSoap11Endpoint" binding="ns:vdiSoap11Binding">
<soap:address location="http://172.16.11.193:8180/axis2/services/vdi.vdiHttpSoap11Endpoint/"/>
</wsdl:port>
<wsdl:port name="vdiHttpSoap12Endpoint" binding="ns:vdiSoap12Binding">
<soap12:address location="http://172.16.11.193:8180/axis2/services/vdi.vdiHttpSoap12Endpoint/"/>
</wsdl:port>
<wsdl:port name="vdiHttpEndpoint" binding="ns:vdiHttpBinding">
<http:address location="http://172.16.11.193:8180/axis2/services/vdi.vdiHttpEndpoint/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions> |
[/Edit]