2011-05-24 28 views
1

私はSOAPサーバーに生のリクエストを送信するつもりです。私がこれを行うために見つけた唯一の方法は、_dorequestを呼び出すために冗長なZend_Soap_Client_Commonを作成することです。本当に必要ですか? raw xmlをサーバーに送る他の方法はありますか?事前にZend_Soap_Clientを使用してraw xmlをSOAPサーバーに送信する方法は?

$client = new Zend_Soap_Client('http://212.170.239.71/appservices/ws/FrontendService?wsdl', 
         array( 
           'soap_version'=>SOAP_1_1 
           ,'encoding' => 'UTF-8' 
           ,'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_DEFLATE 
           ,'location'=>'http://212.170.239.71/appservices/ws/FrontendService' 

         ) 
       ); 

    $location = 'http://212.170.239.71/appservices/ws/FrontendService'; 

    $request = '<?xml version="1.0" encoding="UTF-8"?> 
    <soapenv:Envelope soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
     <soapenv:Body> 
       <hb:getHotelValuedAvail xmlns:hb="http://axis.frontend.hydra.hotelbeds.com" xsi:type="xsd:anyType"> 
<HotelValuedAvailRQ echoToken="DummyEchoToken" sessionId="DummySessionId" xmlns="http://www.hotelbeds.com/schemas/2005/06/messages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hotelbeds.com/schemas/2005/06/messages HotelValuedAvailRQ.xsd"> 
    <Language>CAS</Language> 
    <Credentials> 
    <User>XXXXX</User> 
    <Password>XXXXX</Password> 
     </Credentials> 
     <PaginationData pageNumber="1"/> 
<ExtraParamList> 
     <ExtendedData type="EXT_ORDER"> 
      <Name>ORDER_CONTRACT_PRICE</Name> 
      <Value>ASC</Value> 
     </ExtendedData> 
</ExtraParamList> 
     <CheckInDate date="20110809"/> 
     <CheckOutDate date="20110811"/> 
     <Destination code="LPA" type="SIMPLE"> 
      <ZoneList> 
       <Zone code="20" type="SIMPLE"/> 
      </ZoneList> 
    </Destination> 
     <OccupancyList> 
       <HotelOccupancy> 
         <RoomCount>1</RoomCount> 
         <Occupancy> 
           <AdultCount>2</AdultCount> 
           <ChildCount>0</ChildCount> 
         </Occupancy> 
       </HotelOccupancy> 
     </OccupancyList> 
</HotelValuedAvailRQ> 
       </hb:getHotelValuedAvail> 
     </soapenv:Body> 
</soapenv:Envelope>'; 

     $clientCommon = new Zend_Soap_Client_Common($client, 'http://212.170.239.71/appservices/ws/FrontendService?wsdl', 
         array( 
           'soap_version'=>SOAP_1_1 
           ,'encoding' => 'UTF-8' 
           ,'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_DEFLATE 
           ,'location'=>'http://212.170.239.71/appservices/ws/FrontendService' 

         )); 
    $response = $client->_doRequest($clientCommon, $request, $location, 'getHotelValuedAvail', SOAP_1_1); 

     // With these two lines I've managed the call using "native" SoapClient 
     //$client = new SoapClient("http://212.170.239.71/appservices/ws/FrontendService?wsdl", array('trace'=>1)); 
     //$response = $client->__doRequest($request, $location, 'getHotelValuedAvail', SOAP_1_1); 

ありがとう:

は、ここでは、コードです。 Jorge

答えて

関連する問題