Estou tentando fazer um web service que receba e responda JSON, mas não esta dando muito certo 
Sempre que mando um parametro em JSON para o webService ele me retorna
status code: 500
<?xml version='1.0' encoding='UTF-8'?>http://www.w3.org/2005/08/addressing/soap/faultsoapenv:Receivercom.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '{' (code 123) in prolog; expected '<'
Response body:at [row,col {unknown-source}]: [1,1]</soapenv:Text></soapenv:Reason>soapenv:Detail/</soapenv:Fault></soapenv:Body></soapenv:Envelope>
ja fiz as configurações necessarias no axis2.xml mas o erro persiste.
classe Client:
public static void main(String[] args) {
try {
StringBuilder builder = new StringBuilder();
builder.append("{")
.append("\"echoUser\": {\n")
.append("\"user\": {\n")
.append("\"name\": \"myame\",\n")
.append("\"surname\": \"mysurname\",\n")
.append("\"middleName\": \"mymiddleName\",\n")
.append("\"age\": \"123\",\n")
.append("\"address\": {\n")
.append("\"country\": \"mycountry\",\n")
.append("\"city\": \"mycity\",\n")
.append("\"street\": \"mystreet\",\n")
.append("\"building\": \"mybuilding\",\n")
.append("\"flat\": \"myflat\",\n")
.append("\"zipCode\": \"myzipCode\"\n")
.append("}\n")
.append("}\n")
.append("}\n")
.append("}");
JsonClient jsonClient = new JsonClient();
jsonClient.post(builder.toString());
} catch (Exception ex) {
Logger.getLogger(JsonClient.class.getName()).log(Level.SEVERE, null, ex);
}
}
public boolean post(String message) {
PostMethod post = null;
try {
post = new PostMethod(url);
RequestEntity entity = new StringRequestEntity(message, contentType, charSet);
post.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: ");
System.out.println(post.getResponseBodyAsString());
} catch (HttpException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
post.releaseConnection();
}
return false;
}}