title: Passing arguments to Class constructor PHP SOAP?
body: <p>I am trying to pass arguments to the class constructor, but have not been successful. I have tried the following</p>
  
  <p>PHP </p>
  
  <pre><code>$c = "site.wsdl";
  $client = new SoapClient($c,array('classmap' =&gt; array('state' =&gt; "mystate",'county' =&gt;  "mycounty")),array("trace"=&gt; 1,"exceptions" =&gt; 1)); 
  
  $client = new SoapClient($c,array('classmap' =&gt; array('state' =&gt; "mystate",'county' =&gt;  "mycounty")));
  
  $client = new SoapClient($c,array('state' =&gt; "mystate",'county'=&gt;"mycounty"));
  </code></pre>
  
  <p>Webservice Code Java</p>
  
  <pre><code>@WebService
  public class MyWebservice{
   String test =  "";
  
  /**
   * 
   * @param county
   * @param state
   */
  public MyWebservice(@WebParam(name = "county") String county,
              @WebParam(name = "state") String state) {   
  
      test= county+"_"+state;
              //want to use this String elsewhere in the class
  }
  
  }
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>Fatal error: Uncaught SoapFault exception: [S:Server] com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class
  </code></pre>
  
  <p>If I remove the parameters from the constructor  I do not have any issues creating the soap client.  </p>
  
  <p>Thank you for you help.</p>