title: How to get and perform actions of complex object in java like XML
body: <p>I have to create a bottom up webservice where I will create a class to accept complex object like XML as input and perform actions on it. Can you provide me a solution how to accept the complex object rather than String in java in webservice.</p>
  
  <pre><code>import javax.jws.WebService;
  import javax.jws.WebMethod;
  import javax.jws.WebParam;
  
  @WebService(serviceName = "HelloWorld")
  public class HelloWorld {
  
      /**
       * This is a sample web service operation
       */
      @WebMethod(operationName = "hello")
      public String hello(@WebParam(name = "name") String xml) {
  
          // My implementation to parse the xml
          return "This xml contains the following value" + txt + " !";
      }
  }
  </code></pre>
  
  <p>I don't want to get the xml as string and want to use complex object. As I have to construct the String into file.xml and again parse and again convert to string.</p>