public function NewBusinessSubmission() {
$data = "<?xml version='1.0' encoding='UTF-8'?>
<TXLife>
<UserAuthRequest>
<UserLoginName>Name</UserLoginName>
<UserPswd>
<Pswd>Pswd</Pswd>
</UserPswd>
</UserAuthRequest>
<TXLifeRequest>
<TransRefGUID>635306765673272986</TransRefGUID>
<TransType tc='103'>103</TransType>
<TransExeDate>2014-03-17</TransExeDate>
<TransExeTime>18:07:35</TransExeTime>
<OLifE>
<Holding id='Holding_1'>
<Policy>
<ProductCode>CYX220_00</ProductCode>
<EffDate>2014-03-29 06:05:00</EffDate>
<Life>
<FaceUnits>1</FaceUnits>
<OLifEExtension VendorCode='10'>
<FlightNumber>CZ6250</FlightNumber>
<FlightTime>2014-03-29 18:05:00</FlightTime>
<NeedSMS>T</NeedSMS>
</OLifEExtension>
</Life>
</Policy>
</Holding>
<Party id='Party_1'>
<FullName>test</FullName>
<GovtID>110108196703025474</GovtID>
<GovtIDTC tc='1'>1</GovtIDTC>
<Person>
<Gender tc='1'>1</Gender>
<BirthDate>1967-03-02</BirthDate>
</Person>
<Phone>
<PhoneTypeCode tc='12'>Mobile</PhoneTypeCode>
<DialNumber>13000000000</DialNumber>
</Phone>
</Party>
<Party id='Party_2'>
<FullName>test</FullName>
<GovtID>110108196703025474</GovtID>
<GovtIDTC tc='1'>1</GovtIDTC>
<Person>
<Gender tc='1'>1</Gender>
<BirthDate>1967-03-02</BirthDate>
</Person>
<Phone>
<PhoneTypeCode tc='12'>Mobile</PhoneTypeCode>
<DialNumber>13000000000</DialNumber>
</Phone>
</Party>
<Relation RelatedObjectID='Party_1' OriginatingObjectID='Holding_1' id='Relation_1'>
<OriginatingObjectType tc='4'>Holding</OriginatingObjectType>
<RelatedObjectType tc='6'>Party</RelatedObjectType>
<RelationRoleCode tc='8'>Owner</RelationRoleCode>
</Relation>
<Relation RelatedObjectID='Party_2' OriginatingObjectID='Holding_1' id='Relation_2'>
<OriginatingObjectType tc='4'>Holding</OriginatingObjectType>
<RelatedObjectType tc='6'>Party</RelatedObjectType>
<RelationRoleCode tc='32'>Insured</RelationRoleCode>
</Relation>
<Relation RelatedObjectID='Party_2' OriginatingObjectID='Party_1' id='Relation_3'>
<OriginatingObjectType tc='6'>Party</OriginatingObjectType>
<RelatedObjectType tc='6'>Party</RelatedObjectType>
<RelationRoleCode tc='168'>Self</RelationRoleCode>
</Relation>
</OLifE>
<OLifEExtension>
<PartnerCode>PartnerCode</PartnerCode>
</OLifEExtension>
</TXLifeRequest>
</TXLife>";
//提交参数获取信息
$url = 'http://ur'; //测试地址
$header[] = "Content-type: text/xml";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0); //定义是否显示状态头 1:显示 ; 0:不显示
curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //定义请求类型
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); //定义提交的数据,这里是XML文件
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch); var_dump($response); }代码大概是这样的,但貌似提交不了,接口也说是没收到请求,求助!
$data = "<?xml version='1.0' encoding='UTF-8'?>
<TXLife>
<UserAuthRequest>
<UserLoginName>Name</UserLoginName>
<UserPswd>
<Pswd>Pswd</Pswd>
</UserPswd>
</UserAuthRequest>
<TXLifeRequest>
<TransRefGUID>635306765673272986</TransRefGUID>
<TransType tc='103'>103</TransType>
<TransExeDate>2014-03-17</TransExeDate>
<TransExeTime>18:07:35</TransExeTime>
<OLifE>
<Holding id='Holding_1'>
<Policy>
<ProductCode>CYX220_00</ProductCode>
<EffDate>2014-03-29 06:05:00</EffDate>
<Life>
<FaceUnits>1</FaceUnits>
<OLifEExtension VendorCode='10'>
<FlightNumber>CZ6250</FlightNumber>
<FlightTime>2014-03-29 18:05:00</FlightTime>
<NeedSMS>T</NeedSMS>
</OLifEExtension>
</Life>
</Policy>
</Holding>
<Party id='Party_1'>
<FullName>test</FullName>
<GovtID>110108196703025474</GovtID>
<GovtIDTC tc='1'>1</GovtIDTC>
<Person>
<Gender tc='1'>1</Gender>
<BirthDate>1967-03-02</BirthDate>
</Person>
<Phone>
<PhoneTypeCode tc='12'>Mobile</PhoneTypeCode>
<DialNumber>13000000000</DialNumber>
</Phone>
</Party>
<Party id='Party_2'>
<FullName>test</FullName>
<GovtID>110108196703025474</GovtID>
<GovtIDTC tc='1'>1</GovtIDTC>
<Person>
<Gender tc='1'>1</Gender>
<BirthDate>1967-03-02</BirthDate>
</Person>
<Phone>
<PhoneTypeCode tc='12'>Mobile</PhoneTypeCode>
<DialNumber>13000000000</DialNumber>
</Phone>
</Party>
<Relation RelatedObjectID='Party_1' OriginatingObjectID='Holding_1' id='Relation_1'>
<OriginatingObjectType tc='4'>Holding</OriginatingObjectType>
<RelatedObjectType tc='6'>Party</RelatedObjectType>
<RelationRoleCode tc='8'>Owner</RelationRoleCode>
</Relation>
<Relation RelatedObjectID='Party_2' OriginatingObjectID='Holding_1' id='Relation_2'>
<OriginatingObjectType tc='4'>Holding</OriginatingObjectType>
<RelatedObjectType tc='6'>Party</RelatedObjectType>
<RelationRoleCode tc='32'>Insured</RelationRoleCode>
</Relation>
<Relation RelatedObjectID='Party_2' OriginatingObjectID='Party_1' id='Relation_3'>
<OriginatingObjectType tc='6'>Party</OriginatingObjectType>
<RelatedObjectType tc='6'>Party</RelatedObjectType>
<RelationRoleCode tc='168'>Self</RelationRoleCode>
</Relation>
</OLifE>
<OLifEExtension>
<PartnerCode>PartnerCode</PartnerCode>
</OLifEExtension>
</TXLifeRequest>
</TXLife>";
//提交参数获取信息
$url = 'http://ur'; //测试地址
$header[] = "Content-type: text/xml";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0); //定义是否显示状态头 1:显示 ; 0:不显示
curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //定义请求类型
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); //定义提交的数据,这里是XML文件
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch); var_dump($response); }代码大概是这样的,但貌似提交不了,接口也说是没收到请求,求助!
Curl error: 空的var_dump打印出来是false