我想使用ELOIS网络服务
Webservice界面:
要请求定价(请参阅XML请求):
用于身份验证:
有关定价:
语法调用:
要通过SOAP使用Web服务,要使用的参数是:
Url: http://wsdev.elois.fr/Elois_Call.php
SOAPAction: getTarifs
<auth>
<reference_courtier>ELOIS</reference_courtier>
<code_courtier>001234567</code_courtier>
<mot_de_passe_courtier>5d7a98bddsfg465qdfs0cb1ab4887eae8
</mot_de_passe_courtier>
<action>devispdf</action>
<code_produit>ACCEOPLUS</code_produit>
</auth>
<datas>
<reference_devis>123321</reference_devis>
<civilite1>Madame</civilite1>
<nom1>DUPONT</nom1>
<prenom1>Rosie</prenom1>
<date_naissance1>1970-02-01</date_naissance1>
<adresse1>25, rue Buffon</adresse1>
<code_postal1>75017</code_postal1>
<ville1>Paris</ville1>
<telephone1>06 06 06 06 06</telephone1>
<email1>mail@mail.fr</email1>
<perte_emploi1>non</perte_emploi1>
<dos_psy1>non</dos_psy1>
<chargement1>T30</chargement1>
<profession1>assureur</profession1>
<caution1>emprunteur</caution1>
<franchise1>90</franchise1>
<projet>travaux</projet>
<pret1Montant>100000</pret1Montant>
<pret1Quotite1>100</pret1Quotite1>
<pret1Garantie1>dcptia66</pret1Garantie1>
<pret1Duree>240</pret1Duree>
<pret1DiffAmor>0</pret1DiffAmor>
<pret1Taux>4</pret1Taux>
<pret1TypeTaux>fixe</pret1TypeTaux>
<date_effet>2014-09-25</date_effet>
<typePret1>Amort</typePret1>
</datas>
Web服务返回的响应
<DEVIS>
<IDENTIF>
<code_courtier>00123456</code_courtier>
<code_produit>ACCEOPLUS</code_produit>
<reference_devis>1234567</reference_devis>
</IDENTIF>
<ERROR>
</ERROR>
<TARIFS>
<pret1>
<montant>500000</montant>
<quotite>100</quotite>
<duree>160</duree>
<DCPTIA>4422.79</DCPTIA>
<ITTIPTIPP>3184.44</ITTIPTIPP>
<PE>0</PE>
<fraisAdhesion>176</fraisAdhesion>
<mensualite>47.5451875</mensualite>
<coutTotal>7607.23</coutTotal>
<tauxAnnuelMoyen>0.1141</tauxAnnuelMoyen>
</pret1>
<pret2>
<montant>120000</montant>
<quotite>100</quotite>
<duree>240</duree>
<DCPTIA>1920</DCPTIA>
<ITTIPTIPP>1280</ITTIPTIPP>
<PE>0</PE>
<fraisAdhesion>176</fraisAdhesion>
<mensualite>14.295833333333</mensualite>
<coutTotal>3431</coutTotal>
<tauxAnnuelMoyen>0.143</tauxAnnuelMoyen>
</pret2>
</TARIFS>
<PDF>
<libelle>DevisACCEOPLUS</libelle>
<url>http://www.elois.fr/modules/acceoplus/tmpdevis/WS145464549475.pdf
</url>
</PDF>
我想创建一个php脚本,将SOAP XML请求发送到Web服务并接收响应
我试过这个剧本:
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('display_startup_errors', true);
$test = 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd="http://www.w3.org/2001/XMLSchema” xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<auth>
<reference_courtier>ELOIS</reference_courtier>
<code_courtier>001234567</code_courtier>
...
<date_effet>2014-09-25</date_effet>
<typePret1>Amort</typePret1>
</datas>
</soap:Body>
</soap:Envelope>';
//Change this variables.
//$location_URL = 'http://write_your_location_url.asmx';
//$action_URL = 'http://write_your_action_to_perform_url.asmx”';
$location_URL = 'http://wsdev.elois.fr/Elois_Call.php';
$action_URL = 'getTarifs';
$client = new SoapClient(null, array(
'location' => $location_URL,
'uri' => '',
'trace' => 1,
));
try{
$order_return = $client->__doRequest($test,$location_URL,$action_URL,1);
//Get response from here
print_r($order_return);
}catch (SoapFault $exception){
var_dump(get_class($exception));
var_dump($exception);
}
?>
Web服务返回此错误:
SOAP-ENV:ClientBad Request