XML Binding

Hello, I'm quite new to Flex and I have this problem.
I'd like to call an HTTPService that returns XML data in e4x
format and assign the result to an AS3 class (LoginVO).
But I get a message stating that I cannot assign the xml to
the class at the following lines:
LoginVO( event.result ) and LoginVO( event )
Is it possible to do this? Should the xml written in some
particular way? What else?
Thanks in advance.

I am unable to guess why you want the XML data to get
converted to e4x format and then to LoginVO Object.
HTTPService by default would convert XML data to Objects. But
they won't be of LoginVO type or anyother type. They would be palin
objects.
You can have a constructor / creator function in LoginVO
which accepts a Object and creates a new LoginVO object using the
properties/values in the object.
public function createLoginVO(obj:Object):LoginVO
var loginVO:LoginVO = new LoginVO();
for (var prop:String in obj)
loginVO[prop] = obj[prop];
return loginVO;
Above code assumes that LoginVO has same properties as the
XML data returned. You can add checks or hard coded values in the
function.
Call this function from the HTTPService handler.

Similar Messages

  • Jaxb with weblogic -- java.lang.NoClassDefFoundError: javax/xml/bind/MarshallableRootElement

    I am trying to use jaxb with Weblogic 6.1. I kept both the jaxb jar file in weblogic
    classpath in setEnv script. I am getting the following error, when I am trying
    to use jaxb
    java.lang.NoClassDefFoundError: javax/xml/bind/MarshallableRootElement
    I tried other options also like coping both jar file in jre/ext dir but then I
    got security error.
    I will appreciate if someone in this newsgroup comments or suugest some solution.
    Thanks
    Jeewan

    On 06 Aug 2002, Jeewan wrote:
    >
    I am trying to use jaxb with Weblogic 6.1. I kept both the jaxb jar
    file in weblogic classpath in setEnv script. I am getting the
    following error, when I am trying to use jaxb
    java.lang.NoClassDefFoundError: javax/xml/bind/MarshallableRootElement
    I tried other options also like coping both jar file in jre/ext dir
    but then I got security error.
    I will appreciate if someone in this newsgroup comments or suugest
    some solution. Put the jaxb jar file in in your webapp's WEB-INF/lib directory and it
    should work fine.
    Barry

  • XML binding(maping) "Castor" problem ...

    Hello Dear Sirs !
    I am using the the "Castor" project for XML Binding purposes .
    It was really good idea to create this stuff .
    I tried to use it in my programs and just surprised how your project really tailored to XML programmers needs .
    But a some time ago I have encountered with some Parsing problem ....
    May be my quastion is to stooped , but i still can not find an answer .
    I have to parse From Java Class to XML and Vice Versa next kind of XML :
    ************************ First Question *****************************************
    <Inputs>
    < Line LineNumber = '0'
    Selected 'yes'
    Attribute='Value of Attribute'
    IDFormat='Format to Apply'
    <Value Name ='Rate'>4.89</Value>
    <Value Name ='Subscribtion'>yes</Value>
    <Value Name ='EnrolmentDate'>12.12.2002</Value>
    <Value Name ='ProviderName'>Somebody</Value>
    </Line>
    < Line LineNumber = '1'
    Selected 'no'
    Attribute='Value of Attribute'
    IDFormat='Format to Apply'
    <Value Name ='Queue'>2Q</Value>
    <Value Name ='IVR'>yes</Value>
    <Value Name ='EnrolmentDate'>31.12.2002</Value>
    </Line>
    < Line LineNumber = '3'
    Selected 'yes'
    Attribute='Value of Attribute'
    IDFormat='Format to Apply'
    <Value Name ='CustomerName'>NA</Value>
    <Value Name ='Vacancy'>yes</Value>
    </Line>
    </Inputs>
    ************************ End of First Question ***************************
    *********************** Second Question ***************************
    <Inputs>
    Value< ItemAttribute = 'CurentItemAttribute' ItemProperty =' ItemProperty' >
    Value<ItemAttribute = 'CurentItemAttribute' >
    Value<ItemProperty =' ItemProperty' >
    Value< ItemAttribute = 'CurentItemAttribute' ItemProperty =' ItemProperty' >
    Value<ItemAttribute = 'CurentItemAttribute' >
    Value< ItemAttribute = 'CurentItemAttribute' ItemProperty =' ItemProperty' >
    Value< ItemAttribute = 'CurentItemAttribute' ItemProperty =' ItemProperty' >
    </Inputs>
    *********************** End of Second Question ***************************
    And I dont know How I can MAP these XML formats to Java Classes and vice versa .........
    (to my pitty It is not my idea to assemble it in this manner and this is not given to some improvement change .... )
    In your examples all things look so simple and understandable ... but I have no idea about my case .....
    Please , help me with this ....
    Are these kinds of XML can be really somehow binded and work together with "Castor" ?
    It it really possible to do these things ?
    I will really appreciate your attempt to help me .
    Thank you ,
    Marat

    To create class file for binding in castor, your first step is to create an XML Schema or .xsd file. Then assuming it is installed correctly type: java org.exolab.castor.builder.SourceGenerator -i whatever.xsd -package com.xyz.myxml.castor
    This would create the java class file in the package com.zyx.myxml.castor that corresponds to your XML schema

  • Java Mapping Using JAXB [Java Arch for XML Binding]

    Hi All,
    Anyone tried using JAXB  [Java Architecture for XML Binding API available with Java WebServices Pack] technique for XML processing in Java Mapping??
    I am facing the following problems..
    1. I am not able to generate namespace while marshalling target XML [In standalone mode and not tried in XI].
    2. What are the jar files we need to import?
       I tried importing the following jar files in XI.
    jaxb-api.jar,jaxb-impl.jar,jaxb-libs.jar,jax-qname.jar,namespace.jar,relaxngDatatype.jar
      and getting some errors while importing these files in XI.
    3. It throws error at runtime [Interface Mapping-Test Tab]
       like Resource not found:javax/xml/bind/Messages_en.properties,javax/xml/bind/Messages_en_US.properties
    4. Even after creating a copy of available file Messages.Properties with name: Messages_en.properties and Messages_en_US.properties.. it is not generating any messages in Target message tab
    Thanks in Advance,
    Ananth Chinnaraj

    Sravya ,
    I have searched wide and far for this, but no success.
    A lot on JAXB XI and Webdynpro, but nothing on JAXB, XI and mappings.
    Could you please post the url here ?
    Thanks and kind regards,
    Jan

  • Flash Components and XML Binding

    I just ran through the XML binding Bike Trails tutorial about
    a hundred times. I can get that to work just fine. But when I try
    to work with my XML file, it keeps falling apart. I just don't get
    it! I've been working on it for 2 days and it's still not working
    right.
    For one, the bindings are not showing up right. I have 2
    combo boxes and then a final one I'd like to use to list the
    stores. Here's a link to basically what I'm trying to do:
    http://www.thinkseed.com/test/stores.html
    My bindings keep falling apart. I get null values all the
    time for the second drop box that's supposed to house the States
    (the one on the site is a fluke...I accidentally had the
    <store> node on a separate line instead of nested in the
    <state> node. No idea why that one sort of worked.)
    Here's an example of the XML code:

    The flashComponents are standard AS2 components, and you can look up their APIs in the Flash documentation.  Here is the button docs:
    http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001977.html#3654189
    Looking at that, there is a getStyle() method, and I just tested it out:
    put sprite(1).getStyle("borderStyle")
    -- "inset"
    put sprite(1).getStyle("fontFamily")
    -- "_sans"
    put sprite(1).getStyle("color")
    -- 734012.0000
    I'm not real sure what that means (probably the hex color converted to a float), but you can change the color like this:
    sprite(1).setStyle("color","red")
    And here is a page that lists all the styles that are defined:
    http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001973.html#3136306

  • Jaxb is giving NullPointerException  at com.sun.xml.bind.v2.model.impl.Prop

    Hi,
    I am getting null pointer exception , i dont whether it is due to jar mismatch or what ???
    I have a stand alone application which created java classes from one schema file and , i construct xml file by
    inputting some values. It works fine in my machine. But when i deploy it our product which has tomcat6 it
    gives the following exception.
    ava.lang.NullPointerException
         at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.calcXmlName(PropertyInfoImpl.java:287)
         at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.calcXmlName(PropertyInfoImpl.java:260)
         at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl.getTypes(ElementPropertyInfoImpl.java:100)
         at com.sun.xml.bind.v2.model.impl.RuntimeElementPropertyInfoImpl.getTypes(RuntimeElementPropertyInfoImpl.java:50)
         at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.size(ElementPropertyInfoImpl.java:42)
         at java.util.AbstractList$Itr.hasNext(AbstractList.java:341)
         at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:139)
         at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49)
         at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41)
         at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
         at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:204)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl$1.run(JAXBContextImpl.java:343)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl$1.run(JAXBContextImpl.java:340)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:340)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:204)
         at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
         at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:55)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:589)
         at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
         at javax.xml.bind.ContextFinder.find(ContextFinder.java:381)
         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
         at com.facetime.rtgsm.extractor.GenerateXml.GenerateXmlForSkypeManagementOnly(Unknown Source)
         at com.facetime.rtgsm.extractor.JDBCToXML.getXmlStringForModalities(Unknown Source)
         at com.facetime.rtgsm.publisher.MessagePublisherClient.sendMessage(Unknown Source)
         at com.facetime.rtgsm.publisher.MessagePublisherJob.execute(Unknown Source)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
    Any help would be be grately appreciated :)

    Check whether jaxb-ri.jar is there in your class path

  • Toplink xml binding session.xml and servlet

    I made a project with toplink-jaxb mapping
    with simple pojo object it works fine.
    I made another project with servlet
    and the same session.xml and java classes
    but when my process start it throw an exception :
    jaxbexception : Provider oracle.toplink.ox.jaxb.JAXBContextFactory could not be instantiated:
    It is like the process could not read the session.xml files, but this file and two xml file for the mapping are in the classpath (in WEB-INF/classes).
    Have i to put these files in another place ?
    Thanks.

    Hi,
    thank you for your response but
    here is the code :
    javax.xml.bind.JAXBContext jaxbContext = javax.xml.bind.JAXBContext.newInstance(
    "fr.cnav.cramse.pgpe.contactsnationaux"),this.getClass().getClassLoader());
    but i still got the same exception :
    05/03/01 08:24:33 exceptionProvider oracle.toplink.ox.jaxb.JAXBContextFactory could not be instantiated: java.lang.NoSuchMethodError: oracle.toplink.publicinterface.Session oracle.toplink.tools.sessionmanagement.SessionManager.getSession(oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader, java.lang.String, java.lang.ClassLoader, boolean, boolean)
    I have also a stange message in the log window in jdev :
    Cutting log (size: 101767, max: 100000)Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Cutting log (size: 101866, max: 100000)Error cleaning up log: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISeekableStream.seek]
    Thank you for your help.

  • Problem with JAXB Unmarshall - javax.xml.bind.UnmarshalException

    Hi,
    I'm getting an expection while unmarshalling using JAXB. The error is as follows :
    DefaultValidationEventHandler: [ERROR]: unexpected element (uri:"http://www.etrade.com/ee/systemdomainao/search", local:"Context_Id"). Expected elements are <{}contextId>,<{}predicateInterceptor>,<{}isDefaultsearch>,<{}implicitContextSQL>,<{}contextName>,<{}searchId>,<{}implicitContextText>
    I've generated JAXB classes using xjc command from my schema. The root element is Search object which has a List of Searchcontext and Columlist object. When I'm trying to unmarshall the XML, I'm getting the above exception. What is baffling, if I comment out the <tns:SearchContext> entry from the XML, unmarshall doesn't throw any exception and populates the columnlist properly. Columnlist and Searchcontext have little difference except that columnlist contains more elements.
    Here'e the unmarshall code,
    URL metadataURL = this.getClass().getClassLoader().getResource("metadata/search/PARTICIPANT.xml");
    JAXBContext jc = JAXBContext.newInstance("com.etrade.ee.systemdomainao.search.domain");
    Unmarshaller unmarshaller = jc.createUnmarshaller();
    unmarshaller.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
    Search search = (Search)unmarshaller.unmarshal(metadataURL);
    Any pointers will be highly appreciated.
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    XSD :
    XSD :
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.etrade.com/ee/systemdomainao/search" targetNamespace="http://www.etrade.com/ee/systemdomainao/search" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <!-- Searchcontext type definition -->
         <xs:complexType name="Searchcontext">
              <xs:sequence>
                   <xs:element name="Context_Id" type="xs:int"/>
                   <xs:element name="Search_Id" type="xs:string"/>
                   <xs:element name="Context_Name" type="xs:string"/>
                   <xs:element name="Implicit_Context_SQL" nillable="true">
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:maxLength value="500"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="Implicit_Context_Text" nillable="true">
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:maxLength value="500"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="Is_Defaultsearch" type="xs:boolean" nillable="true"/>
                   <xs:element name="Predicate_Interceptor" type="xs:string" nillable="true"/>
              </xs:sequence>
         </xs:complexType>
         <!-- Searchlist type definition -->
         <xs:complexType name="Columnlist">
              <xs:sequence>
                   <xs:element name="Columnlist_Id" type="xs:int"/>
                   <xs:element name="Search_Id" type="xs:string"/>
                   <xs:element name="Is_Quicksearchable" type="xs:boolean" nillable="true"/>
                   <xs:element name="Is_Advancesearchable" type="xs:boolean" nillable="true"/>
                   <xs:element name="Is_Quicksearchview" type="xs:boolean" nillable="true"/>
                   <xs:element name="Is_Fullview" type="xs:boolean" nillable="true"/>
                   <xs:element name="Is_Sortable" type="xs:boolean" nillable="true"/>
                   <xs:element name="Is_Defaultsort" type="xs:boolean" nillable="true"/>
                   <xs:element name="Default_SortOrder" type="xs:string" nillable="true" minOccurs="0"/>
                   <xs:element name="Display_Order" type="xs:int" nillable="true"/>               
                   <xs:element name="Default_Value" type="xs:string" nillable="true" maxOccurs="6"/>
                   <xs:element name="Default_Operator" type="xs:string" nillable="true"/>
                   <xs:element name="Is_Closedset" type="xs:boolean"/>
                   <xs:element name="Closedset_List_Name" type="xs:string" nillable="true"/>
                   <xs:element name="Is_RelatedMenu" type="xs:boolean" minOccurs="0"/>
                   <xs:element name="Column_Name" type="xs:string"/>
                   <xs:element name="Display_Name" type="xs:string"/>
                   <xs:element name="Is_UDF" type="xs:boolean" nillable="true"/>
                   <xs:element name="Table_Name" type="xs:string"/>
                   <xs:element name="Data_Type" type="xs:string"/>
                   <xs:element name="Column_Size" type="xs:int"/>
              </xs:sequence>
         </xs:complexType>
         <!-- Search declaration -->
         <xs:element name="Search">
              <!--<choice>
         <xs:interface name="java.io.Serializable" />
         </choice>-->
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="Search_Id" type="xs:string"/>
                        <xs:element name="Schema_Set">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:maxLength value="20"/>
                                       <xs:minLength value="1"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                        <xs:element name="SearchContext" type="tns:Searchcontext" maxOccurs="unbounded"/>
                        <xs:element name="ColumnList" type="tns:Columnlist" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
              <xs:key name="Search_PrimaryKey_1">
                   <xs:selector xpath="."/>
                   <xs:field xpath="tns:Search_Id"/>
              </xs:key>
              <xs:keyref name="Searchcontext_ForeignKey_1" refer="tns:Search_PrimaryKey_1">
                   <xs:selector xpath=".//tns:SearchContext"/>
                   <xs:field xpath="tns:Search_Id"/>
              </xs:keyref>
              <xs:keyref name="Columnlist_ForeignKey_2" refer="tns:Search_PrimaryKey_1">
                   <xs:selector xpath=".//tns:ColumnList"/>
                   <xs:field xpath="tns:Search_Id"/>
              </xs:keyref>
              <xs:key name="Searchcontext_PrimaryKey_1">
                   <xs:selector xpath=".//tns:SearchContext"/>
                   <xs:field xpath="tns:Context_Id"/>
              </xs:key>
              <xs:key name="Columnlist_PrimaryKey_1">
                   <xs:selector xpath=".//tns:ColumnList"/>
                   <xs:field xpath="tns:Columnlist_Id"/>
              </xs:key>
         </xs:element>
    </xs:schema>

  • How do I marshall a list using javax.xml.bind.annotation?

    Hopefully this is so simple a cave man could do it.
    I had to remove the Duke Stars for the time being. I found another bug in the program that may have resulted in my array being empty.
    I'm trying to marshall a standalone document of my DeckImpl class. It is a deck of cards of course. It contains an array of CardImpl objects that need to be marshalled too. I could not figure out how to marhall the array so I have a marshall(Marshaller m) method that will
    initialize the List (see below) with an ArrayList. I figured the marshaller would do the rest but I just get the declaration and a closed <DECK />tag with the correct attributes (see way below) when I comment out the @XmlElementWrapper, or a DECK root node that simply contains a closed <CARDS /> tag with the line enabled. You can see tha CardImpl class is annotated too.
    I must be missing something obvious. Please help.
    @XmlRootElement(name = "DECK")
    @XmlType(name = "DECK")
    public class DeckImpl implements Comparable<DeckImpl> {
        @XmlAttribute
        public int id;
        @XmlAttribute
        public boolean isShuffled;
        @XmlAttribute
        public boolean isCut;
        public CardImpl[] cards;
        @XmlElementWrapper(name="CARDS")
        @XmlElements(@XmlElement(name="CARD",type=CardImpl.class))
        public List<CardImpl> CARDS;
        private static JAXBContext context;
        private static Marshaller marshaller;
    public DeckImpl(int id, boolean isCut, boolean isShuffled,
                CardImpl[] cards) {
            this.id = id;
            this.isShuffled = isShuffled;
            this.isCut = isCut;
            this.cards = cards;
            try {
                context = JAXBContext.newInstance(DeckImpl.class);
                marshaller = context.createMarshaller();
            } catch (JAXBException ex) {
                Logger.getLogger(CardImpl.class.getName()).log(Level.SEVERE, null, ex);
    //... class code goes here
    /** Generates XML representation of a deck
         * @param writer
         * @throws javax.xml.bind.JAXBException
        public void marshall(Writer writer) throws JAXBException {
            CARDS = new ArrayList<CardImpl>(cards.length);
            for (CardImpl i : cards) {
                CARDS.add(i);
            marshaller.marshal(this, writer);
    @XmlType(name = "CARD")
    public class CardImpl implements Comparable<CardImpl> {
        @XmlElement(name = "NAME")
        public String name;
        @XmlElement(name = "SUIT")
        public String suit;
        @XmlAttribute
        public int value;
        @XmlAttribute
        public int pointValue;
    //... class code
    }The output is:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><DECK isCut="false" isShuffled="true" id="1"/>Regards,
    Bill
    Edited by: bthayer on Jan 24, 2009 7:15 AM
    Edited by: bthayer on Jan 25, 2009 7:02 AM

    There's a bit in here on marshalling.
    http://java.sun.com/webservices/docs/1.4/tutorial/doc/index.html
    Problem with JAXB (and I could be wrong - try posting on the Web Services / XML forum) is that you can only marshal the generated classes. This may mean that you need to create the object, and populate it using the setter / getter methods.
    Castor is much more friendly for this as it can marshall objects using reflections. You may also want to look into XMLBeans (which I have no exp of)

  • Problem testing WebMethod. Throwing javax.xml.bind.JAXBException

    Hi guys,
    Another Newbie.
    Specifications:
    NetBeans5.5
    Sun App Server 9.0_01 (build b02-p01)
    MySQL
    Problem: Not able to test run the Webmethod with webparams.
    I have an entity class with some methods as shown below
    public class Country {
        private Integer countryID;
        private ServerDatabaseInteraction di;
        private String countryName;
        /** Creates a new instance of Country */
        public Country(ServerDatabaseInteraction di) {
            this.di = di;
         * Creates a new instance of Country with the specified values.
         * @param countryID the countryID of the Country
        public Country(Integer countryID) {
            this.countryID = countryID;
         * Creates a new instance of Country with the specified values.
         * @param countryID the countryID of the Country
         * @param countryName the countryName of the Country
        public Country(Integer countryID, String countryName, ServerDatabaseInteraction di) {
            this.di = di;
            this.countryID = countryID;
            this.countryName = countryName;
         * Gets the countryID of this Country.
         * @return the countryID
        public Integer getCountryID() {
            return this.countryID;
         * Sets the countryID of this Country to the specified value.
         * @param countryID the new countryID
        public void setCountryID(Integer countryID) {
            this.countryID = countryID;
         * Gets the countryName of this Country.
         * @return the countryName
        public String getCountryName() {
            return this.countryName;
         * Sets the countryName of this Country to the specified value.
         * @param countryName the new countryName
        public void setCountryName(String countryName) {
            this.countryName = countryName;
        public void insert() throws SQLException {
            di.update("INSERT INTO Country (CountryName) VALUES ('"+getCountryName()+"')");
        public ArrayList list() throws SQLException {
            ArrayList queryAL = new ArrayList();
            ResultSet rs = di.queryToResultSet("SELECT CountryID, CountryName FROM Country");
            while(rs.next()) {
                String temp = rs.getInt(1)+"#"+rs.getString(2);
                queryAL.add(temp);
             return queryAL;
    }    then I created a Web service having two methods as follows
    @WebService
    public class CountryWS {
        ServerDatabaseInteraction di;
        Country country;
        public CountryWS() {
            try {
                di = new ServerDatabaseInteraction();
            } catch (Exception ex) {
                ex.printStackTrace();
            country = new Country(di);
         * Web service operation
        @WebMethod
        public ArrayList listPKobjects() {
            try {
                return country.list();
            } catch (SQLException ex) {
                ex.printStackTrace();
                return null;
         * Web service operation
        @WebMethod
        public String insert(@WebParam(name = "CountryName") String CountryName) {
            // TODO implement operation
            country.setCountryName(CountryName);
            try {
                country.insert();
                return "Inserted";
            } catch (SQLException ex) {
                ex.printStackTrace();
                return "Insert Failed";
    }Now the problem is Im able to test (by right clicking on webservice from IDE) the webmethod listPKObjects but not the insert method. only difference is the second one is having webparms.
    the log shows as follows..
    CountryName is not a valid property on class myhost.fli.ws.jaxws.Insert
    javax.xml.bind.JAXBException: CountryName is not a valid property on class myhost.fli.ws.jaxws.Insert
         at com.sun.xml.ws.encoding.EncoderDecoderBase.getRawAccessor(EncoderDecoderBase.java:128)
         at com.sun.xml.ws.encoding.EncoderDecoderBase.getWrapperChildValue(EncoderDecoderBase.java:81)
         at com.sun.xml.ws.encoding.soap.EncoderDecoder.fillData(EncoderDecoder.java:78)
         at com.sun.xml.ws.encoding.soap.ServerEncoderDecoder.toMessageInfo(ServerEncoderDecoder.java:97)
         at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.toMessageInfo(SOAPMessageDispatcher.java:209)
         at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:573)
         at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:147)
         at com.sun.xml.ws.server.Tie.handle(Tie.java:90)
         at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:195)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    Caused by: javax.xml.bind.JAXBException: CountryName is not a valid property on class myhost.fli.ws.jaxws.Insert
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:816)
         at com.sun.xml.ws.encoding.EncoderDecoderBase.getRawAccessor(EncoderDecoderBase.java:124)
         ... 34 moreCan't find a reason, why one webmethod is working and the other one is not.
    Any help would be much appriciated.

    I'm encountering the same problem, but it's very inconsistent. I've got three web services that I'm deploying. If I clean, rebuild, and redeploy, then different combinations of the three throw this error.
    My specifications:
    NetBeans 6.0
    GlassFish v2
    Oracle 10g
    In browsing around online, I came across the following link which suggested to me that this issue is known and is being addressed.
    https://jax-ws.dev.java.net/issues/show_bug.cgi?id=419
    I discovered that the reason that I was getting this error was because my web services all had the same operation names. When I renamed my operations in each service so that they had different names, this fixed the problem.
    Hope this helps!
    - Erich Musick

  • Best XML binding framework or utility???

    Hi all,
    In my application I am storing all the data into XML file. And I have designed the resource layer entty. Now I want to know which mechanism of object to XML binding is better (like Castor, JAXB etc). So it will be great if some one can suggest me which mapper is better and why.
    Thanks in advance
    Mithun

    Castor and JiBX come out as a good all-round
    performers, while JAXB carries the clout of being one
    of the web service tools included in the Java EE 5
    specification.-1 JAXB. Especially if you use clear case. I don't know if they changed this but the version of I use JAXB produces lines of code that are longer than clear case will accept. This is really annoying as clear case doesn't tell you that, it just gives some vague error about not being able to check in the code.
    Also, I don't really consider JAXB a binding framwork. It;s a code generator. And what it generates basically requires lots of hardcoding in order to use it. It's not a flexible solution. You can probably get away with it for small numbers of simple schemas but if you have lots lf different scehmas to deal with I would avoid it like the plague.

  • How do I install javax.xml.bind...

    Hi,
    I'm kind of a beginner in the java world and I have some serious problems when I'm trying to use JAXB.
    I have downloaded JDK 1.5.0_6, Java WebServices Dev Kit 2.0 and when I try to run a simple example I receive these compiler errors:
    package javax.xml.bind does not exist
    package javax.xml.marshall does not exist......etc.
    What do I do wrong. I've tried for 2 days to get this @#$ example to work, can someone help me out please.
    Thanks

    javax.xml.bind couldn't have been around in 2002, so i'm not sure what is wrong w/ that tutorial.
    What I want to do is to create XML data and read and
    write it from a file. What is the best way to do
    this??You don't need JAXB or binding for this, although it probably can be used for this as well. What you probably need is JAXP, such as SAX or DOM APIs.
    I've read about about JAXP in the past in J2EE 1.4 Tutorial:
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/J2EETutorial.pdf.
    You may want to read up on SAX and DOM there or in another one. I forgot a lot of the stuff, but this should get you started on SAX:
    public static void main(String argv[])
    if (argv.length != 1) {
    System.err.println("Usage: cmd filename");
    System.exit(1);
    // Use an instance of ourselves as the SAX event handler
    DefaultHandler handler = new Echo();
    // Use the default (non-validating) parser
    SAXParserFactory factory = SAXParserFactory.newInstance();
    try {
    // Set up output stream
    out = new OutputStreamWriter(System.out, "UTF8");
    // Parse the input
    SAXParser saxParser = factory.newSAXParser();
    saxParser.parse( new File(argv[0]), handler );
    } catch (Throwable t) {
    t.printStackTrace();
    System.exit(0);
    }

  • BPEL Prcess invocation error: javax.xml.bind.JAXBContext.newInstance

    Im using jaxb (tried both Jaxb1.0/2.0) classes for XML processing in my bpel Process developed using 10.1.3.5.0, and my bpel process compiled and deployed successfully to OAS. The error message I'm receiving now is Whn i try to invoke my by process.
    Could anyone please let me know how to resolve this version compatability issue at OAS. I have an immediate requirement.
    Error:
    java.lang.NoSuchMethodError: javax.xml.bind.JAXBContext.newInstance([Ljava/lang/Class;)Ljavax/xml/bind/JAXBContext;
         at cosmos.ext118.utils.JaxbUtils.readXMLString(JaxbUtils.java:36)
         at cosmos.ext118.utils.JaxbUtils.processLotDetails(JaxbUtils.java:58)
         at bpel.damagedkitsintegration.ExecLetBxExe0.execute(ExecLetBxExe0.java:81)
         at com.collaxa.cube.engine.ext.wmp.BPELXExecWMP.__executeStatements(BPELXExecWMP.java:50)
         at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:200)
         at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:4174)
         at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1680)
         at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:238)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:335)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:6285)
         at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1111)
         at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.__createAndInvoke(CubeEngineBean.java:128)
         at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.createAndInvoke(CubeEngineBean.java:171)
         at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.syncCreateAndInvoke(CubeEngineBean.java:191)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl

    Can any one looked at this issue and please let me know if you the solution?

  • Where to find javax.xml.bind and javax.jdo

    One of my application require import javax.xml.bind and javax.jdo packages. I could not find them. Someone can help to let me know where to download them or they come with some other toll\packages?
    Thanks
    John

    Hi John ,
    I have the same problem: Getting the javax.jdo Packge . . . .(WHERE ?)
    if you found out ow already, please tell me at: [email protected]
    thanks,
    edan

  • Object-XML Binding: How do I map from java to enumerated xml tags

    Hi. I'm new to Object-XML binding and toplink. XML that I'm trying to model in a schema has enumerated elements, e.g. </module_0></module_1><module_n> instead of many </module> elements. To simplify the schema I've opted to use </module> anyway with unbounded cardinality and imported this into a new project.
    What I would like to know is if I can use Toplink to map the java object back to the enumerate element types and vice versa?
    Thanks for your help.
    GeePee

    Hi Geepee,
    Below is an approach you can use if you have a fixed number of moduleX elements. In the example below X=3.
    Assume a 2 object model Root & Module, where Root has a list of Module instances:
    @XmlRootElement(name="root")
    public class Root {
        private List<Module> module = new ArrayList<Module>(3);
        ...// Accessors omitted
    }It is currently not possible to map the items in the module list to the XML elements (module1-module3), but it would be possbile to map an object (see below) with 3 properties to those XML elements:
    public class AdaptedModuleList {
        private Module module1;
        private Module module2;
        private Module module3;
        ...// Accessors omitted
    }What is required is a means to convert the unmappable object to a mappable one. This is done using a Converter:
    import org.eclipse.persistence.mappings.DatabaseMapping;
    import org.eclipse.persistence.mappings.converters.Converter;
    import org.eclipse.persistence.sessions.Session;
    public class ModuleListConverter implements Converter {
        public void initialize(DatabaseMapping mapping, Session session) {}
        public Object convertDataValueToObjectValue(Object dataValue, Session session) {
            AdaptedModuleList adaptedModuleList = (AdaptedModuleList) dataValue;
            if(null == adaptedModuleList) {
                return null;
            List<Module> moduleList = new ArrayList<Module>(3);
            moduleList.add(adaptedModuleList.getModule1());
            moduleList.add(adaptedModuleList.getModule2());
            moduleList.add(adaptedModuleList.getModule3());
            return moduleList;
        public Object convertObjectValueToDataValue(Object objectValue, Session session) {
            List<Module> moduleList = (List<Module>) objectValue;
            if(null == moduleList) {
                return null;
            AdaptedModuleList adaptedModuleList = new AdaptedModuleList();
            int moduleListSize = moduleList.size();
            if(moduleListSize > 0) {
                adaptedModuleList.setModule1(moduleList.get(0));
            if(moduleListSize > 1) {
                adaptedModuleList.setModule2(moduleList.get(1));
            if(moduleListSize > 2) {
                adaptedModuleList.setModule3(moduleList.get(2));
            return adaptedModuleList;
        public boolean isMutable() {
            return true;
    }The converter is added to the mapping metadata through the use of a Customizer:
    import org.eclipse.persistence.config.DescriptorCustomizer;
    import org.eclipse.persistence.descriptors.ClassDescriptor;
    import org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping;
    import org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping;
    public class RootCustomizer implements DescriptorCustomizer {
        public void customize(ClassDescriptor descriptor) throws Exception {
            XMLCompositeCollectionMapping originalModuleMapping = (XMLCompositeCollectionMapping) descriptor.removeMappingForAttributeName("module");
            XMLCompositeObjectMapping newModuleMapping = new XMLCompositeObjectMapping();
            newModuleMapping.setAttributeName(originalModuleMapping.getAttributeName());
            newModuleMapping.setXPath(".");
            newModuleMapping.setReferenceClass(AdaptedModuleList.class);
            newModuleMapping.setConverter(new ModuleListConverter());
            descriptor.addMapping(newModuleMapping);
    }Part 1/2

  • Unable to resolve "javax.xml.bind.InvalidAttributeException"

    Hi all,
    Iam facing a problem with my jaxb
    the compiler is able to identify " javax.xml.bind.Marshaller" but it is not able to identify "javax.xml.bind.MissingContentException ","avax.xml.bind.PredicatedLists ","javax.xml.bind.InvalidContentObjectException ","javax.xml.bind.LocalValidationException "
    Im using "jwsdp-1.5" and have set the classpath , could i please be known as to why im facing this problem. when i unjar and check the jaxb file i can find the "Marshaller" class file but i could not see the remaining which i mentioned above.
    can anyone tell me as to which version of jaxb should i use?
    this is very very urgent, any help in this matter is highly appreciated.
    Thanks in advance.

    Hi John ,
    I have the same problem: Getting the javax.jdo Packge . . . .(WHERE ?)
    if you found out ow already, please tell me at: [email protected]
    thanks,
    edan

Maybe you are looking for

  • HT1459 My I pod is not responding  how do I know when the ipod had actually died?????

    my ipod has the green lights however when i try to listen to music ....nothing ....i tried several head sets. how do i know when the ipod is finally dead

  • Section code in customer line item for scrap

    Hi I created customer. I assigned business place to manufacturing plant and then section code to business place. Now i created scrap order and did PGI and invoice. Now i i saw accounting entry and double clicked on customer line item. There i saw bus

  • Background fill scale to fit scroll motion issue. Please help...

    I am having an issue with the background fill. I am using an image at least 2500px wide. It seems that when I have scrolling checked, the image scales to fit the browser normally when I preview the page. However, if I turn scrolling off, when preview

  • One view to anothere view

    hi i have two view . in one view i have registration no . and another view i want get data . but now i am not getting data .  what can i do

  • Unprotect a variant

    Hi Gurs, In mB51 we have few variants that are protected by a user. But  the user no longer works with the organization. How can we unprotect the variant Thanks Anusha