2011-11-17 8 views
0

Je travaille sur php depuis longtemps, mais cette fois j'ai une API où je dois me connecter avec un fichier WSDL en utilisant php, j'ai essayé de nombreuses façons, mais je Je ne reçois aucune réponse.Services Web (wsdl) avec Php

Voici mon fichier wsdl

<?xml version="1.0" encoding="UTF-8"?> 
<wsdl:definitions 
name="WMSMSWS" 
targetNamespace="http://www.gspl.com/wms/wtystatus" 
xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tns="http://www.gspl.com/wms/wtystatus" 
xmlns:xsd1="http://www.gspl.com/wms/wtystatus/xsd" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> 
<wsdl:types> 
<xsd:schema 
    targetNamespace="http://www.gspl.com/wms/wtystatus/xsd" 
    xmlns="http://www.w3.org/2001/XMLSchema" 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    elementFormDefault="qualified"> 

    <xsd:element name="wtyStatusData"> 
    <xsd:complexType> 
     <xsd:sequence> 
     <xsd:element minOccurs="1" maxOccurs="1" 
        name="machineSerialNo" type="xsd:string" /> 
     <xsd:element minOccurs="1" maxOccurs="1" 
        name="serviceUserId" type="xsd:string" /> 
     </xsd:sequence> 
    </xsd:complexType> 
    </xsd:element> 

    <xsd:element name="wtyStatusDataResponse"> 
    <xsd:complexType> 
     <xsd:sequence> 
     <xsd:element minOccurs="1" maxOccurs="1" 
        name="status" type="xsd:string" /> 
     <xsd:element minOccurs="0" maxOccurs="1" 
        name="error" type="xsd:string" /> 
     <xsd:element minOccurs="0" maxOccurs="1" 
        name="wtyStatus" type="xsd:string" /> 
     <xsd:element minOccurs="0" maxOccurs="1" 
        name="modelNo" type="xsd:string" /> 
     <xsd:element minOccurs="0" maxOccurs="1" 
        name="wtyEndDate" type="xsd:string" /> 
     </xsd:sequence> 
    </xsd:complexType> 
    </xsd:element> 
    </xsd:schema> 
</wsdl:types> 
<wsdl:message name="wtyStatusData"> 
<wsdl:part name="parameters" element="xsd1:wtyStatusData" /> 
</wsdl:message> 
<wsdl:message name="wtyStatusDataResponse"> 
<wsdl:part name="parameters" element="xsd1:wtyStatusDataResponse" /> 
</wsdl:message> 
<wsdl:portType name="WMSMSWSPortType"> 
<wsdl:operation name="wtyStatusData"> 
    <wsdl:input message="tns:wtyStatusData" /> 
    <wsdl:output message="tns:wtyStatusDataResponse" /> 
    </wsdl:operation> 
    </wsdl:portType> 
    <wsdl:binding name="WMSMSWSPortBinding" 
      type="tns:WMSMSWSPortType"> 
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" 
       style="document" /> 

    <wsdl:operation name="wtyStatusData"> 
    <soap:operation soapAction="http://www.gspl.com/wms/wtystatus/wtyStatusData" 
        style="document" /> 
    <wsdl:input> 
    <soap:body use="literal" /> 
    </wsdl:input> 
    <wsdl:output> 
    <soap:body use="literal" /> 
    </wsdl:output> 
</wsdl:operation> 
</wsdl:binding> 
<wsdl:service name="WtyStatus"> 
    <wsdl:port name="WMSMSWSPort" binding="tns:WMSMSWSPortBinding"> 
    <soap:address location="http://ecsm.net:8080/wms/services/WtyStatus" /> 
</wsdl:port> 
    </wsdl:service> 
    </wsdl:definitions> 

et php je suis en train d'écrire pour elle

<?php 
require_once('nusoap.php'); 
$wsdl="http://ecsm.net:8080/wms/services/WtyStatus"; 
$client=new soapclient($wsdl, 'wsdl'); 

$machineSerialNo = 'KZ10187M'; 
$serviceUserId = 'LBZ01554'; 

$param=array(
    'machineSerialNo' => $machineSerialNo, 
    'serviceUserId' => $serviceUserId 
    ); 

$result = $client->call('WMSMSWS', $param); 

echo $client->getError(); 

print_r($result); 

J'utilise savon pour s'y connecter, série de la machine No et Id utilisateur de service sont uniques donné moi d'une entreprise.

Merci

Répondre