This will become quite a bit easier when JAX-WS 2.2/JAXB-2.2  is released and 
we start working toward that as @XmlElement will be allowed on the parameters.  
 
Until then, there are two options:

1) Write your own JAXB wrapper beans that have the appropriate @XmlElement 
annotations and such and register them with the 
@RequestWrapper/@ResponseWrapper annotations.   You can use the java2ws tool 
with the -wrapperBeans flag to create the initial versions that you then 
modify.    

2) Write a subclass of AbstractServiceConfiguration that overrides the various 
methods (Boolean isWrapperPartNillable(MessagePartInfo mpi), Long 
getWrapperPartMinOccurs(MessagePartInfo mpi), etc...) to return whatever you 
need it to return.    Then configure that in via some spring config.   That's 
a bit tricky as you need the JAX-WS configs as well.   

<jaxws:endpoint
       id="aps200"
       implementor="com.test.IdAccountProvisioningWebServiceImpl"
        address="/id-account-provisioning-service/2.0.0" >
    <jaxws:serviceFactory>
         <bean class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
              <property name="serviceConfigurations">
                 <list>
    <bean class="com.foo.MyConfiguration"/>
    <bean class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration"/>
    <bean class="org.apache.cxf.service.factory.DefaultServiceConfiguration"/>
                </list>
         </bean>
    </jaxws:serviceFactory>
<jaxws:endpoint>


Dan


On Mon August 10 2009 9:37:41 am Jacek Furmankiewicz wrote:
> I am exposing a code-first webservice via Spring using the jaxws:endpoint,
> e.g.:
>
>     <import resource="classpath:META-INF/cxf/cxf.xml" />
>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>
>     <jaxws:endpoint
>       id="aps200"
>       implementor="com.test.IdAccountProvisioningWebServiceImpl"
>        address="/id-account-provisioning-service/2.0.0" />
>
> How do I control the minOccurs on my method parameters? I want them all to
> be set to 1 and nillable=false by default?
>
> I've seen some entries in the Wiki for Aegis and ServiceFactory, etc...but
> I do not have any of these in my Spring config...just the simple
> jaxws:endpoint.
>
> Thanks,
> Jacek

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to