title: SoapClient call returns 500 Internal Server Error
body: <p>I am trying to connect to an API using PHP and its built-in SoapClient. I have checked against the url I was given through the ill-formatted documents the client gave and <code>$client-&gt;__getFunctions()</code> returns a list of three functions. <code>HelloWorld($name)</code>, which responds with <code>Hello ~name~</code>, shows me that I am communicating with the server through the SoapClient call and the URL is correct. </p>
  
  <p>However, when I try to access one of the other methods that <code>__getFunctions()</code> gives me, even after copy/pasting the XML from the docs and putting in my own credentials, I am still being given an <code>Internal Server Error</code> faultstring and <code>500</code> as faultcode from the SoapFault object. </p>
  
  <p>I am sure that it is my own XML string that is causing the issue but I cannot for the life of me figure out how. Reaching out to the API provider directly hasn't proven helpful. This is my first time dealing with Soap/Web Services so I am unsure of where to go from here. </p>
  
  <p>I did <code>wget http//xxx.xxx.xxx?wsdl</code> and it returned me what looks like a valid XML response, the same one I get when I go directly to the url in the browser. What should I be looking into in order to solve this issue? All of the past API's I've dealt with have been JSON/RESTful so I feel out of my element trying to debug PHP errors.</p>
  
  <p><em><strong>Edit</strong></em></p>
  
  <p>I have slowly deleted parts of my method call and parts of my XML string, trying to trigger a different error or something in order to find what I need to fix. What I have found is that by not passing in my XML string, I get a valid response from the <code>$client-&gt;FunctionCall(...)</code>. It's an "this isn't right" message but it's a message! In fact, passing that function ANYTHING for the xml parameter causes the <code>500 http</code> faultcode/faultstring. Does this mean that my XMl is poorly formatted or does it mean that there is an issue on their end handling requests?</p>
  
  <p><em><strong>Second Edit</strong></em></p>
  
  <p>If I make my <code>$client</code> decleration as follows, I get the faultstring <code>Could not connect to host</code></p>
  
  <pre><code>$opts = array(
      'ssl' =&gt; array('ciphers'=&gt;'RC4-SHA')
    );
  $client = new SoapClient($CREDS['orderingWSDL'], array (
  "encoding"=&gt;"ISO-8859-1",
  'stream_context' =&gt; stream_context_create($opts),
    'exceptions'=&gt;true,
  ));
  </code></pre>
  
  <p>I am getting more confused the longer I try to fix this.</p>