title: creating php request with xml file
body: <p>I am using a service from a website for my private project. </p>
  
  <p>I have a xml file like this one: </p>
  
  
  
  <p></p>
  
  <pre><code>&lt;Request Originator="xxxxx" Company="xxx"&gt;
  
      &lt;Range Code="xx"&gt;
  
          &lt;Item Id="xxxxxx-xxxxx-xxxxxx-xxx-7E8B94462F2C" /&gt;
  
      &lt;/Range&gt;
  
      &lt;KeyValues&gt;
  
          &lt;Translations&gt;
  
              &lt;Language Value="de" /&gt;
  
              &lt;Language Value="en" /&gt;
  
          &lt;/Translations&gt;
  
          &lt;Regions Show="true" /&gt;
  
          &lt;Towns Show="true" /&gt;
  
      &lt;/KeyValues&gt;
  
  &lt;/Request&gt;
  </code></pre>
  
  <p>
   <strong>EDIT</strong>
  So for what i know till today: is one i send a request to this url: <a href="http://interface.deskline.net/DSI/KeyValue.asmx?WSDL" rel="nofollow noreferrer">http://interface.deskline.net/DSI/KeyValue.asmx?WSDL</a>
  With that server i make a communication but always get this error message:</p>
  
  <pre><code>soap:ReceiverSystem.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read() at System.Xml.XmlReader.MoveToContent() at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement() at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp; abortProcessing) --- End of inner exception stack trace ---1
  </code></pre>
  
  <p>I don't get it the communication. and here is a little of the php code that i wrote: </p>
  
  <pre><code>$url = 'http://interfacetest.deskline.net/DSI/KeyValue.asmx';
  
  
  $content = 0;
  if (file_exists('/mm/request.xml')) {
      $xml = fopen('/mm/request.xml', "r");
      $content =  fread($xml,filesize("/mm/request.xml"));
      fclose($xml);
  } else {
      echo 'No file, no request';
  }
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  // Following line is compulsary to add as it is:
  curl_setopt($ch, CURLOPT_POSTFIELDS,
      "xmlRequest=" . $content);
  $response = curl_exec($ch);
  echo $response;
  </code></pre>