[XML] HTTP compression and POST method are required to go beyond this point
Bonjour,
Je suis entrain de développer un web service XML, j'anvoyer la requête par la méthode POST comme suis:
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
| $pXML="<?xml version="1.0" encoding="utf-8"?>
<GetAvailAccomAdvanced>
<Login>
<Username>xxxxxxxxxxx</Username>
<Password>xxxxxxxxxxxx</Password>
<Language>FRE</Language>
</Login>
<AcceptsRequests>N</AcceptsRequests>
<Currency>MAD</Currency>
<GetAccomLocation>
<IDcity>4984</IDcity>
</GetAccomLocation>
<GetDates>
<CheckIn>2013-03-31</CheckIn>
<CheckOut>2013-04-03</CheckOut>
</GetDates>
<GetRoomDetails><Room>
<RoomQuantity>1</RoomQuantity>
<NumAdults>1</NumAdults>
</Room>
</GetRoomDetails>
<PaymentOptions>
<IDPaymentOption>TH</IDPaymentOption>
</PaymentOptions>
<ReturnedDataOptions>
<IncludeHotelsGuest>Y</IncludeHotelsGuest>
</ReturnedDataOptions>
</GetAvailAccomAdvanced>";
$pCll="GetAvailAccomAdvanced";
$postdata2 = "pXML=".urlencode($xml)."&pCall=".urlencode($pCall);
$url_transhotel2 = "www.transhotel-dev.com"; $servletPATH2 = "/interfaces/SController";
$fp = pfsockopen( $url_transhotel2, 1184);
if( $fp ) {
fputs( $fp, "POST $servletPATH2 HTTP/1.0\n" );
fputs( $fp, "Accept: */*\n" );
$strlength = strlen( $postdata2 );
fputs( $fp, "Content-length: ".$strlength."\n\n" );
fputs($fp, "Accept-Encoding: gzip,deflate\r\n");
//fputs($fp,"content-type: application/x-gzip\n");
//$postdata2 = gzencode($postdata2);
fputs( $fp, $postdata2."\n" );
$output = "";
while(!feof($fp )) {
$output .=fgets( $fp, 1184);
}
fclose( $fp );
} |
l'erreur suivant apparaître :
Citation:
HTTP/1.1 403 Forbidden
Date: Thu, 28 Mar 2013 09:27:15 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 69
Connection: close
Content-Type: text/html; charset=iso-8859-1
HTTP compression and POST method are required to go beyond this point