You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by yulinxp <yu...@gmail.com> on 2008/02/05 16:55:37 UTC

set Default minOccurs and nillable Parameters

This section explains how to set Default minOccurs and nillable Parameters
using Java API.
Is there anyway we could do it through xml file?

http://cwiki.apache.org/CXF20DOC/aegis-databinding.html

-- 
View this message in context: http://www.nabble.com/set-Default-minOccurs-and-nillable-Parameters-tp15291545p15291545.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: set Default minOccurs and nillable Parameters

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 27 February 2008, Brad Harper wrote:
> Can this be done using JAXB?  These nillable attributes are the bane
> of my existence...  Is there anyway to make them go away?

Depends on where in the schema and who is generating them....

The nillables in the actual java beans that you return can be removed by 
adding nillable=false to the @XmlElement declaration in the beans.

The nillables in the wrapper elements/types that are created by CXF can 
only be removed by writing wrapper beans that have the nillable=false 
and using the @RequestWrapper annotations to point at the wrappers.  
This can be made easier with 2.1 by using the java2ws tool with 
the -wrapperbean flag to generate the initial versions that you can 
modify.

Dan



>
> On Tue, Feb 5, 2008 at 1:12 PM, Benson Margulies
> <bi...@gmail.com>
>
> wrote:
> > On Tue, 2008-02-05 at 07:55 -0800, yulinxp wrote:
> > > This section explains how to set Default minOccurs and nillable
> >
> > Parameters
> >
> > > using Java API.
> > > Is there anyway we could do it through xml file?
> > >
> > > http://cwiki.apache.org/CXF20DOC/aegis-databinding.html
> >
> > Start from here, and add a Configuration bean to the
> > AegisDatabinding.
> >
> > <simple:server id="aegis-service"
> >                serviceClass="
> > org.apache.cxf.javascript.fortest.AegisService"
> >                address="http://localhost:8808/aegis">
> >                <simple:serviceBean>
> >                        <bean
> >                                class="
> > org.apache.cxf.javascript.fortest.AegisServiceImpl" />
> >                </simple:serviceBean>
> >                <simple:dataBinding>
> >                        <bean
> >                                class="
> > org.apache.cxf.aegis.databinding.AegisDatabinding">
> >                        </bean>
> >                </simple:dataBinding>
> >                <simple:serviceFactory>
> >                        <bean
> >                                class='
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean'>
> >                                <property name="properties">
> >                                        <map>
> >                                                <entry
> > key="overrideTypesList">
> >                                                        <list>
> >                                                               
> > <value> org.apache.cxf.javascript.fortest.aegis.Mammal</value>
> >                                                        </list>
> >                                                </entry>
> >                                        </map>
> >                                </property>
> >                        </bean>
> >                </simple:serviceFactory>
> >        </simple:server>



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: set Default minOccurs and nillable Parameters

Posted by Brad Harper <br...@gmail.com>.
Can this be done using JAXB?  These nillable attributes are the bane of my
existence...  Is there anyway to make them go away?

On Tue, Feb 5, 2008 at 1:12 PM, Benson Margulies <bi...@gmail.com>
wrote:

>
> On Tue, 2008-02-05 at 07:55 -0800, yulinxp wrote:
> > This section explains how to set Default minOccurs and nillable
> Parameters
> > using Java API.
> > Is there anyway we could do it through xml file?
> >
> > http://cwiki.apache.org/CXF20DOC/aegis-databinding.html
> >
>
> Start from here, and add a Configuration bean to the AegisDatabinding.
>
> <simple:server id="aegis-service"
>                serviceClass="
> org.apache.cxf.javascript.fortest.AegisService"
>                address="http://localhost:8808/aegis">
>                <simple:serviceBean>
>                        <bean
>                                class="
> org.apache.cxf.javascript.fortest.AegisServiceImpl" />
>                </simple:serviceBean>
>                <simple:dataBinding>
>                        <bean
>                                class="
> org.apache.cxf.aegis.databinding.AegisDatabinding">
>                        </bean>
>                </simple:dataBinding>
>                <simple:serviceFactory>
>                        <bean
>                                class='
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean'>
>                                <property name="properties">
>                                        <map>
>                                                <entry
> key="overrideTypesList">
>                                                        <list>
>                                                                <value>
> org.apache.cxf.javascript.fortest.aegis.Mammal</value>
>                                                        </list>
>                                                </entry>
>                                        </map>
>                                </property>
>                        </bean>
>                </simple:serviceFactory>
>        </simple:server>
>
>

Re: set Default minOccurs and nillable Parameters

Posted by Benson Margulies <bi...@gmail.com>.
On Tue, 2008-02-05 at 07:55 -0800, yulinxp wrote:
> This section explains how to set Default minOccurs and nillable Parameters
> using Java API.
> Is there anyway we could do it through xml file?
> 
> http://cwiki.apache.org/CXF20DOC/aegis-databinding.html
> 

Start from here, and add a Configuration bean to the AegisDatabinding.

<simple:server id="aegis-service"
		serviceClass="org.apache.cxf.javascript.fortest.AegisService"
		address="http://localhost:8808/aegis">
		<simple:serviceBean>
			<bean
				class="org.apache.cxf.javascript.fortest.AegisServiceImpl" />
		</simple:serviceBean>
		<simple:dataBinding>
			<bean
				class="org.apache.cxf.aegis.databinding.AegisDatabinding">
			</bean>
		</simple:dataBinding>
		<simple:serviceFactory>
			<bean
				class='org.apache.cxf.service.factory.ReflectionServiceFactoryBean'>
				<property name="properties">
					<map>
						<entry key="overrideTypesList">
							<list>
								<value>org.apache.cxf.javascript.fortest.aegis.Mammal</value>
							</list>
						</entry>
					</map>
				</property>
			</bean>
		</simple:serviceFactory>
	</simple:server>