Jump to content

how to make request array if header authentication is not present?


VineetDubey

Recommended Posts

hi friends,

I am using one API in which i need to make request for flight search, i am using soapclient to connect with the server to fetch available flights,

 

below is the xml in which request format will be.

SOAP 1.1

 

The following is a sample SOAP 1.1 request. The placeholders shown need to be replaced with actual values.

 

POST /tws_mind/Ws_TravelPortal.asmx HTTP/1.1

Host: 125.16.62.119

Content-Type: text/xml; charset=utf-8

Content-Length: length

SOAPAction: "http://tempuri.org/Ws_fnAirAvail"

 

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope 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>

    <Ws_fnAirAvail xmlns="http://tempuri.org/">

      <objReq>

        <destination>

          <string>string</string>

          <string>string</string>

        </destination>

        <domestic>boolean</domestic>

        <journeydate>

          <dateTime>dateTime</dateTime>

          <dateTime>dateTime</dateTime>

        </journeydate>

        <journeytype>string</journeytype>

        <Noofadults>int</Noofadults>

        <Noofchild>int</Noofchild>

        <Noofinfant>int</Noofinfant>

        <preferedairlines>

          <string>string</string>

          <string>string</string>

        </preferedairlines>

        <preferredclass>string</preferredclass>

        <returndate>dateTime</returndate>

        <source>

          <string>string</string>

          <string>string</string>

        </source>

        <strPreferredCarrierType>string</strPreferredCarrierType>

        <GetCachedData>boolean</GetCachedData>

      </objReq>

      <objSecurity>

        <strLoginId>string</strLoginId>

        <strPassword>string</strPassword>

      </objSecurity>

    </Ws_fnAirAvail>

  </soap:Body>

</soap:Envelope>

 

and below is the request which is made by me.

$request=array( 'objReq'=>array('destination' => "DEL",

  'domestic' => 1,

  'journeydate'=>"25/10/2011",

  'journeytype'=>"R",

  'Noofadults'=>2,

  'Noofchild'=>0,

  'Noofinfant'=>0,

  'preferedairlines'=>"",

  'preferredclass'=>"Y",

  'returndate'=>"28/10/2011",

  'source'=>"BLR",

  'strPreferredCarrierType'=>"ANY",

  'GetCachedData'=>false

)

                                        'objSecurity'=>array('strLoginId'=>"loginid",

  'strPassword'=>"password"

)

    );

$wsdl="http://*/*/?wsdl";

try{

$cliente=new SoapClient($wsdl);

$vem=$cliente->Ws_fnAirAvail($request);

}

catch (Exception $e)

{

echo $e->getMessage();

exit;

}

echo "<pre>";

print_r($vem);

 

My problem is i am getting below response, if i change the request in anyway i always get the same response.

Please correct my request in case i made bad request for the server.

 

stdClass Object

(

    [Ws_fnAirAvailResult] => stdClass Object

        (

            [objclsException] => stdClass Object

                (

                    [errorcode] => GEN0E0006

                    [errortype] => E

                    [errordesc] => Please provide Security object.

                )

 

            [strMessage] =>

        )

 

)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.