使用Web服务的肥皂:编码:对象没有'任何'属性

时间:2018-04-14 03:59:05

标签: php web-services soap

我有这个WSDL http://testxml.e-tsw.com/AffiliateService/AffiliateService.svc?Wsdl

我正在尝试使用SoapClient通过以下代码向Book方法发送请求:

$this->db->where('username', $this->input->post('username'))

我收到以下错误: SOAP-ERROR:编码:对象没有'任何'属性

重要信息:如果我尝试使用Gethotels和以下xml和“funcion”它可以工作,但是当我尝试“预订”时没有。

    <?php

$xml = '<Request Type="Reservation" Version="1.0">
    <affiliateid>AF-TVOD</affiliateid>
    <language>esp</language>
    <currency>PE</currency>
    <uid>m2r32b14es10socxtxs4y4ht</uid>
    <ip>201.147.113.232</ip>
    <firstname>prueba</firstname>
    <lastname>prueba</lastname>
    <emailaddress>prueba@bestday.com</emailaddress>
    <country>MX</country>
    <address>bonampak 4</address>
    <city>cancun</city>
    <state>QROO</state>
    <zip>77500</zip>
    <total>12346.51</total>
    <naturalperson>
    <gender></gender>
    <nationality></nationality>
    <number></number>
    <type></type>
    </naturalperson>
    <legalperson>
    <businessname></businessname>
    <number></number>
    <type></type>
    </legalperson>
    <phones>
    <phone>
    <type>2</type>
    <number>9981454221</number>
    </phone>
    </phones>
    <hotels>
    <hotel>
    <hotelid>100</hotelid>
    <roomtype>SUPOV</roomtype>
    <mealplan>EP</mealplan>
    <datearrival>20141113</datearrival>
    <datedeparture>20141115</datedeparture>
    <couponid></couponid>
    <marketid>INTER</marketid>
    <contractid>2</contractid>
    <dutypercent>0</dutypercent>
    <rooms>
    <room>
    <amount>985.34</amount>
    <status>AV</status>
    <ratekey>90cba867-f916-4fb9-8cb4-ec925ded0fb3</ratekey>
    <adults>1</adults>
    <kids>1</kids>
    <k1a>5</k1a>
    </room>
    </rooms>
    </hotel>
    </hotels>
    <flights>
    <flight>
    <quoteid>1885e28d-5198-4dd5-92e6-6cee14a66b1b</quoteid>
    <ratekey>bc1b40db-b0fb-40ff-92b3-6b7cde0d8685</ratekey>
    <passengers>
    <passenger>
    <isadult>Y</isadult>
    <agechild></agechild>
    <firstname>Prueba</firstname>
    <lastname>Prueba</lastname>
    <daybirthday>05</daybirthday>
    <monthbirthday>06</monthbirthday>
    <yearbirthday>1905</yearbirthday>
    <numberfrecuent></numberfrecuent>
    <idfrecuent></idfrecuent>
    <naturalperson>
    <type></type>
    <number></number>
    </naturalperson>
    </passenger>
    </passengers>
    <contacts>
    <contact>
    <firstname>Prueba</firstname>
    <lastname>Prueba</lastname>
    <email></email>
    <phones>
    <phone>
    <type>1</type>
    <number>(+52)654654646</number>
    </phone>
    </phones>
    </contact>
    </contacts>
    </flight>
    </flights>
    <shuttles>
    <shuttle>
    <shuttleid>599</shuttleid>
    <shuttletype>R</shuttletype>
    <adults>2</adults>
    <kids>0</kids>
    <airportarrival>Aeropuerto Internacional de Cancun </airportarrival>
    <airlinearrival>AC</airlinearrival>
    <datearrival>20140501</datearrival>
    <hourarrival>18:00</hourarrival>
    <flightarrival>123</flightarrival>
    <airlinedeparture>PU</airlinedeparture>
    <datedeparture>20140502</datedeparture>
    <hourdeparture>04:00</hourdeparture>
    <flightdeparture>456</flightdeparture>
    <hotelid>640</hotelid>
    <amount>724.8</amount>
    </shuttle>
    </shuttles>
    <insurances>
    <insurance>
    <insuranceid>12</insuranceid>
    <adults>2</adults>
    <children>0</children>
    <amount>105.1049</amount>
    <ratekey>4f2b132f-6663-427a-aa75-61c5d8e37635</ratekey>
    </insurance>
    </insurances>
    <cars>
    <car>
    <agency>2</agency>
    <sipp>AR133</sipp>
    <amount>869.76</amount>
    <brancharrival>139</brancharrival>
    <airportarrival>CUN</airportarrival>
    <datearrival>20140501</datearrival>
    <hourarrival>12:00</hourarrival>
    <branchdeparture>139</branchdeparture>
    <airportdeparture>CUN</airportdeparture>
    <datedeparture>20140502</datedeparture>
    <hourdeparture>12:00</hourdeparture>
    </car>
    </cars>
    <tours>
    <tour>
    <tourid>413</tourid>
    <serviceid>1</serviceid>
    <cityid>NOCIUDAD</cityid>
    <adults>2</adults>
    <kids>0</kids>
    <datetour>20140711</datetour>
    <hotelname>Cancun Clipper Club, Cancun Zona Hotelera Punta Cancun, Mexico</hotelname>
    <timetour>00:00</timetour>
    <amount>2035.62</amount>
    <dutypercent>0</dutypercent>
    </tour>
    </tours>
    <payments>
    <cardpayment>
    <type>86</type>
    <bank>BC3</bank>
    <number>XXXXXXXXXXXXXX</number>
    <securitycode>1212</securitycode>
    <expirationmonth>03</expirationmonth>
    <expirationyear>2018</expirationyear>
    <holdername>prueba prueba</holdername>
    <address>bonampak 4</address>
    <city>cancun</city>
    <state>QROO</state>
    <country>MX</country>
    <zip>77500</zip>
    <amount>12346.51</amount>
    </cardpayment>
    </payments>
    </Request>';


$funcion = "Book";    
ini_set('soap.wsdl_cache_enabled', 0);    
$wsdl = 'http://testxml.e-tsw.com/AffiliateService/AffiliateService.svc?Wsdl';    
$client = new SoapClient($wsdl);    
$xml_reserva = simplexml_load_string($xml, NULL, LIBXML_NOCDATA);
try {
    $respuesta = $client->__soapCall($funcion, array('Parameters' => $xml_reserva));
    } catch (SoapFault $exception) {
        echo $exception->getMessage();

    }
?>

0 个答案:

没有答案