You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Gabo Manuel <km...@solegysystems.com> on 2009/02/18 11:34:46 UTC

[JAXWS] Inquiry on jaxws:server

Hi All,

I was hoping to do the following:

    <jaxws:server id="soapServer" address="/soap">
        <jaxws:serviceBean>
            <jaxws:endpoint address="/Service1" 
implementor="com.domain.Service1" />
            <jaxws:endpoint address="/Service2" 
implementor="com.domain.Service2" />
        </jaxws:serviceBean>
        <!-- or maybe this...
        <jaxws:serviceBean>
            <bean class="com.domain.Service1" />
            <bean class="com.domain.Service2" />
        </jaxws:serviceBean>
         -->

        <jaxws:inInterceptors>
            <bean name="usernameTokenInterceptor"
                class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
                <constructor-arg>
                    <map>
                        <entry key="action" value="UsernameToken" />
                        <entry key="passwordType" value="PasswordDigest" />
                        <entry key="passwordCallbackRef">
                            <bean 
class="com.domain.soap.handlers.SoapPasswordCallback" />
                        </entry>
                    </map>
                </constructor-arg>
            </bean>
        </jaxws:inInterceptors>
    </jaxws:server>


I know it is perfectly possible to do the following instead:

    <jaxws:endpoint address="/Service1" implementor="com.domain.Service1" >
        <jaxws:inInterceptors>
            <ref bean="usernameTokenInterceptor"/>
        </jaxws:inInterceptors>
    </jaxws:endpoint>
    <jaxws:endpoint address="/Service2" implementor="com.domain.Service2" >
        <jaxws:inInterceptors>
            <ref bean="usernameTokenInterceptor"/>
        </jaxws:inInterceptors>
    </jaxws:endpoint>
    <bean name="usernameTokenInterceptor"
        class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
        <constructor-arg>
            <map>
                <entry key="action" value="UsernameToken" />
                <entry key="passwordType" value="PasswordDigest" />
                <entry key="passwordCallbackRef">
                    <bean 
class="com.domain.soap.handlers.SoapPasswordCallback" />
                </entry>
            </map>
        </constructor-arg>
    </bean>

I was just hoping to reduce the number of times

        <jaxws:inInterceptors>
            <ref bean="usernameTokenInterceptor"/>
        </jaxws:inInterceptors>

has to appear in the xml.

Thanks in advance.

Gabo

Re: [JAXWS] Inquiry on jaxws:server

Posted by Gabo Manuel <km...@solegysystems.com>.
Hi Dan,

Thanks for the response. I'll see what I could do from the 
MediatorInInterceptor class you mentioned. But for now, I'll stay with 
the multiple tags. :)

Thanks!

Gabo

Daniel Kulp wrote:
> On Thu August 13 2009 5:10:08 am Gabo Manuel wrote:
>   
>> Hi Guys,
>>
>> Just want to check if there is the possibility of having multiple
>> serviceBean tags under a jaxws:server tag or if there is a way to
>> configure multiple jaxws:endpoint tags in a single location.
>>     
>
> There isn't an "easy" way to do this.   I'm not even sure you CAN do this via 
> straight spring config.   You can look at:
> https://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/versioning/
> to kind of get an idea of what needs to be done.   
>
> Basically, you need to enable the multiplexing with the property on the 
> jaxws:endpoint/jaxws:server tags.   That will allow multiple endpoints to use 
> the same URL.   However, you would need to write an interceptor that would 
> somehow chose the correct endpoint and somehow get that registered on the 
> MultiplexEndpointObserver.   Not sure quite how to do that in the spring 
> config.
>
> Basically, it's definitely NOT a suggested thing to do.
>  
>   
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.5.392 / Virus Database: 270.13.58/2308 - Release Date: 08/16/09 21:46:00
>
>   

Re: [JAXWS] Inquiry on jaxws:server

Posted by Daniel Kulp <dk...@apache.org>.
On Thu August 13 2009 5:10:08 am Gabo Manuel wrote:
> Hi Guys,
>
> Just want to check if there is the possibility of having multiple
> serviceBean tags under a jaxws:server tag or if there is a way to
> configure multiple jaxws:endpoint tags in a single location.

There isn't an "easy" way to do this.   I'm not even sure you CAN do this via 
straight spring config.   You can look at:
https://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/versioning/
to kind of get an idea of what needs to be done.   

Basically, you need to enable the multiplexing with the property on the 
jaxws:endpoint/jaxws:server tags.   That will allow multiple endpoints to use 
the same URL.   However, you would need to write an interceptor that would 
somehow chose the correct endpoint and somehow get that registered on the 
MultiplexEndpointObserver.   Not sure quite how to do that in the spring 
config.

Basically, it's definitely NOT a suggested thing to do.
 
-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: [JAXWS] Inquiry on jaxws:server

Posted by Gabo Manuel <km...@solegysystems.com>.
Hi Guys,

Just want to check if there is the possibility of having multiple 
serviceBean tags under a jaxws:server tag or if there is a way to 
configure multiple jaxws:endpoint tags in a single location.

Thanks in advance.

Gabo