Zend framework 如何使用Zend_SOAP_客户端将原始xml发送到SOAP服务器?
我正在尝试向SOAP服务器发送一个原始请求。我发现实现这一点的唯一方法是创建一个冗余的Zend_Soap_Client_Common以调用_dorequest。真的有必要吗?是否有其他方法将原始xml发送到服务器 代码如下:Zend framework 如何使用Zend_SOAP_客户端将原始xml发送到SOAP服务器?,zend-framework,zend-soap,Zend Framework,Zend Soap,我正在尝试向SOAP服务器发送一个原始请求。我发现实现这一点的唯一方法是创建一个冗余的Zend_Soap_Client_Common以调用_dorequest。真的有必要吗?是否有其他方法将原始xml发送到服务器 代码如下: $client = new Zend_Soap_Client('http://212.170.239.71/appservices/ws/FrontendService?wsdl', array(
$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);
$client=新的Zend\u Soap\u客户端('http://212.170.239.71/appservices/ws/FrontendService?wsdl',
数组(
“soap\U版本”=>soap\U 1\U 1
,“编码”=>“UTF-8”
,'compression'=>SOAP_compression_ACCEPT | SOAP_compression_DEFLATE
,'location'=>'http://212.170.239.71/appservices/ws/FrontendService'
)
);
$location='1http://212.170.239.71/appservices/ws/FrontendService';
$request='1
中科院
XXXXX
XXXXX
订单\合同\价格
ASC
1.
2.
0
';
$clientCommon=new Zend\u Soap\u Client\u Common($Client,'http://212.170.239.71/appservices/ws/FrontendService?wsdl',
数组(
“soap\U版本”=>soap\U 1\U 1
,“编码”=>“UTF-8”
,'compression'=>SOAP_compression_ACCEPT | SOAP_compression_DEFLATE
,'location'=>'http://212.170.239.71/appservices/ws/FrontendService'
));
$response=$client->\u doRequest($clientCommon,$request,$location,'getHotelValuedAvail',SOAP\u 1\u 1);
//通过这两行代码,我使用“本机”SoapClient管理了调用
//$client=新的SoapClient(“http://212.170.239.71/appservices/ws/FrontendService?wsdl,数组('trace'=>1));
//$response=$client->\u doRequest($request,$location,'getHotelValuedAvail',SOAP\u 1\u 1);
提前谢谢。
豪尔赫