You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jaybytez <ja...@yahoo.com> on 2011/09/01 01:34:43 UTC

User of WebParam.Mode.INOUT with Document Style Header

I was reading the specification section on WebParam.Mode.INOUT

/The direction in which the parameter is flowing.
Valid values are:

    WebParam.Mode.IN
    WebParam.Mode.OUT
    WebParam.Mode.INOUT

Default value is WebParam.Mode.IN.
If you specify WebParam.Mode.OUT or WebParam.Mode.INOUT, then the data type
of the parameter must be Holder, or extend Holder. For details, see the
JAX-RPC specification.
WebParam.Mode.OUT and *WebParam.Mode.INOUT modes are only supported for
RPC-style Web Services or for parameters that map to headers.* /

And the question is, can I use WebParam.Mode.INOUT within a Document style
service if it is header parameter?

The reason I ask is that I have a WebParam with header=true and
mode=WebParam.Mode.INOUT and I get an IllegalArgumentException claiming that
my request doesn't match the request parameters.  But when I remove the mode
altogether, the service invocation works.

Thanks for the help...jay

--
View this message in context: http://cxf.547215.n5.nabble.com/User-of-WebParam-Mode-INOUT-with-Document-Style-Header-tp4756426p4756426.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: User of WebParam.Mode.INOUT with Document Style Header

Posted by jaybytez <ja...@yahoo.com>.
So it was definitely my fault.

I forgot to wrap the header parameter with a Holder<>.

Once I did this, the WebParam.Mode.INOUT worked.

Thanks a ton!

jay

--
View this message in context: http://cxf.547215.n5.nabble.com/User-of-WebParam-Mode-INOUT-with-Document-Style-Header-tp4756426p4764622.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: User of WebParam.Mode.INOUT with Document Style Header

Posted by jaybytez <ja...@yahoo.com>.
Sure...I can see if I can replicate this in a simple JUnit.

The following is a sample of the operation and a snippet of the stacktrace.

@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED, use =
SOAPBinding.Use.LITERAL, style = SOAPBinding.Style.DOCUMENT)

    @RequestWrapper(localName = "findDocumentHistoryRecords", className =
"com.foo.documentHistoryManagerAccessService.FindDocumentHistoryRecords",
targetNamespace = "http://foo.com")
    @ResponseWrapper(localName = "findDocumentHistoryRecordsResponse",
className =
"com.foo.documentHistoryManagerAccessService.FindDocumentHistoryRecordsResponse",
targetNamespace = "http://foo.com")
    @WebResult(targetNamespace = "http://acme.com", name =
"DocumentHistory")
    Collection<DocumentHistory> findDocumentHistoryRecords(
            @WebParam(targetNamespace = "http://acme.com", name =
"pCriteria") Collection<DocumentationCriteriaXml> pCriteria,
            @WebParam(targetNamespace = "http://acme.com", name = "stateId",
header = true, mode = WebParam.Mode.INOUT) StateIdentifierXml stateId)
            throws ValidationException;

2011-09-01 21:32:27,861 [[ACTIVE] ExecuteThread: '100' for queue:
'weblogic.kernel.Default (self-tuning)'] WARN
org.apache.cxf.phase.PhaseInterceptorChain - Application
{http://foo.com}DocumentHistoryManagerAccessServiceEndpointService#{http://foo.com}findDocumentHistoryRecords
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: argument type mismatch while invoking
public abstract java.util.Collection
com.foo.DocumentHistoryManagerAccessService.findDocumentHistoryRecords(java.util.Collection,com.acme.StateIdentifierXml)
throws com.foo.exception.ValidationException with params
[[com.acme.DocumentationCriteriaXml@b196b5], javax.xml.ws.Holder@16ecb11].
        at
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:159)
~[cxf-rt-core-2.4.1.jar:2.4.1]
        at
org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86)
~[cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]
        at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:133)
~[cxf-rt-core-2.4.1.jar:2.4.1]
        at
org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:61)
~[cxf-rt-frontend-jaxws-2.4.1.jar:2.4.1]
        at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
~[cxf-rt-core-2.4.1.jar:2.4.1]
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
~[cxf-rt-core-2.4.1.jar:2.4.1]
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
~[na:1.6.0_21]
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
~[na:1.6.0_21]
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
~[na:1.6.0_21]
        at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
~[cxf-rt-core-2.4.1.jar:2.4.1]
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
~[cxf-rt-core-2.4.1.jar:2.4.1]
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
~[cxf-api-2.4.1.jar:2.4.1]
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118)
[cxf-rt-core-2.4.1.jar:2.4.1]
        at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:208)
[cxf-rt-transports-http-2.4.1.jar:2.4.1]
        at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
[cxf-rt-transports-http-2.4.1.jar:2.4.1]
        at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:205)
[cxf-rt-transports-http-2.4.1.jar:2.4.1]
        at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:113)
[cxf-rt-transports-http-2.4.1.jar:2.4.1]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184)
[cxf-rt-transports-http-2.4.1.jar:2.4.1]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:107)
[cxf-rt-transports-http-2.4.1.jar:2.4.1]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
[javax.servlet_1.0.0.0_2-5.jar:2.5]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:163)
[cxf-rt-transports-http-2.4.1.jar:2.4.1]
        at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
[weblogic.jar:10.3.4.0]
        at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
[weblogic.jar:10.3.4.0]

Thanks for the help!...jay

--
View this message in context: http://cxf.547215.n5.nabble.com/User-of-WebParam-Mode-INOUT-with-Document-Style-Header-tp4756426p4761102.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: User of WebParam.Mode.INOUT with Document Style Header

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday, August 31, 2011 4:34:43 PM jaybytez wrote:
> I was reading the specification section on WebParam.Mode.INOUT
> 
> /The direction in which the parameter is flowing.
> Valid values are:
> 
>     WebParam.Mode.IN
>     WebParam.Mode.OUT
>     WebParam.Mode.INOUT
> 
> Default value is WebParam.Mode.IN.
> If you specify WebParam.Mode.OUT or WebParam.Mode.INOUT, then the data type
> of the parameter must be Holder, or extend Holder. For details, see the
> JAX-RPC specification.
> WebParam.Mode.OUT and *WebParam.Mode.INOUT modes are only supported for
> RPC-style Web Services or for parameters that map to headers.* /
> 
> And the question is, can I use WebParam.Mode.INOUT within a Document style
> service if it is header parameter?

Actually, with CXF, you should be able to use if for Document style non-
headers as well.

> 
> The reason I ask is that I have a WebParam with header=true and
> mode=WebParam.Mode.INOUT and I get an IllegalArgumentException claiming that
> my request doesn't match the request parameters.  But when I remove the
> mode altogether, the service invocation works.

Any chance you can create a testcase and attach it to a JIRA?

Thanks!
Dan


> 
> Thanks for the help...jay
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/User-of-WebParam-Mode-INOUT-with-Document-S
> tyle-Header-tp4756426p4756426.html Sent from the cxf-user mailing list
> archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com