title: How send an object from PHP to Java web service using SOAP?
body: <p>I have a running web service (using EclipseLink as JPA provider) and would like to call the methods that updates data in the database from PHP using SOAP. <br /><br />
  A method in the web service may look something like this:</p>
  
  <pre><code>public void updatePerson(Person p){
     EntityManagerFactory emf = Persistence.createEntityManagerFactory("PersonLib");
     EntityManager em = emf.createEntityManager();
     if(!em.getTransaction().isActive()) {
        em.getTransaction().begin();
     }
     em.merge(p);
     em.getTransaction().commit();
  }
  </code></pre>
  
  <p>From PHP, I guess I have to create an object of type <code>stdClass</code> and send it as the parameter for a Person. Am I right? But I don´t get it work with these lines of code:</p>
  
  <pre><code>$client = new SoapClient("url.to.wsdl", array("trace" =&gt; 1));
  $obj = new stdClass();
  $obj-&gt;Person = new stdClass(); 
  $obj-&gt;Person-&gt;personId = 1;
  $obj-&gt;Person-&gt;name = "Peter";
  $client-&gt;updatePerson($obj);
  </code></pre>
  
  <p>I don´t know if this is the correct way to send an object from PHP to Java (well, it calls the method updatePerson(Person p) in the java application, but p doesn´t contain the data I entered in PHP).</p>