[Web Service][SOAP] Import dans le wsdl
Bonjour à tous,
Je cherche à consommer un WebService SOAP avec l'extension SOAP de PHP 5.
Mais le fichier wsdl contient un import et php renvoie une erreur.
Citation:
PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://SR047356CTI3700:8380/gawebrc/TarificateurWS?wsdl&resource=TarificateurWS_PortType2832624350736054634.wsdl' : failed to load external entity "http://SR047356CTI3700:8380/gawebrc/TarificateurWS?wsdl&resource=TarificateurWS_PortType2832624350736054634.wsdl"
Voici le wsdl exposé par le partenaire :
Code:
1 2 3 4 5 6 7 8
| <definitions name='TarificateurService' targetNamespace='http://wsimpl.wsgateway.metier.gaweb.client.fr/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://tarificateur.interfaces.metier.gaweb.client.fr/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://wsimpl.wsgateway.metier.gaweb.client.fr/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<import location='http://SR047356CTI3700:8380/gawebrc/TarificateurWS?wsdl&resource=TarificateurWS_PortType2832624350736054634.wsdl' namespace='http://tarificateur.interfaces.metier.gaweb.client.fr/'></import>
<service name='TarificateurService'>
<port binding='ns1:TarificateurWSBinding' name='WsBeansRouterPort'>
<soap:address location='http://SR047356CTI3700:8380/gawebrc/TarificateurWS'/>
</port>
</service>
</definitions> |
Il est accècible par un VPN à l'adresse suivante : 'http://10.221.38.11:8380/gawebrc/TarificateurWS?wsdl'
Mais bien sur le domaine SR047356CTI3700 n'est déclaré nul part...
Du coup je pense qu'il n'arrive pas suivre le lien.
Si je remplace SR047356CTI3700 par l'ip j'obtiens bien un wsdl dons voici un extrait : (Le fichier fait 1200 lignes)
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
| <definitions name='TarificateurService' targetNamespace='http://tarificateur.interfaces.metier.gaweb.client.fr/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://tarificateur.interfaces.metier.gaweb.client.fr/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://wsimpl.wsgateway.metier.gaweb.client.fr/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<types>
<xs:schema targetNamespace='http://tarificateur.interfaces.metier.gaweb.client.fr/' version='1.0' xmlns:tns='http://tarificateur.interfaces.metier.gaweb.client.fr/' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name='TariferException' type='tns:TariferException'/>
<xs:element name='tariferClientHospitalier' type='tns:tariferHClientHospitalier'/>
<xs:element name='tariferClientHospitalierResponse' type='tns:tariferClientHospitalierResponse'/>
<xs:complexType abstract='true' name='abstractCriteresBeneficiaireDTO'>
<xs:sequence>
<xs:element minOccurs='0' name='beneficiaire' type='tns:personneDTO'/>
<xs:element minOccurs='0' name='dateEffet' type='xs:string'/>
<xs:element minOccurs='0' name='dateNaissance' type='xs:string'/>
</xs:sequence>
</xs:complexType>
<xs:complexType name='personneDTO'>
<xs:sequence>
<xs:element minOccurs='0' name='abrevationCodeMutuelle' type='xs:string'/>
<xs:element minOccurs='0' name='adresse1' type='xs:string'/>
<xs:element minOccurs='0' name='adresse2' type='xs:string'/>
</xs:sequence>
</xs:complexType>
<xs:complexType name='criteresBeneficiaireGRPSanteDTO'>
<xs:complexContent>
<xs:extension base='tns:abstractCriteresBeneficiaireAvecRangDTO'>
<xs:sequence>
<xs:element name='acs' type='xs:boolean'/>
<xs:element name='adhesionJeune' type='xs:boolean'/>
<xs:element name='adhesionTardive' type='xs:boolean'/>
<xs:element name='ald' type='xs:boolean'/>
<xs:element name='gratuiteNaissanceAdoption' type='xs:boolean'/>
<xs:element minOccurs='0' name='idGamme' type='xs:long'/>
<xs:element name='medecineDouce' type='xs:boolean'/>
<xs:element name='minoCouple' type='xs:boolean'/>
<xs:element name='pi' type='xs:boolean'/>
<xs:element minOccurs='0' name='produit' type='xs:string'/>
<xs:element minOccurs='0' name='zoneTarifaire' type='xs:string'/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name='criteresTarificationClientHospitalierWs'>
<xs:sequence>
<xs:element maxOccurs='unbounded' minOccurs='0' name='beneficiaires' nillable='true' type='tns:criteresBeneficiaireClientHospitalierDTO'/>
</xs:sequence>
</xs:complexType>
<xs:complexType name='tariferClientHospitalierResponse'>
<xs:sequence>
<xs:element minOccurs='0' name='return' type='tns:resultatTarificationPropositionBeneficiaireHospitalierWs'/>
</xs:sequence>
</xs:complexType>
<xs:complexType name='resultatTarificationPropositionBeneficiaireHospitalierWs'>
<xs:sequence>
<xs:element name='cotisationTotale' type='xs:float'/>
<xs:element maxOccurs='unbounded' minOccurs='0' name='listeBeneficiaires' nillable='true' type='tns:resultatTarificationBeneficiaireClientHospitalierDTO'/>
<xs:element maxOccurs='unbounded' minOccurs='0' name='listeMsgInfo' nillable='true' type='xs:string'/>
<xs:element name='minoration' type='xs:float'/>
<xs:element name='taxeTotale' type='xs:float'/>
</xs:sequence>
</xs:complexType>
<xs:complexType name='resultatTarificationBeneficiaireClientHospitalierDTO'>
<xs:complexContent>
<xs:extension base='tns:abstractResultatTarificationBeneficiaireDTO'>
<xs:sequence>
<xs:element minOccurs='0' name='beneficiaire' type='tns:personneDTO'/>
<xs:element name='cotisation' type='xs:float'/>
<xs:element name='cotisationIJ' type='xs:float'/>
<xs:element name='cotisationPH' type='xs:float'/>
<xs:element name='gratuiteNaissanceAdoption' type='xs:boolean'/>
<xs:element name='taxe' type='xs:float'/>
<xs:element minOccurs='0' name='zoneTarifaire' type='xs:string'/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
</types>
<message name='TariferException'>
<part element='ns1:TariferException' name='TariferException'></part>
</message>
<message name='TarificateurWS_tariferClientHospitalierResponse'>
<part element='ns1:tariferClientHospitalierResponse' name='tariferClientHospitalierResponse'></part>
</message>
<message name='TarificateurWS_tariferClientHospitalier'>
<part element='ns1:tariferClientHospitalier' name='tariferClientHospitalier'></part>
</message>
<message name='TarificateurWS_tariferHMProtectionHospitaliereResponse'>
<part element='ns1:tariferHMProtectionHospitaliereResponse' name='tariferHMProtectionHospitaliereResponse'></part>
</message>
<portType name='TarificateurWS'>
<operation name='tariferAMProtectionHospitaliere' parameterOrder='tariferAMProtectionHospitaliere'>
<input message='ns1:TarificateurWS_tariferAMProtectionHospitaliere'></input>
<output message='ns1:TarificateurWS_tariferAMProtectionHospitaliereResponse'></output>
<fault message='ns1:TariferException' name='TariferException'></fault>
</operation>
</portType>
<binding name='TarificateurWSBinding' type='ns1:TarificateurWS'>
<soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='tariferClientHospitalier'>
<soap:operation soapAction=''/>
<input>
<soap:body use='literal'/>
</input>
<output>
<soap:body use='literal'/>
</output>
<fault name='TariferException'>
<soap:fault name='TariferException' use='literal'/>
</fault>
</operation>
</binding>
</definitions> |
Et enfin mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| $gaweb_params = array(); // Les paramètres à envoyer au WS.
$opts = array(
'http'=>array(
'user_agent' => 'PHPSoapClient'
)
);
$context = stream_context_create($opts);
$c = new SoapClient(GAWEB, array(
'exceptions' => true,
'trace' => true,
//'soap_version' => SOAP_1_1,
'soap_version' => SOAP_1_2,
'stream_context' => $context,
'cache_wsdl' => WSDL_CACHE_NONE
)); // Exception !! |
Je vais faire un test avec NuSoap.
PHP SoapClient avec le fichier de l'import directement
J'ai fait un test en remplacant l'url du wsdl de base par le fichier importé :
Code:
1 2 3 4 5 6
| $c = new SoapClient('http://10.221.38.11:8380/gawebrc/TarificateurWS?wsdl&resource=TarificateurWS_PortType2832624350736054634.wsdl', array(
'exceptions' => true,
'trace' => true,
'soap_version' => SOAP_1_2,
'cache_wsdl' => WSDL_CACHE_NONE
)); |
Citation:
SOAP-ERROR: Parsing WSDL: Couldn't bind to service