You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jdemic <jo...@gmail.com> on 2007/08/22 19:55:25 UTC

Interceptor Issue

Hey All,

My apologies if I'm missing something basic, but I'm trying to get the in
and out interceptors going with spring/cxf and I'm having some problems.  I
generated my webservice using the wsdl2java tool and have it configured in
spring as follows:

<jaxws:endpoint
            id="endpoint"
            wsdlLocation="endpoint.wsdl"
            implementor="#endpointPort"
            address="/endpoint">
        <jaxws:inInterceptors>
            <bean class="endpoint.soap.interceptor.SoapDebugInterceptor"/>
        </jaxws:inInterceptors>
        <jaxws:outInterceptors>
            <bean class="endpoint.soap.interceptor.SoapDebugInterceptor"/>
        </jaxws:outInterceptors>
    </jaxws:endpoint>

My interceptor code looks like this:

public class SoapDebugInterceptor extends AbstractSoapInterceptor {
    public void handleMessage(SoapMessage soapMessage) throws Fault {
        System.out.println("FIRING INTERCEPTOR");      
    }
}

I am not, however, seeing the interceptor fire at all.  I've additionally
tried the annotations configuration with the same results.  I'm on cxf
2.0.1.

Any help is appreciated,
-jd
-- 
View this message in context: http://www.nabble.com/Interceptor-Issue-tf4313110.html#a12279774
Sent from the cxf-user mailing list archive at Nabble.com.


Re: SOAPBinding Use.ENCODED ?

Posted by Daniel Kulp <dk...@apache.org>.
Good question.   You'll probably be hard pressed to find any "modern" web 
service stacks the support it.   As Glen mentioned, the WSI-BP 
specifically discourages the use of encoded as it's very complex, under 
specified, and generally a pain to get to interoperate.  

If you NEED encoded, I would suggest either Axis 1 or google for other 
JAX-RPC based solutions.  Maybe even the JAX-RPC ref impl from Sun.  
That said, if you're developing a service, definitely stick with 
literal.


Dan


On Wednesday 29 August 2007, trichter wrote:
> HI,
>
> I ran into the same problem, banging my head at why the Use.ENCODED
> setting is not picked up. Does anyone know whether there are plans to
> include this capability in CXF? Why would my alternatives be if I
> needed encoded?
>
> Thanks.
>
> bmargulies wrote:
> > CXF doesn't support Encoded.
> >
> >> -----Original Message-----
> >> From: Chris Campbell [mailto:ccampbell@quaris.com]
> >> Sent: Wednesday, August 22, 2007 5:22 PM
> >> To: cxf-user@incubator.apache.org
> >> Subject: SOAPBinding Use.ENCODED ?
> >>
> >> I need encoded response, since some of my data has "Illegal
> >> character (NULL, unicode 0) encountered"
> >>
> >> I added
> >>
> >> @SOAPBinding(style=Style.RPC, use=Use.ENCODED)
> >>
> >> to my service interface, but the generated wsdl has use=literal,
> >> for example
> >>
> >> <wsdl:operation name="execute">
> >> <soap:operation soapAction="" style="rpc"/>
> >> 	<wsdl:input name="execute">
> >> <soap:body namespace="http://query.soap.quaris.com/"
> >> use="literal"/> </wsdl:input>
> >> 	<wsdl:output name="executeResponse">
> >> <soap:body namespace="http://query.soap.quaris.com/"
> >> use="literal"/> </wsdl:output>
> >> </wsdl:operation>
> >>
> >> Am I missing something?
> >>
> >> Thanks.



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

RE: SOAPBinding Use.ENCODED ?

Posted by Glen Mazza <gl...@verizon.net>.
Axis2 does not support RPC/encoded[1] apparently because it is not WS-I
compliant[2]--they tell their users to stay with the older Axis1 if they
must have RPC/encoded.  You may wish to consider Axis1 then (which
unfortunately will probably create other problems for you.)

Glen

[1] http://marc.info/?l=axis-user&m=118807112903325&w=2
[2] http://marc.info/?l=axis-user&m=118579681226453&w=2


Am Mittwoch, den 29.08.2007, 07:53 -0700 schrieb trichter:
> HI,
> 
> I ran into the same problem, banging my head at why the Use.ENCODED setting
> is not picked up. Does anyone know whether there are plans to include this
> capability in CXF? Why would my alternatives be if I needed encoded?
> 
> Thanks.
> 
> 
> 
> bmargulies wrote:
> > 
> > CXF doesn't support Encoded.
> > 
> >> -----Original Message-----
> >> From: Chris Campbell [mailto:ccampbell@quaris.com]
> >> Sent: Wednesday, August 22, 2007 5:22 PM
> >> To: cxf-user@incubator.apache.org
> >> Subject: SOAPBinding Use.ENCODED ?
> >> 
> >> I need encoded response, since some of my data has "Illegal
> >> character (NULL, unicode 0) encountered"
> >> 
> >> I added
> >> 
> >> @SOAPBinding(style=Style.RPC, use=Use.ENCODED)
> >> 
> >> to my service interface, but the generated wsdl has use=literal, for
> >> example
> >> 
> >> <wsdl:operation name="execute">
> >> <soap:operation soapAction="" style="rpc"/>
> >> 	<wsdl:input name="execute">
> >> <soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
> >> </wsdl:input>
> >> 	<wsdl:output name="executeResponse">
> >> <soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
> >> </wsdl:output>
> >> </wsdl:operation>
> >> 
> >> Am I missing something?
> >> 
> >> Thanks.
> >> 
> > 
> > 
> > 
> 


Re: SOAPBinding Use.ENCODED ?

Posted by Chris Campbell <cc...@quaris.com>.
I followed the user guide, my implementation is pretty simple so
far, but it does what I need.

http://cwiki.apache.org/CXF20DOC/mtom.html

Skip down to the java first part. I found that I got errors if I
used the JAXB annotations on the payload class, but found they were
not necessary. Otherwise, my services are annotated as yours are. I
have a payload object that has a DataHandler which will be where the
binary data goes.


trichter wrote:
> Hi Chris and others,
> 
> thanks for the bunch of replies. I read up the WS-I document on
> http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html a bit, and
> found R1007-R1007 stating that encoded is not the preferred way (anymore).
> 
> @Chris
> As for using MTOM, what were the other parameters (style, parameterStyle)
> you made it work with?
> At the moment I I have Document or RPC / LITERAL and wrapped parameter style
> which helps me when handling complex method parameters / array / collection
> types on my *WebMethods*.
> 
> Thanks!
> 
> 
> 
> Chris Campbell-6 wrote:
>> FYI- I ended up using MTOM for this, works great.
>>
> 

Re: SOAPBinding Use.ENCODED ?

Posted by trichter <to...@tomtom.com>.
Hi Chris and others,

thanks for the bunch of replies. I read up the WS-I document on
http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html a bit, and
found R1007-R1007 stating that encoded is not the preferred way (anymore).

@Chris
As for using MTOM, what were the other parameters (style, parameterStyle)
you made it work with?
At the moment I I have Document or RPC / LITERAL and wrapped parameter style
which helps me when handling complex method parameters / array / collection
types on my *WebMethods*.

Thanks!



Chris Campbell-6 wrote:
> 
> FYI- I ended up using MTOM for this, works great.
> 

-- 
View this message in context: http://www.nabble.com/Interceptor-Issue-tf4313110.html#a12401464
Sent from the cxf-user mailing list archive at Nabble.com.


Re: SOAPBinding Use.ENCODED ?

Posted by Chris Campbell <cc...@quaris.com>.
FYI- I ended up using MTOM for this, works great.

trichter wrote:
> HI,
> 
> I ran into the same problem, banging my head at why the Use.ENCODED setting
> is not picked up. Does anyone know whether there are plans to include this
> capability in CXF? Why would my alternatives be if I needed encoded?
> 
> Thanks.
> 
> 
> 
> bmargulies wrote:
>> CXF doesn't support Encoded.
>>
>>> -----Original Message-----
>>> From: Chris Campbell [mailto:ccampbell@quaris.com]
>>> Sent: Wednesday, August 22, 2007 5:22 PM
>>> To: cxf-user@incubator.apache.org
>>> Subject: SOAPBinding Use.ENCODED ?
>>>
>>> I need encoded response, since some of my data has "Illegal
>>> character (NULL, unicode 0) encountered"
>>>
>>> I added
>>>
>>> @SOAPBinding(style=Style.RPC, use=Use.ENCODED)
>>>
>>> to my service interface, but the generated wsdl has use=literal, for
>>> example
>>>
>>> <wsdl:operation name="execute">
>>> <soap:operation soapAction="" style="rpc"/>
>>> 	<wsdl:input name="execute">
>>> <soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
>>> </wsdl:input>
>>> 	<wsdl:output name="executeResponse">
>>> <soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
>>> </wsdl:output>
>>> </wsdl:operation>
>>>
>>> Am I missing something?
>>>
>>> Thanks.
>>>
>>
>>
> 

RE: SOAPBinding Use.ENCODED ?

Posted by trichter <to...@tomtom.com>.
HI,

I ran into the same problem, banging my head at why the Use.ENCODED setting
is not picked up. Does anyone know whether there are plans to include this
capability in CXF? Why would my alternatives be if I needed encoded?

Thanks.



bmargulies wrote:
> 
> CXF doesn't support Encoded.
> 
>> -----Original Message-----
>> From: Chris Campbell [mailto:ccampbell@quaris.com]
>> Sent: Wednesday, August 22, 2007 5:22 PM
>> To: cxf-user@incubator.apache.org
>> Subject: SOAPBinding Use.ENCODED ?
>> 
>> I need encoded response, since some of my data has "Illegal
>> character (NULL, unicode 0) encountered"
>> 
>> I added
>> 
>> @SOAPBinding(style=Style.RPC, use=Use.ENCODED)
>> 
>> to my service interface, but the generated wsdl has use=literal, for
>> example
>> 
>> <wsdl:operation name="execute">
>> <soap:operation soapAction="" style="rpc"/>
>> 	<wsdl:input name="execute">
>> <soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
>> </wsdl:input>
>> 	<wsdl:output name="executeResponse">
>> <soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
>> </wsdl:output>
>> </wsdl:operation>
>> 
>> Am I missing something?
>> 
>> Thanks.
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Interceptor-Issue-tf4313110.html#a12388726
Sent from the cxf-user mailing list archive at Nabble.com.


