title: How to call Struts Action from Jersey Web Service
body: <p>I am Mobile App Developer so I don't know much about Web technologies.</p>
  
  <p>Currently I am working on one project in which I am using Jersey for Mobile Web Service and main web site is in Struts1.</p>
  
  <p>I want to call / pass some variables to Struts action from my web service but I don't know how can I call and pass some variable to that action.</p>
  
  <p>Lets say this is url </p>
  
  <blockquote>
  <pre><code>www.xyz.com/xyz/yyy/market/free/XYZAction.do.do?announce.id=1121&amp;note=testing
  </code></pre>
  </blockquote>
  
  <p>of my action and I have to pass 2 parameter <code>announce.id</code> and <code>note</code></p>
  
  <p>Here is my code</p>
  
  <pre class="lang-java prettyprint-override"><code>Client client = Client.create();
  WebResource webResource = client.resource("www.xyz.com/xyzWebservice/module/market/free/XYZAction.do");
  
  String input = "{\"note\": \"This is note thank you\", "
                + "\"announce.id\":\"48298\", \"profil\":\"13855\", "
                + "\"idprofil\":\"13855\",\"portage\":\"false\"}";
  
  // POST method
  ClientResponse response = webResource.accept("multipart/form-data")
                            .type("multipart/form-data")
                            .post(ClientResponse.class, input);
  
  
  // check response status code
  if (response.getStatus() != 200) {
       throw new RuntimeException("Failed : HTTP error code : "
                 + response.getStatus());
  }
  
  
  // display response
  String output = response.getEntity(String.class);
  System.out.println("Output from Server .... ");
  System.out.println(output + "\n");
  </code></pre>
  
  <p>But it's not working.</p>