Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can i format xml input for restful web service and invoke the service
    primarykey
    data
    text
    <p>Hi All I expose a service using restFul web service Server side code is </p> <p>@RequestMapping(value = "/getPerson", method = RequestMethod.POST) public ModelAndView getPerson(@RequestParam("inputXml") String inputXml) {<br> ------------------------- ----------------------------<br> } return new ModelAndView("userXmlView", BindingResult.MODEL_KEY_PREFIX + String.class, "Test"); }</p> <p>Client side implementation is: </p> <pre><code> URL oracle = new URL("http://localhost:8081/testWeb/restServices/getPerson?inputXml=input"); System.out.println("Oracle URl is "+oracle); HttpURLConnection connection = (HttpURLConnection)oracle.openConnection(); connection.setDoOutput(true); connection.setRequestProperty("Content-type", "application/xml; charset:ISO-8859-1"); connection.setRequestMethod("POST"); BufferedReader in = new BufferedReader(new InputStreamReader( connection.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) System.out.println(inputLine); in.close(); </code></pre> <p>I able to access the service using the URL <code>http://localhost:8081/testWeb/restServices/getPerson?inputXml="input"</code> Actually my requirement is, i need to pass xml string as a input like this </p> <pre><code>http://localhost:8081/testWeb/restServices/getPerson?inputXml="&lt;?xml%20version="1.0"%20encoding="UTF-8"%20standalone="yes"?&gt;&lt;product&gt;&lt;code&gt;WI1&lt;/code&gt;&lt;name&gt;Widget%20Number%20One&lt;/name&gt;&lt;price&gt;300.0&lt;/price&gt;&lt;/product&gt;" </code></pre> <p>please help me to find the solution</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload