cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damien B (JIRA)" <>
Subject [jira] Created: (CXF-1478) WebParam ignored in service implementation
Date Fri, 14 Mar 2008 18:30:24 GMT
WebParam ignored in service implementation

                 Key: CXF-1478
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.0.4
            Reporter: Damien B

I have a very simple WSDL (see attached file), Doc/Lit/bare.
I generate with WSDL2Java server + impl. The generated Jax-WS interface looks like this:
public interface TestDocLit {

    @ResponseWrapper(localName = "operation1Response", targetNamespace = "",
className = "org.example.testdoclit.Operation1Response")
    @RequestWrapper(localName = "operation1", targetNamespace = "",
className = "org.example.testdoclit.Operation1")
    @WebResult(name = "out", targetNamespace = "")
    @WebMethod(action = "")
    public java.lang.String operation1(
        @WebParam(name = "par1", targetNamespace = "")
        int par1

We note that WebParam is correct (no namespace, "par1").

The service is tested like this:
ServerFactoryBean svrFactory = new ServerFactoryBean();
svrFactory.setServiceBean(new TestDocLitImpl());

final Service service = Service.create(TestDocLit_Service.SERVICE);
service.addPort(TestDocLit_Service.TestDocLitSOAP, SOAPBinding.SOAP11HTTP_BINDING, url);
service.getPort(TestDocLit_Service.TestDocLitSOAP, TestDocLit.class).operation1(42);

The message sent by the client seems correct:
<soap:Envelope xmlns:soap=""><soap:Body><ns2:operation1

But debugging through DocLiteralInInterceptor::getPara, it appears that the service expects
a ("":"arg0"), whereas it receives a ("":par1), thus, we have
in return the dreaded:
null while invoking public abstract java.lang.String org.example.testdoclit.TestDocLit.operation1(int)
with params [null].

So, the server has basically lost the parameter's name, and added a target namespace which
(maybe) not due.
At http://localhost:9000/TestDocLit?wsdl, the generated WSDL exposes this fact as well:
<wsdl:message name="operation1">
    <wsdl:part element="tns:operation1" name="parameters">
and tns:operation1 is defined below:
<xsd:element name="operation1" type="tns:operation1"/>
<xsd:complexType name="operation1">
<xsd:element name="arg0" type="xsd:int"/>

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message