You are here: XML-Request « PHP « IT news, forums, messages
XML-Request

Posted by "Ron Eggler (Paykiosks)" on 01/13/06 02:46

Hi, I gotta send an XML request to a server. In the doc it's defined as
follows:
[request]
<xs:request xmlns:xs='urn:pinXpressSchema' version='1.5' langCode='en'>

<DEALERinfo aspName=‘XXX’

dealerName=''

posName='1234'

posPassword='1234'

userName=''

userPassword='1234' />

<purchasePINs transID='1234567890' ticket='true' ticketWidth='32' />

</xs:request>
[/request]
and I tried to realize it that way:
[Code]
<?php
$n = "\n\n";
$aspName="XXX";
$dealerName="paykiosks";
$posName="998745";
$posPasswords="998745";
$userName="";
$userPassword="";

$inputdata = '<xs:request xmlns:xs=\'urn:pinXpressSchema\' version=\'1.5\' langCode=\'en\'>'.$n.'
<DEALERinfo aspName='.$aspName.'
dealerName='.$dealerName.'
posName='.$posName.'
posPassword='.$posPassword.'
userName='.$userName.'
userPassword='.$userPassword.'/>
<purchasePINs transID=1234567890 ticket=true ticketWidth=32 />
</xs:request>';
$x = curl_init("https://xml.pinsprepaid.com/xml/xmlPinXpress.asp");
curl_setopt($x, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($x, CURLOPT_HEADER, 0);
curl_setopt($x, CURLOPT_POST, 1);
curl_setopt($x, CURLOPT_POSTFIELDS, $inputdata);
curl_setopt($x, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($x, CURLOPT_REFERER, "http://localhost/test.php");
curl_setopt($x, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($x);
curl_close($x);
echo $data;
?>
[Code]
but I only got the Answer:
"invalid xml"

Why, what's going wrong? Thank you for your help!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация