You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2007/10/19 21:16:50 UTC

[jira] Updated: (CXF-885) You cannot have some methods WRAPPED and others BARE in the same service

     [ https://issues.apache.org/jira/browse/CXF-885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-885:
----------------------------

    Component/s: Soap Binding

> 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
>          Components: Soap Binding
>    Affects Versions: 2.1
>         Environment: Linux, SunJDK1.6.0_01
>            Reporter: Chris McClelland
>            Assignee: Jervis Liu
>            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.