title: Zend Soap Server / WSDL
body: <p>I've been working on a project (which I'll keep specific details out of this post with randomized data) that involves integrating our system (PHP 5.3.x+) with an API (they provided a SDK) of a major company. They provided a WSDL and claimed ours needed to match their methods and they provided examples of how output (XML generated by the Soap Server) should look.</p>
  
  <p>Right now, everything has been working as expected. When I send a XML request from SoapUI (an app I'm using to test) it all processes properly and such, but the XML output isn't matching closely with their examples and we believe they said we must be close to their examples.</p>
  
  <p>Basically, we created an agnostic class we initialize with a service name and it initializes into a non-agnostic class which is used via the following:</p>
  
  <pre><code>/**
   * The following is used to process Soap Server based on config and any optional settings.
   *
   * @param string $className
   * @param array $options
   * @param object $config
   * @return Zend_Soap_Server
   */
  public static function init($className, Array $options = null, $config = null)
  {
      // Used to define the class and return object.
      $soap_server        = new Zend_Soap_Server(null, $options);
      $soap_server-&gt;setClass($className, null, (isset($config) ? $config : null));
      $soap_server-&gt;handle();
      exit;
  }
  </code></pre>
  
  <p>The problem itself lies within the outputted response. How would you guys suggest we build the XML output if they're very specific about everything?</p>
  
  <p>1.) One of our methods is moneyTransferRequest. When I send the XML over for this, it does find the method and processes it. However, they want it to show the method name, in the response, as moneyTransferResponse but it outputs moneyTransferRequestResponse.</p>
  
  <p>2.) Our output (for variables and such sent back as an object) has multiple variables, we'll say $money for example. The field for this would return as:</p>
  
  <pre><code>&lt;money xsi:type="xsd:string"&gt;10.0&lt;/money&gt;
  </code></pre>
  
  <p>They would like it to be:</p>
  
  <pre><code>&lt;ns1:money xsi:type="xsd:string"&gt;10.0&lt;/money&gt;
  </code></pre>
  
  <p>in the return.</p>
  
  <p>I appreciate any help and input on the subject.</p>