将带有curl的xml字符串发布到Web服务

Am having a nightmare understanding why this is not working.

I need to post leads from are database to are lead pool server.

here is the code am using

    $xmlcontent = '<?xml version="1.0"?> 
<LeadpoolImport xmlns="http://www.xxxxxx.com/ns/LeadpoolImport/Version2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<Applications>'; 

$xmldetals = '<Application>
 <LeadBatch>1</LeadBatch>
  <Source>1</Source> 
  <MainApplicant> 
  <Applicant> 
  <Type>Client</Type>
   <Name>'; 

    $xmlt = "<Title>".$_GET['tit']."</Title>";
    $xmls = "<Surname>".$_GET['sname']."</Surname>";  


      $xmlend = '</Name>
      <ContactDetails> 
      <ContactTelephone> 
      <TelephoneNumber>00000000000000</TelephoneNumber> 
      </ContactTelephone> 
      </ContactDetails> 
      </Applicant> 
      </MainApplicant> 
      </Application> 
      </Applications> 
      </LeadpoolImport>';


    $xmltext = "xmlText=$xmlcontent$xmldetals$xmlt$xmls$xmlend&RequestID=54345456";

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_URL, "http://xxxxxxxxxx:xx/Leadpool/importleads.asmx?op=sendxxxxxLeadXML");
    //curl_setopt($ch, CURLOPT_URL, "http://nxxxxxx.xx.xx/dump.php?");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER , 0);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "$xmltext");
    $result = curl_exec ($ch);

When I post to a dump file on are server it creates a correctly formatted xml string which when posted directly in to the web services works perfectly.

The problem is when i try posting directly to it we get nothing am guessing its a problem with how i am sending the post

Any help would be great

thanks

You should urlencode data sending in POST.

Change following line: $xmltext="xmlText=".urlencode("$xmlcontent$xmldetals$xmlt$xmls$xmlend")."&RequestID=54345456";