I am new to Spring-WS and I had to create a WebService for my project. So to try some examples, I downloaded spring-webservices-samples from http://code.google.com/p/spring-webservices-samples/
When I deploy the war file and test using SoapUI; I am getting weird characters (like ce,1a,0 ) in the response message and the "CalculateResponse" element is empty.
<ns2:CalculateResponse xmlns:ns2='http://www.marvelution.com/samples/schemas/CalculatorServiceSchema'/>
And there is no exceptions. I tried to debug but no luck.
Please help me with the issue. I really appreciate any input.
I am using JBoss 4.2.3, Java 1.6 (64 bit).
I tried deploying the same war file in Tomcat-7.0.29 and it works. But I have to get my WebService working in JBoss 4.2.3
Request Captured using TCPMon:
POST /annotated-payload-endpoint/calculatorService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://www.marvelution.com/samples/definitions/CalculatorService/Add"
Content-Length: 377
Host: 127.0.0.1:9999
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cal="http://www.marvelution.com/samples/schemas/CalculatorServiceSchema">
<soapenv:Header/>
<soapenv:Body>
<cal:Add>
<!--2 or more repetitions:-->
<cal:number>1</cal:number>
<cal:number>2</cal:number>
</cal:Add>
</soapenv:Body>
</soapenv:Envelope>
Response Captured using TCPMon:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
SOAPAction: ""
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Fri, 20 Jul 2012 01:47:23 GMT
ce
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:CalculateResponse xmlns:ns2='http://www.marvelution.com/samples/schemas/CalculatorServiceSchema'/>
1a
</env:Body></env:Envelope>
0
Endpoint: CalculatorEndpoint.java
@PayloadRoot(namespace = "http://www.marvelution.com/samples/schemas/CalculatorServiceSchema", localPart = "Add")
public CalculateResponse add(Add numbers) {
CalculateResponse res = wrapResult(calculator.add(numbers.getNumber()));
System.out.println("Response before sending:"+res.getResult());
return res;
}
The System.out.println right before returning the response is getting printed. I am not sure where these characters are getting added and why the response is incomplete.
Thanks, Jeg