cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Access to SOAP parameters and parameter names in interceptor
Date Mon, 31 Mar 2014 20:52:37 GMT

On Mar 31, 2014, at 3:49 PM, David Hay <david.hay@enstratius.com> wrote:

> Ok, yes, that's what I'm doing on the REST side.
> 
> I've added @WebParam for the SOAP calls, but can't figure out how to access
> it by name.  Where should I expect to see them?

On the SOAP side, if you grab the BindingOperationInfo from the exchange:

BindingOperationInfo bop = exchange.getBindingOperationInfo();

you can then do:

bop.getInput().getMessageParts()

to then iterate over the parts that it deserialized.  Each part would have the “name”
as well as the index into the MessageContentsList as to where that part was stored.

Dan



> 
> 
> 
> On Fri, Mar 28, 2014 at 12:37 PM, Sergey Beryozkin <sberyozkin@gmail.com>wrote:
> 
>> You probably refer to the names set in annotations like PathParam("id") ?
>> If so then Soap WebParam should give the same info...
>> 
>> Cheers, Sergey
>> 
>> 
>> On 28/03/14 16:34, David Hay wrote:
>> 
>>> Thanks...
>>> 
>>> Unfortunately it looks like Method only gives you the param names if debug
>>> is enabled during compilation...
>>> 
>>> CXF has that info for REST calls - it doesn't for SOAP?
>>> 
>>> 
>>> On Fri, Mar 28, 2014 at 11:49 AM, Sergey Beryozkin <sberyozkin@gmail.com
>>>> wrote:
>>> 
>>> This should give the list of parameters:
>>>> final List< Object > arguments = MessageContentsList.
>>>> getContentsList(message);
>>>> 
>>>> (the values are in the order the parameters are declared)
>>>> and given the Method you can get to the names.
>>>> 
>>>> By the way, check Bean Validation feature, it will work for JAXWS,
>>>> 
>>>> http://cxf.apache.org/docs/validationfeature.html#ValidationFeature-
>>>> Configuration
>>>> 
>>>> Andriy Redko has just blogged about it too:
>>>> http://aredko.blogspot.ie/2014/03/apache-cxf-30-jax-rs-20-and-bean.html
>>>> 
>>>> Sergey
>>>> 
>>>> 
>>>> 
>>>> On 28/03/14 15:38, David Hay wrote:
>>>> 
>>>> Hi,
>>>>> 
>>>>> Sorry if I wasn't clear - I'm trying to access the parameters passed
to
>>>>> the
>>>>> backend SOAP Service methods, so x and y in this case...
>>>>> 
>>>>> public void doThis(String x, String y) {...}
>>>>> 
>>>>> 
>>>>> On Fri, Mar 28, 2014 at 9:49 AM, Jose María Zaragoza
>>>>> <demablogia@gmail.com>wrote:
>>>>> 
>>>>>  2014-03-28 14:46 GMT+01:00 David Hay <david.hay@enstratius.com>:
>>>>> 
>>>>>> 
>>>>>> Hi,
>>>>>>> 
>>>>>>> I'm sure this has been asked before, but I can't seem to find
the
>>>>>>> answer.
>>>>>>> 
>>>>>>> I need to validate SOAP parameters, so need to access the incoming
>>>>>>> parameter name/value in a Interceptor.
>>>>>>> 
>>>>>>> 
>>>>>>> What kind of SOAP parameters ?
>>>>>> 
>>>>>> 
>>>>>>  How would I do this?
>>>>>> 
>>>>>>> 
>>>>>>> cheers
>>>>>>> 
>>>>>>> David
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>> --
>>>> Sergey Beryozkin
>>>> 
>>>> Talend Community Coders
>>>> http://coders.talend.com/
>>>> 
>>>> Blog: http://sberyozkin.blogspot.com
>>>> 
>>>> 
>>> 
>> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Mime
View raw message