SoapClient throws the wrong version

When I submit the request below, I get an "Invalid version" exception.

<OTA_HotelGetMsgRQ xmlns="http://www.opentravel.org/OTA/2003/05"
    TimeStamp="2001-12-17T09:30:47.0Z" Version="4"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Messages>
        <Message HotelCode="123" HotelName="Test Hotel" ChainCode="321"
            ReasonForRequest="Reservation Retrieval" RequestCode="Optional"
            ChainName="Test Chain" MessageType="All" StartSeqNmbr="1"
            EndSeqNmbr="10" />
    </Messages>
</OTA_HotelGetMsgRQ>

the request above is converted to zend code

$client = new zend_soap_client(null,
        array(
                'location' => 'http://url...',
                'Uri' =>"http://www.opentravel.org/OTA/2003/05"
        )
);

$request = array(
        array('Messages'=> 
                array ('Message' => 
                        array (
                                'HotelCode' => '123',
                                'HotelName' => 'Test Hotel',
                                'ChainCode' => '321',
                                'ReasonForRequest' => 'Reservation Retrieval',
                                'RequestCode' => 'Optional',
                                'ChainName' => 'Test Chain',
                                'MessageType' => 'All',
                                'StartSeqNmbr' => '1',
                                'EndSeqNmbr' => '10'
                        )
                )
        )
);

$result = $client->OTA_HotelGetMsgRQ ($request);

An invalid version exception is thrown above the line. Someone help me solve this problem.

+5
source share
3 answers

it sounds like you are using the wrong version;) - did you try to add 'soap_version'=>'1.2'(or 1.1, depending on which version you need) to your soap_client parameters?

+1
source
$autodiscover = new Zend_Soap_AutoDiscover();
$autodiscover->setClass('Core_Soap_Test');
$autodiscover->setUri( sprintf($this->_WSDL_URI,0) );
$autodiscover->handle();

$this->_WSDL_URI = '"http://WWW.EXAMPLE.COM/soap/index/wsdl/%s/?wsdl'

try the code above. it helps me

+1
source

. , (, , ) , SoapFault. , -.

0

All Articles