I'm currently using CXF 3.0-SNAPSHOT's wsdl2java utility to generate
server-side code. When I issue a request that should be valid to the server,
I receive an exception about "org.apache.cxf.interceptor.Fault: wrong number
of arguments while invoking...". I'm unsure of why I'm receiving this
exception; CXF apparently can't find the correct operation to route the
request to, and I think it may be a bug in the way that Handlers are dealt
with somehow.

I have request/response messages defined for an operation named 'Test' in my
WSDL. If it's relevant, the binding does specify a request header. The
following are the WSDL/XSD elements associated with this:
WSDL (operation/binding parts omitted):
    <wsdl:message name="TestRequest">
        <wsdl:part element="rnceum:Test" name="parameters" />
    </wsdl:message>

    <wsdl:message name="TestResponse">
        <wsdl:part element="rnceum:TestResponse" name="parameters" />
    </wsdl:message>

XSD elements:
Request:
    <xs:element name="Test">
        <xs:complexType>
            <xs:sequence/>
        </xs:complexType>
    </xs:element>

Response:
    <xs:element name="TestResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="responseValueOne" type="xs:int"
minOccurs="1" maxOccurs="1"/>
                <xs:element name="responseValueTwo" type="xs:int"
minOccurs="1" maxOccurs="1"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

This creates the following operation in the generated PortType:
    @RequestWrapper(localName = "Test", targetNamespace =
"urn:messages.enduser.test.ws.company.com/v1", className =
"com.company.ws.test.enduser.messages.v1.Test")
    @WebMethod(operationName = "Test", action = "Test")
    @ResponseWrapper(localName = "TestResponse", targetNamespace =
"urn:messages.enduser.test.ws.company.com/v1", className =
"com.company.ws.test.enduser.messages.v1.TestResponse")
    public void test(
        @WebParam(name = "ClientInfoHeader", targetNamespace =
"urn:messages.common.test.ws.company.com/v1", header = true)
        com.company.ws.test.common.messages.v1.ClientInfoHeader
requestHeader,
        @WebParam(mode = WebParam.Mode.OUT, name = "responseValueOne",
targetNamespace = "urn:messages.enduser.test.ws.company.com/v1")
        javax.xml.ws.Holder<java.lang.Integer> responseValueOne,
        @WebParam(mode = WebParam.Mode.OUT, name = "responseValueTwo",
targetNamespace = "urn:messages.enduser.test.ws.company.com/v1")
        javax.xml.ws.Holder<java.lang.Integer> responseValueTwo
    ) throws RequestErrorFault, UnexpectedErrorFault, InvalidURLFault,
ServerErrorFault;

In my PortTypeImpl class, I have the following function declaration
(auto-generated by IDE off of the PortType class):
    @Override
    public void test(ClientInfoHeader requestHeader, Holder<Integer>
responseValueOne, Holder<Integer> responseValueTwo) throws
RequestErrorFault, UnexpectedErrorFault, InvalidURLFault, ServerErrorFault
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

When I issue the following XML request, I receive the error:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/";>
<s:Header>
<h:ClientInfoHeader xmlns:h="urn:messages.common.test.ws.company.com/v1"
xmlns="urn:messages.common.test.ws.company.com/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
    <AppID>C# Test App</AppID>
</h:ClientInfoHeader>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
    <Test xmlns="urn:messages.enduser.test.ws.company.com/v1"/>
</s:Body>
</s:Envelope>

The error follows:
Sep 15, 2010 4:17:01 PM org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLogging
WARNING: Application
{urn:wsdl.enduser.test.ws.company.com/v1}WSEndUserService#{urn:wsdl.enduser.test.ws.company.com/v1}Test
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: wrong number of arguments while invoking
public void
com.company.ws.test.enduser.wsdl.v1.WSEndUserPortTypeImpl.test(com.company.ws.test.common.messages.v1.ClientInfoHeader,javax.xml.ws.Holder,javax.xml.ws.Holder)
throws
com.company.ws.test.enduser.wsdl.v1.RequestErrorFault,com.company.ws.test.enduser.wsdl.v1.UnexpectedErrorFault,com.company.ws.test.enduser.wsdl.v1.InvalidURLFault,com.company.ws.test.enduser.wsdl.v1.ServerErrorFault
with params [].
        at
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:159)
        at
org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86)
        at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:133)
        at
org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:60)
        at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:311)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:275)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException: wrong number of arguments
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
        at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
        ... 28 more

It's as if the server is expecting me to somehow specify the Holders as
parameters in the XML somehow, but that's incorrect. Is there something I'm
doing wrong, or could this possibly be a bug in CXF? Any help is greatly
appreciated!
-- 
View this message in context: 
http://cxf.547215.n5.nabble.com/Problem-with-unwrapped-responses-containing-multiple-elements-tp2841497p2841497.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to