Hello,

I do not believe your name mapping is correct. As per JiBX
documentation [1]; the /@name attribute should be the local
(unqualified) name of the element or attribute. If you need to add a
namespace, you need to use the /@ns attribute. You cannot use prefixes
in your mapping outside the namespace element.

So, instead of:
<mapping name="ns3:GetLoyaltyOnlineStatusRequest"
class="org.pcats.schema.naxml.loyalty.v01.LoyaltyOnlineStatusRequest"
flexible="true" ordered="false">

use:
<mapping name="GetLoyaltyOnlineStatusRequest"
ns="http://www.pcats.org/schema/naxml/loyalty/v01";
class="org.pcats.schema.naxml.loyalty.v01.LoyaltyOnlineStatusRequest"
flexible="true" ordered="false">


>From the namespace element documentation [2], the /@prefix attribute
is used for marshalling only.


Bindul Bhowmik

[1] http://jibx.sourceforge.net/binding/binding-attributes.html#name
[2] http://jibx.sourceforge.net/binding/namespace-element.html


On Tue, Nov 24, 2015 at 12:17 PM, PS Govind <psgov...@hotmail.com> wrote:
> Hi,
>
> I am getting "org.jibx.runtime.JiBXException: No unmarshaller for element"
> error when trying unmarshel the xml file given below. The input xml file,
> binding definition, Java source and unmarshelling code are given below. Any
> help will be truly appreciated...
>
> org.jibx.runtime.JiBXException: No unmarshaller for element
> "{http://www.pcats.org/schema/naxml/loyalty/v01}GetLoyaltyOnlineStatusRequest";
> (line 5, col 60)
>         at
> org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2754)
>         at
> org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2900)
>         at com.weis.fuel.verifone.util.JiBXTest.main(JiBXTest.java:43)
>
> --
> -- XML
> --
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <ns3:GetLoyaltyOnlineStatusRequest
>       xmlns:ns2="http://www.naxml.org/POSBO/Vocabulary/2003-10-16";
>       xmlns:ns4="http://www.pcats.org/schema/core/v01";
>       xmlns:ns3="http://www.pcats.org/schema/naxml/loyalty/v01";>
> <ns3:RequestHeader>
>       <ns3:POSLoyaltyInterfaceVersion>1.0</ns3:POSLoyaltyInterfaceVersion>
>       <ns2:VendorName>VIPER</ns2:VendorName>
>       <ns2:VendorModelVersion>5.07.00</ns2:VendorModelVersion>
>      <ns3:POSSequenceID>XXX</ns3:POSSequenceID>
>      <ns3:LoyaltySequenceID/>
>      <ns3:StoreLocationID>XXXXXXXXXXX</ns3:StoreLocationID>
>      <ns3:LoyaltyOfflineFlag value="no"/>
> </ns3:RequestHeader>
> </ns3:GetLoyaltyOnlineStatusRequest>
>
> --
> -- Binding
> --
> <binding name="LoyaltyStatusRequest" direction="input">
> <mapping name="ns3:GetLoyaltyOnlineStatusRequest"
> class="org.pcats.schema.naxml.loyalty.v01.LoyaltyOnlineStatusRequest"
> flexible="true" ordered="false">
> <namespace uri="http://www.naxml.org/POSBO/Vocabulary/2003-10-16";
> prefix="ns2"/>
> <namespace uri="http://www.pcats.org/schema/naxml/loyalty/v01";
> prefix="ns3"/>
> <namespace uri="http://www.pcats.org/schema/core/v01"; prefix="ns4"/>
>
>    <structure name="ns3:RequestHeader" flexible="true" ordered="false">
> <value name="ns3:POSLoyaltyInterfaceVersion"
> field="pOSLoyaltyInterfaceVersion" usage="optional"/>
> <value name="ns2:VendorName" field="vendorName" usage="optional" />
> <value name="ns2:VendorModelVersion" field="vendorModelVersion"
> usage="optional" />
> <value name="ns3:POSSequenceID" field="pOSSequenceID" usage="optional" />
>     </structure>
> </mapping>
> </binding>
>
> --
> -- Unmarshalling code
> --
>            bfact = BindingDirectory.getFactory("LoyaltyStatusRequest",
> LoyaltyOnlineStatusRequest.class);
>            //bfact =
> BindingDirectory.getFactory(LoyaltyOnlineStatusRequest.class);
>            uctx = bfact.createUnmarshallingContext();
>            in = new FileInputStream(inFile);
>            LoyaltyOnlineStatusRequest request =
> (LoyaltyOnlineStatusRequest)uctx.unmarshalDocument(in, null);
>
>
> package org.pcats.schema.naxml.loyalty.v01;
> public class GetLoyaltyOnlineStatusRequest implements java.io.Serializable
> {
> private static final long serialVersionUID = 1L;
> private String pOSLoyaltyInterfaceVersion;
>     private String vendorName;
>     private String vendorModelVersion;
>     private String pOSSequenceID;
>
>     public GetLoyaltyOnlineStatusRequest()
>     {
>          super();
>     }
>
>     public String getPOSLoyaltyInterfaceVersion() { return
> pOSLoyaltyInterfaceVersion;}
>     public void setPOSLoyaltyInterfaceVersion(  String
> pOSLoyaltyInterfaceVersion) {this.pOSLoyaltyInterfaceVersion =
> pOSLoyaltyInterfaceVersion;}
>
>     public String getVendorName() {return vendorName;}
>     public void setVendorName(String vendorName) {this.vendorName =
> vendorName;}
>
>     public String getVendorModelVersion() {return vendorModelVersion;}
>     public void setVendorModelVersion(String vendorModelVersion)
> {this.vendorModelVersion = vendorModelVersion;}
>
>     public String getPOSSequenceID() {return pOSSequenceID;}
>     public void setPOSSequenceID(String pOSSequenceID) {this.pOSSequenceID =
> pOSSequenceID;}
> }
>
>
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple
> OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to