Re: XML-Request
| From: | Björn Bartels | Date: | Sat, 14 Jan 2006 12:47:01 +0000 |
| Subject: | Re: XML-Request | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-228615@lists.php.net to get a copy of this message | ||
Hi there,
try this as your first output line:
$this_output = "<?xml version=\"1.0\"
encoding=\"".$_XMLCONFIG["enc-type"]."\"?".">";
hope that helps...
cheers
björn
>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 = "
";
>$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!
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Björn Bartels
-Development/IT-Services-
----------------------------------------------
dbusiness.de gmbh
digital business & printing gmbh
Greifswalder Str. 152
D-10409 Berlin
Fon: [0.30] 4.21.19.95
Fax: [0.30] 4.21.19.74
www.dbusiness.de
info@dbusiness.de
ftp://dbusiness.dyndns.org