par
brys » 08 janv. 2007, 18:11
Bonjour à tous,
N'étant pas forcement un enorme tueur en XML, ça fait quelques jours que je m'echine à faire appel à un webservice.
Je dois y faire appel en PHP.
Lorsque je fais un __getFunctions(), je récupère ceci :
Code : Tout sélectionner
Array
(
[0] => ListOfEmployeeInterfaceTopElmt EmployeeQueryById(string $PrimaryRowId)
[1] => ListOfEmployeeInterfaceTopElmt EmployeeQueryByExample(ListOfEmployeeInterfaceTopElmt $Message)
...
)
Pour la premiere fonction, pas de problème vu que c'est un string. Par contre pour le deuxième je galère beaucoup plus.
Je vais détailler un peu le WSDL :
Code : Tout sélectionner
<message name="spcEmployee_EmployeeQueryByExample_Input">
<part name="Message" type="xsdLocal0:ListOfEmployeeInterfaceTopElmt">
</part>
</message>
<message name="spcEmployee_EmployeeQueryByExample_Output">
<part name="Message" type="xsdLocal0:ListOfEmployeeInterfaceTopElmt">
</part>
</message>
[...]
Code : Tout sélectionner
<xsd:complexType name="ListOfEmployeeInterfaceTopElmt">
<xsd:sequence>
<xsd:element name="ListOfEmployeeInterface" maxOccurs="1" minOccurs="1" type="xsdLocal0:ListOfEmployeeInterface">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ListOfEmployeeInterface">
<xsd:sequence>
<xsd:element name="Employee" maxOccurs="1" minOccurs="0" type="xsdLocal0:ArrayOfEmployee">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ArrayOfEmployee">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:attribute aPrefix:arrayType="xsdLocal0:Employee[]" ref="soapenc:arrayType" xmlns:aPrefix="http://schemas.xmlsoap.org/wsdl/">
</xsd:attribute>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Employee">
<xsd:sequence>
<xsd:element name="Id" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="Alias" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="AvailabilityStatus" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="AvailabilityStatusUntil" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="BuildingNumber" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="CPRegion" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="CPRegionId" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="CPRegionIntegrationId" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="CellPhone" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
[...]
</xsd:sequence>
</xsd:complexType>
Du coup pour cette deuxime fonction, je ne sais pas comment y acceder. probablement avec
SoapVar
D'aiulleur si quelqu'un pourrais me détailler quoi est quoi dans cette fonction ça serait interessant.
d'avance

Bonjour à tous,
N'étant pas forcement un enorme tueur en XML, ça fait quelques jours que je m'echine à faire appel à un webservice.
Je dois y faire appel en PHP.
Lorsque je fais un __getFunctions(), je récupère ceci :
[code]Array
(
[0] => ListOfEmployeeInterfaceTopElmt EmployeeQueryById(string $PrimaryRowId)
[1] => ListOfEmployeeInterfaceTopElmt EmployeeQueryByExample(ListOfEmployeeInterfaceTopElmt $Message)
...
)[/code]
Pour la premiere fonction, pas de problème vu que c'est un string. Par contre pour le deuxième je galère beaucoup plus.
Je vais détailler un peu le WSDL :
[code]
<message name="spcEmployee_EmployeeQueryByExample_Input">
<part name="Message" type="xsdLocal0:ListOfEmployeeInterfaceTopElmt">
</part>
</message>
<message name="spcEmployee_EmployeeQueryByExample_Output">
<part name="Message" type="xsdLocal0:ListOfEmployeeInterfaceTopElmt">
</part>
</message>[/code]
[...]
[code]
<xsd:complexType name="ListOfEmployeeInterfaceTopElmt">
<xsd:sequence>
<xsd:element name="ListOfEmployeeInterface" maxOccurs="1" minOccurs="1" type="xsdLocal0:ListOfEmployeeInterface">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ListOfEmployeeInterface">
<xsd:sequence>
<xsd:element name="Employee" maxOccurs="1" minOccurs="0" type="xsdLocal0:ArrayOfEmployee">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ArrayOfEmployee">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:attribute aPrefix:arrayType="xsdLocal0:Employee[]" ref="soapenc:arrayType" xmlns:aPrefix="http://schemas.xmlsoap.org/wsdl/">
</xsd:attribute>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Employee">
<xsd:sequence>
<xsd:element name="Id" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="Alias" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="AvailabilityStatus" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="AvailabilityStatusUntil" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="BuildingNumber" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="CPRegion" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="CPRegionId" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="CPRegionIntegrationId" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
<xsd:element name="CellPhone" maxOccurs="1" minOccurs="0" type="xsd:string">
</xsd:element>
[...]
</xsd:sequence>
</xsd:complexType>
[/code]
Du coup pour cette deuxime fonction, je ne sais pas comment y acceder. probablement avec [url=http://fr.php.net/manual/fr/function.soap-soapvar-construct.php]SoapVar[/url]
D'aiulleur si quelqu'un pourrais me détailler quoi est quoi dans cette fonction ça serait interessant.
d'avance :merci: