title: Complex Type not mapping in WSDL PHP
body: <p>I'm new to WSDL's and am running into an issue with a complex type. Basically its as if the input message is not using the complexType as the type for the input message. </p>
  
  <p>I purposely misspelled the namespace on the output message so I could return what was being passed to the server. What is returned is everything that is sent in the client code. What i would expect, if for soap to cast any type to match the WSDL and to strip any extras, or at least throw an error.</p>
  
  <p>Is there something wrong with my code, or with my understanding of what should happen to the input?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Client:</p>
  
  <pre><code>ini_set("soap.wsdl_cache_enabled", "0");
  
  $client = new SoapClient('http://example.com/Service_v1.wsdl', array("trace" =&gt; 1));
  
  $request['UAT'] = 'fdgdfg';
  $request['TemplateID'] = '236';
  $request['To'] = 'email@address.com';
  $request['From'] = 'mail@address.com';
  $request['Org'] = 'PPRG';
  $request['Order'] = 'order_number';
  $request['Fake'] = 'fakefake';
  $request['DeliverTimestamp'] = '2012-09-01 00:00:00';
  
  
  var_dump($client-&gt;newEmail($request));
  
  echo "&lt;br&gt;&lt;br&gt;&lt;br&gt;" .htmlentities($client-&gt;__getLastRequest() );
  </code></pre>
  
  <p>Server:</p>
  
  <pre><code>ini_set("soap.wsdl_cache_enabled", "0");
  
  
  class CreateEmail {
  
  function newEmail($request) {
      return array('Status' =&gt; $request, 'ReferenceID' =&gt; 123);
      }
  }
  
  
  $server = new SoapServer("Service_v1.wsdl");
  
  $server-&gt;setClass("CreateEmail");
  
  $server-&gt;handle();
  </code></pre>
  
  <p>WSDL:</p>
  
  <pre><code>&lt;definitions name="Service_v1"  targetNamespace="http://example.com/Service_v1" xmlns="http://schemas.xmlsoap.org/wsdl/"    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"  xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"   xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  
  
  &lt;wsdl:types&gt;
      &lt;xsd:element name="TransactionDetail"&gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:complexContent mixed="true"&gt;
                  &lt;xsd:restriction base="xsd:anyType"&gt;                    
                      &lt;xsd:element name="UAT" type="xsd:boolean" minOccurs="0" maxOccurs="1"/&gt;
                      &lt;xsd:element name="TemplateID" type="xsd:integer" minOccurs="1" maxOccurs="1"/&gt;
                      &lt;xsd:element name="To" type="xsd:string" minOccurs="1" maxOccurs="1"/&gt;
                      &lt;xsd:element name="From" type="xsd:string" minOccurs="1" maxOccurs="1"/&gt;
                      &lt;xsd:element name="Org" type="xsd:string" minOccurs="1" maxOccurs="1"/&gt;
                      &lt;xsd:element name="Order" type="xsd:string" minOccurs="1" maxOccurs="1"/&gt;
                      &lt;xsd:element name="DeliverTimestamp" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/&gt;
                  &lt;/xsd:restriction&gt;
              &lt;/xsd:complexContent&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
  
  &lt;/wsdl:types&gt;
  
  &lt;message name="CreateEmailRequest"&gt;
      &lt;part name="emailInfo" element="tns:TransactionDetail"/&gt;
  &lt;/message&gt;
  
  &lt;message name="CreateEmailReply"&gt;
      &lt;part name="Status" type="xs:boolean"/&gt;
      &lt;part name="ReferenceID" type="xsd:integer"/&gt;
  &lt;/message&gt;
  
  &lt;portType name='CreateEmailPortType'&gt;
      &lt;operation name='newEmail'&gt;
          &lt;input message='tns:CreateEmailRequest'/&gt;
          &lt;output message='tns:CreateEmailReply'/&gt;
      &lt;/operation&gt;
  &lt;/portType&gt;
  
  &lt;binding name='CreateEmailBinding' type='tns:CreateEmailPortType'&gt;
      &lt;soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/&gt;
  
      &lt;operation name='newEmail'&gt;
          &lt;soap:operation soapAction='urn:xmethods-delayed-quotes#newEmail'/&gt;
          &lt;input&gt;
              &lt;soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/&gt;
          &lt;/input&gt;
  
          &lt;output&gt;
              &lt;soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/&gt;
          &lt;/output&gt;
      &lt;/operation&gt;
  &lt;/binding&gt;
  
  &lt;service name='CreateEmailService'&gt;
    &lt;port name='CreateEmailPort' binding='CreateEmailBinding'&gt;
      &lt;soap:address location='http://example.com/CreateEmail.php'/&gt;
    &lt;/port&gt;
  &lt;/service&gt;
  
  &lt;/definitions&gt;
  </code></pre>