Hi Willie, As long as the <namespace> element includes the default="elements" attribute it will apply to all the elements in scope, including the name on the containing <mapping>. If you take off the default="elements" attribute and keep the ns="http://schema.bla.bla.com/Common" attribute on the inner elements it should do what you want.
But what I'd consider the preferred approach would be to use one binding definition for the wrapper elements (including the Response element) and a second binding definition for the inner content. The first binding definition would use the http://schema.paycare.jpmc.com/getChildrenVouchersResponse namespace for elements: <binding ...> <namespace uri="http://schema.bla.bla.com/getChildrenVouchersResponse" prefix="ns1" default="elements" /> <mapping name="GetChildrenVouchersResponse" class="com.bla.bla.schema.getchildrenvouchersresponse.GetChildrenVouchersResponse"> ... </mapping> <mapping name="Response" class="com.bla.bla.schema.common.Response"> <structure map-as="response-content"/> </mapping> Note that I've moved the <namespace> outside the <mapping> definitions here - you could leave it inside, but this way you only need it once for however many wrappers you're binding. The second binding definition would consist of abstract mappings, and would use the http://schema.paycare.jpmc.com/Common namespace for elements: <binding ...> <namespace uri="http://schema.paycare.jpmc.com/Common" prefix="com" default="elements"/> <mapping type-name="response-content" class="com.bla.bla.schema.common.Response" abstract="true"> <value name="TxnRetCode" field="txnRetCode" usage="required" /> <value name="TxnSubRetCode" field="txnSubRetCode" usage="required" /> <value name="TxnErrorText" field="txnErrorText" usage="required" /> <value name="TxnSystemTime" field="txnSystemTime" usage="required" /> </mapping> Then you use a root binding definition which includes both these bindings: <binding ...> <include path="wrapper-binding.xml"/> <include path="content-binding.xml"/> </binding> Doing things this way allows you to avoid dealing with namespaces on each individual elements, keeping the bindings simpler and easier to understand. - Dennis Dennis M. Sosnoski SOA and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Slepecki, Willie wrote: > > ok, tried that too and got the exact same output. its putting the > response element in the common namespace. > > -----Original Message----- > From: [EMAIL PROTECTED] on behalf of Serkan > Camurcuoglu > Sent: Thu 7/17/2008 9:57 AM > To: JiBX users > Subject: Re: [jibx-users] namespace problem thats killin me > > it says that you should put the namespace uri into the ns attribute, not > the prefix.. > > > Slepecki, Willie wrote: > > > > when i put it in as this: > > > > <mapping name="Response" > > class="com.bla.bla.schema.common.Response" > > > <namespace uri="http://schema.bla.bla.com/Common" > > default="elements" prefix="com" /> > > > > <value name="TxnRetCode" ns="com" field="txnRetCode" > > usage="required" /> > > <value name="TxnSubRetCode" ns="com" > > field="txnSubRetCode" usage="required" /> > > <value name="TxnErrorText" ns="com" > > field="txnErrorText" usage="required" /> > > <value name="TxnSystemTime" ns="com" > > field="txnSystemTime" usage="required" /> > > </mapping> > > > > i get an unusable namespace exception. so i tried putting it in the > > vouchersResponse as this: > > > > <structure field="response" usage="required" ns="ns1" /> > > > > and it still generates xml that looks like this > > > > <ns1:GetChildrenVouchersResponse > > > xmlns:ns1="http://schema.bla.bla.com/getChildrenVouchersResponse" > > xmlns:com="http://schema.bla.bla.com/Common" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > <com:Response> > > <com:TxnRetCode>0</com:TxnRetCode> > > <com:TxnSubRetCode>0</com:TxnSubRetCode> > > <com:TxnErrorText>No Error</com:TxnErrorText> > > > > <com:TxnSystemTime>2008-07-17T13:41:17.359Z</com:TxnSystemTime> > > </com:Response> > > > > > > keep in mind that the response type is used in about 30 different > > schemas, thats why its in its own com namespace because each of those > > 30 or so schemas all have a different target namespace and im trying > > to get all of them to bind together. > > > > > > > > -----Original Message----- > > From: [EMAIL PROTECTED] on behalf of Serkan > > Camurcuoglu > > Sent: Thu 7/17/2008 9:17 AM > > To: JiBX users > > Subject: Re: [jibx-users] namespace problem thats killin me > > > > I think you should add the attribute ns to your value definitions (for > > example TxnRetCode or TxnSubRetCode). See the description for ns at > > http://jibx.sourceforge.net/details/binding-attributes.html#name > > > > > > > > Slepecki, Willie wrote: > > > > > > here is the binder section: > > > > > > <mapping name="GetChildrenVouchersResponse" > > > > > > class="com.bla.bla.schema.getchildrenvouchersresponse.GetChildrenVouchersResponse"> > > > <namespace > > > uri="http://schema.bla.bla.com/getChildrenVouchersResponse" > > > prefix="ns1" default="elements" /> > > > <namespace uri="http://schema.paycare.jpmc.com/Common" prefix="com" /> > > > <namespace uri="http://www.w3.org/2001/XMLSchema-instance" > > prefix="xsi" /> > > > <namespace uri="http://www.w3.org/2001/XMLSchema" prefix="xsd" /> > > > > > > <structure field="response" usage="required" /> > > > bla bla bla > > > </mapping> > > > > > > <mapping name="Response" class="com.bla.bla.schema.common.Response"> > > > <namespace uri="http://schema.bla.bla.com/Common" > > > default="elements" /> > > > > > > <value name="TxnRetCode" field="txnRetCode" > usage="required" /> > > > <value name="TxnSubRetCode" field="txnSubRetCode" > > > usage="required" /> > > > <value name="TxnErrorText" field="txnErrorText" > > > usage="required" /> > > > <value name="TxnSystemTime" field="txnSystemTime" > > > usage="required" /> > > > </mapping> > > > > > > that generates an xml that looks like this: > > > > > > <ns1:GetChildrenVouchersResponse > > > > > > xmlns:ns1="http://schema.paycare.jpmc.com/getChildrenVouchersResponse" > > > xmlns:com="http://schema.paycare.jpmc.com/Common" > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > > <com:Response> > > > <com:TxnRetCode>0</com:TxnRetCode> > > > <com:TxnSubRetCode>0</com:TxnSubRetCode> > > > <com:TxnErrorText>No Error</com:TxnErrorText> > > > > > > <com:TxnSystemTime>2008-07-16T17:32:34.531Z</com:TxnSystemTime> > > > </com:Response> > > > > > > but the jaxp schema validator is requiring that it look like this: > > > > > > <ns1:GetChildrenVouchersResponse > > > > > > xmlns:ns1="http://schema.paycare.jpmc.com/getChildrenVouchersResponse" > > > xmlns:com="http://schema.paycare.jpmc.com/Common" > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > > <ns1:Response> > > > <com:TxnRetCode>0</com:TxnRetCode> > > > <com:TxnSubRetCode>0</com:TxnSubRetCode> > > > <com:TxnErrorText>No Error</com:TxnErrorText> > > > > > > <com:TxnSystemTime>2008-07-16T17:32:34.531Z</com:TxnSystemTime> > > > </ns1:Response> > > > > > > the difference is the namespace of the response tag. how in the world > > > do i modify my binder to generate that? > > > > > > the piece of the schema looks like this > > > <xs:element name="GetChildrenVouchersResponse"> > > > <xs:annotation> > > > <xs:documentation>The reponse schema for the > > > GetChildrenVouchers transaction</xs:documentation> > > > </xs:annotation> > > > <xs:complexType> > > > <xs:all> > > > <xs:element name="Response" > > > type="com:ResponseType"/> > > > > > > > > > and the ResponseType is defined in another namespace, Common. > > > > > > HELP!!!! > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.Net email is sponsored by the Moblin Your Move Developer's > > challenge > > > Build the coolest Linux based applications with Moblin SDK & win > > great prizes > > > Grand prize is a trip for two to an Open Source event anywhere in > > the world > > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > <http://moblin-contest.org/redirect.php?banner_id=100&url=/> > > <http://moblin-contest.org/redirect.php?banner_id=100&url=/ > <http://moblin-contest.org/redirect.php?banner_id=100&url=/>> > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > jibx-users mailing list > > > [email protected] > > > https://lists.sourceforge.net/lists/listinfo/jibx-users > > > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > > challenge > > Build the coolest Linux based applications with Moblin SDK & win great > > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the > > world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > <http://moblin-contest.org/redirect.php?banner_id=100&url=/> > > <http://moblin-contest.org/redirect.php?banner_id=100&url=/ > <http://moblin-contest.org/redirect.php?banner_id=100&url=/>> > > _______________________________________________ > > jibx-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/jibx-users > > > > > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > > Build the coolest Linux based applications with Moblin SDK & win > great prizes > > Grand prize is a trip for two to an Open Source event anywhere in > the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > <http://moblin-contest.org/redirect.php?banner_id=100&url=/> > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > jibx-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/jibx-users > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > <http://moblin-contest.org/redirect.php?banner_id=100&url=/> > _______________________________________________ > jibx-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jibx-users > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > jibx-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jibx-users > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ jibx-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jibx-users