Re: SOAPBinding Use.ENCODED ?

Posted by Chris Campbell <cc...@quaris.com>.
How does one configure or intercept and change the encoding of soap
messages in cxf?

Benson Margulies wrote:
> CXF doesn't support Encoded.
> 
>> -----Original Message-----
>> From: Chris Campbell [mailto:ccampbell@quaris.com]
>> Sent: Wednesday, August 22, 2007 5:22 PM
>> To: cxf-user@incubator.apache.org
>> Subject: SOAPBinding Use.ENCODED ?
>>
>> I need encoded response, since some of my data has "Illegal
>> character (NULL, unicode 0) encountered"
>>
>> I added
>>
>> @SOAPBinding(style=Style.RPC, use=Use.ENCODED)
>>
>> to my service interface, but the generated wsdl has use=literal, for
>> example
>>
>> <wsdl:operation name="execute">
>> <soap:operation soapAction="" style="rpc"/>
>> 	<wsdl:input name="execute">
>> <soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
>> </wsdl:input>
>> 	<wsdl:output name="executeResponse">
>> <soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
>> </wsdl:output>
>> </wsdl:operation>
>>
>> Am I missing something?
>>
>> Thanks.
>>
> 
> 

RE: SOAPBinding Use.ENCODED ?

Posted by Benson Margulies <bi...@basistech.com>.
CXF doesn't support Encoded.

> -----Original Message-----
> From: Chris Campbell [mailto:ccampbell@quaris.com]
> Sent: Wednesday, August 22, 2007 5:22 PM
> To: cxf-user@incubator.apache.org
> Subject: SOAPBinding Use.ENCODED ?
> 
> I need encoded response, since some of my data has "Illegal
> character (NULL, unicode 0) encountered"
> 
> I added
> 
> @SOAPBinding(style=Style.RPC, use=Use.ENCODED)
> 
> to my service interface, but the generated wsdl has use=literal, for
> example
> 
> <wsdl:operation name="execute">
> <soap:operation soapAction="" style="rpc"/>
> 	<wsdl:input name="execute">
> <soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
> </wsdl:input>
> 	<wsdl:output name="executeResponse">
> <soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> 
> Am I missing something?
> 
> Thanks.
> 


SOAPBinding Use.ENCODED ?

Posted by Chris Campbell <cc...@quaris.com>.
I need encoded response, since some of my data has "Illegal
character (NULL, unicode 0) encountered"

I added

@SOAPBinding(style=Style.RPC, use=Use.ENCODED)

to my service interface, but the generated wsdl has use=literal, for
example

<wsdl:operation name="execute">
<soap:operation soapAction="" style="rpc"/>
	<wsdl:input name="execute">
<soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
</wsdl:input>
	<wsdl:output name="executeResponse">
<soap:body namespace="http://query.soap.quaris.com/" use="literal"/>
</wsdl:output>
</wsdl:operation>

Am I missing something?

Thanks.



Re: Interceptor Issue

Posted by jdemic <jo...@gmail.com>.

bah, just realized i needed to set the phase in the constructor of the
interceptor. My apologies for the noise...




jdemic wrote:
> 
> Hey All,
> 
> My apologies if I'm missing something basic, but I'm trying to get the in
> and out interceptors going with spring/cxf and I'm having some problems. 
> I generated my webservice using the wsdl2java tool and have it configured
> in spring as follows:
> 
> <jaxws:endpoint
>             id="endpoint"
>             wsdlLocation="endpoint.wsdl"
>             implementor="#endpointPort"
>             address="/endpoint">
>         <jaxws:inInterceptors>
>             <bean class="endpoint.soap.interceptor.SoapDebugInterceptor"/>
>         </jaxws:inInterceptors>
>         <jaxws:outInterceptors>
>             <bean class="endpoint.soap.interceptor.SoapDebugInterceptor"/>
>         </jaxws:outInterceptors>
>     </jaxws:endpoint>
> 
> My interceptor code looks like this:
> 
> public class SoapDebugInterceptor extends AbstractSoapInterceptor {
>     public void handleMessage(SoapMessage soapMessage) throws Fault {
>         System.out.println("FIRING INTERCEPTOR");      
>     }
> }
> 
> I am not, however, seeing the interceptor fire at all.  I've additionally
> tried the annotations configuration with the same results.  I'm on cxf
> 2.0.1.
> 
> Any help is appreciated,
> -jd
> 

-- 
View this message in context: http://www.nabble.com/Interceptor-Issue-tf4313110.html#a12281207
Sent from the cxf-user mailing list archive at Nabble.com.