You cannot have some methods WRAPPED and others BARE in the same service
------------------------------------------------------------------------
Key: CXF-885
URL: https://issues.apache.org/jira/browse/CXF-885
Project: CXF
Issue Type: Bug
Affects Versions: 2.1
Environment: Linux, SunJDK1.6.0_01
Reporter: Chris McClelland
Priority: Minor
Fix For: 2.1
If I deploy a service like this:
@WebService(targetNamespace="http://foo.com")
public class Test {
@WebMethod(operationName="Simple")
@WebResult(name="SimpleResponse", targetNamespace=NS_URI)
@SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE)
public String simple(@WebParam(name="Simple") String req)
{
return "Hello " + req;
}
@WebMethod(operationName="Hello")
@WebResult(name="Result")
@SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
public String hello(
@WebParam(name="A") String a,
@WebParam(name="B") String b)
{
return "Hello " + a + " and " + b;
}
}
And then call the hello() method like this:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<req:Hello xmlns:req="http://foo.com">
<A>Dan</A>
<B>Chris</B>
</req:Hello>
</soap:Body>
</soap:Envelope>
...I get this (incorrect) response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Result>Hello Dan and Chris</Result>
</soap:Body>
</soap:Envelope>
It's incorrect because the WSDL promises that the response will be an
unqualified 'Result' element locally-valid within an
{http://foo.com}:HelloResponse element.
Now if I switch the simple() method to WRAPPED, and try calling hello() again,
I get the correct response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:HelloResponse xmlns:ns1="http://foo.com">
<Result>Hello Dan and Chris</Result>
</ns1:HelloResponse>
</soap:Body>
</soap:Envelope>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.