Castor XSD Code Generation ANT task: mapping  XML file?

Hello,
I am new to Castor and am using the Castor Code Generator ANT task to generate code from a XSD schema file.
I am using a binding XML file as well. One thing that I have a question about is the needed XML mapping file. I set the ‘*generateMapping*’ attribute to ‘true’ but have not found a mapping XML document.
Is there something I am doing wrong?
I would have attached the XSD files(some are imported), binding XML file and the ANT build.xml file in a .zip file to this post, but this forum does not have a facility for file attachments, but I can email them upon request.
Thanks in advance,
Andrew

Hi Andrew,
JAXB is the Java standard (JSR-222) for generating Java classes from an XML schema. Several implementations of this standard are available:
- Metro JAXB: The JAXB reference implementation, available in Java SE 6 and as part of GlassFish
- EclipseLink JAXB (MOXy): Part of EclipseLink, also available in Oracle TopLink
- JaxMe: Available from Apache
- Etc...
Castor is a proprietary XML binding tool. For Castor related questions you should visit the Castor website.
-Blaise

Similar Messages

  • All I want for my birthday is my jaxrpc-mapping.xml file.........;-)

    I am using JWSDP 2.0 with JDK 1.5. I have developed an ant script for building my web service files. When the script runs, the command line arguments are passed to the wscompile:
    wscompile -d C:\WorkSpaceForMyEclipse\WebService\WebContent\WEB-INF\classes "-features:rpcliteral, wsi" -g -import -keep -nd C:\WorkSpaceForMyEclipse\WebService\descriptors -s C:\WorkSpaceForMyEclipse\WebService\JavaSource -verbose -Xprintstacktrace -Xserializable C:\WorkSpaceForMyEclipse\WebService\WebContent\WEB-INF\wsdl\webservice-config.xml -classpath  <all the jar files from jwsdp project> <project jars>This all works well and good.
    My problem is I am not seeing a jaxrpc-mapping.xml file being created.
    When I add the mapping=${path}/jaxrpc-mapping.xml to the ant task, the builds break saying -mapping is not an option for wscompile....
    Am I doing something wrong? Can some guide me in the right direction for creating the mapping file? When I try axis, the mapping file is created, but it is not populated with any mappings. All I want for Christ is my jaxrpc-mapping.xml file. :-)
    Thanks in advance for reading my post. Any suggestions would be greatly appreciated.
    Russ

    If you are using rpc/literal and jdk 1.5, you would be better off using JAX-WS which does not require a mapping file. JAX-WS is the next generation Web services API that replaces JAX-RPC. Check out http://jax-ws.dev.java.net.

  • Newbie Question: Gererating a mapping xml file

    How is castor used, if even, to generate the mapping xml files from the classes generated by castor from an xsd? I have a(n) xsd that has many complex types and this called for the generation of many castor classes from that xsd...so, using these class files...how do I generate a single mapping xml file?
    Here is the means by wich we use these two (the xsd and mapping file) in one of our methods?
    xmlWriter.write(req, res, someDetail, "someDetail.castor.xml",
    "someDetail.xsd");
    Prior to this, the xsd files were simple and I created the mapping file by hand. I don't know how this translates when there are so many classes that were generated by caster.
    Can someone point me in the direction of more information on how to create this mapping file from all of these classes?
    Any advice would be appreciated.
    -abe

    Can do... I have been working on a readme.install to this end.  One question about the pre_upgrade script.  /usr/share/pacman/proto.install states:
    ## arg 1:  the new package version
    ## arg 2:  the old package version
    #post_upgrade() {
      # do something here
    I'm confused by the arg 1 and arg 2.  Is it simply the version number with nothing else.
    EDIT: ok.. I get it,  Assign a variable to them to capture and check.
    # $1: The new package version
    # $2: The old package version
    post_upgrade() {
    NEW=`echo $1`
    OLD=`echo $2`
    if [ "$OLD" = "1.0.1" ]; then
    do something
    fi
    Last edited by graysky (2010-02-11 22:01:03)

  • How to map XML File input to VO (eventually to update table) upon fileupld

    Reqirement: I am downloading an XML File (basically name-value pair) from user using OAMessageFileUploadBean. I need to take this file and update to an existing record in the table (cs_incidents_all). XML File schema is well-known in advance.
    Approach: Don't know what is the best, but I'm thinking if there is an OAF way to map the XML File (Blobdomain) to VO and get the rowIMPL.getColumn1Value to fetch all the datavalues then loop thru all the columns (xml-tags) and finally call plsql APIs which will update/insert into table (cs_incidents_all)
    Is this possible in OAF? If so please shed some light as to how to map XML File to VO.
    If this is not possible then please let me know the other way. I have to do this inside the oaf.
    Thank you,

    Can someone please let me know if this is possible in OAF?

  • Hibernate mapping XML files for the two SQL Server tables below.

    Hello all..,
    Question 1:
    I am working on a project that needs to support a database with an inherited legacy schema that you cannot change. The schema is provided below.Hibernate mapping XML files for the two SQL Server tables below. Please provide those two XML files. Assume some hypothetical package and class names. Assume that no "fancy" stuff such as lazy initialization, optimistic locking etc is needed at this time.
    CREATE TABLE [SURVEY_ANSWERS] (
    [ANSWER_ID] [int] IDENTITY (1,1) NOT NULL,
    [QUESTION_ID] [int] NOT NULL,
    [POSITION] [int] NULL,
    [TEXT] [varchar](350) NULL
    CREATE TABLE [dbo].[SURVEY_QUESTIONS] (
          [QUESTION_ID] [int] IDENTITY (1, 1) NOT NULL ,
          [TEXT] [varchar] (350) NULL
    GO
    ALTER TABLE SURVEY_ANSWERS
    ADD CONSTRAINT pk_SURVEY_ANSWERS PRIMARY KEY(ANSWER_ID,QUESTION_ID);
    ALTER TABLE [dbo].[SURVEY_QUESTIONS] ADD
           PRIMARY KEY  CLUSTERED
                [QUESTION_ID]
    GO
    ALTER TABLE [dbo].[SURVEY_ANSWERS] ADD
           FOREIGN KEY
                [QUESTION_ID]
          ) REFERENCES [dbo].[SURVEY_QUESTIONS] (
                [QUESTION_ID]
          )Question 2:
    Assume that you are working on a project developing, say, a banking application. You are the Architect and thinking that Hibernate ORM should be used for the entire access to the relational database. As usual, you have created (or auto-generated) a set of HBM XML files as well as POJOs for which you define the mappings. Assume now that a new requirement has just popped up. The system needs to be able to import new bank accounts and user information in bulk from a very large XML file at once and store it in the database. Assume the XML file contains all necessary information to populate fields in database tables. As performance is very important for this operation. Given this description, how would you approach the problem?
    Please describe briefly.
    -Thanks and regards
    Praveen Soni

    You're not fooling anyone Dennis_Mox. But nice try.Jeez, man. Mail me at denismox[at]yandex.ru, I will show you that exact test, dammit.

  • WSDL Generation Ant Task

    Hi
    I can see the ANT tasks to generate WAR/EAR for a given EJB/POJO service implementation
    - but I dont see any options to output a WSDL file. Is there one?
    I realise that I can obtain the WSDL from a deployed service via ?WSDL, but I
    really need to generate the WSDL file as part of the build.
    Cheers,
    -Nick

    Hi Nick,
    There will be a wsdlgen ant task in coming release. It should solve your
    problem. For now you can run clientgen on the ear, there is a wsdl saved in
    the generated client jar.
    -Neal
    "Nick Minutello" <[email protected]> wrote
    in message news:[email protected]..
    >
    Hi
    I can see the ANT tasks to generate WAR/EAR for a given EJB/POJO serviceimplementation
    - but I dont see any options to output a WSDL file. Is there one?
    I realise that I can obtain the WSDL from a deployed service via ?WSDL,but I
    really need to generate the WSDL file as part of the build.
    Cheers,
    -Nick

  • How to map XML file to various of object in the RFC

    hello
    I recieve XML file (not devided to elements, but XML file)'
    and I would like to map it to a RFC that has various object.
    I there a way to do it?
    if it involve a java code, does any one has a written code example?
    THX
    Kfir

    thanks for the reply
    my source XML response will be looking something like this (it will be reponsed in a long string):
    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <SOAP-ENV:Header>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <status>
    <retCode>00</retCode>
    <retCodeDesc>OK</retCodeDesc>
    <rRobjectId>09002347802d2981</rRobjectId>
    <rFileSize>7</rFileSize>
    <rTotalPages>1</rTotalPages>
    </status>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    my RFC is:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:rfc:functions">
    <xsd:element name="ZRFC_SET_DOCUMENT.Response">
    <xsd:complexType>
    <xsd:all>
    <xsd:element name="RETCODE" type="xsd:string" minOccurs="0" />
    <xsd:element name="RETCODEDESC" type="xsd:string" minOccurs="0" />
    <xsd:element name="RFILESIZE" type="xsd:string" minOccurs="0" />
    <xsd:element name="RROJECTID" type="xsd:string" minOccurs="0" />
    <xsd:element name="RTOTALPAGES" type="xsd:string" minOccurs="0" />
    </xsd:all>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

  • Inheritance of mapping xml files?

    How can one use inheritance (or other technique) to generate mapping files to be bundled with common components that are shared among several departments/projects. The original map (XML) would be distributed in a jar file with the classes. The idea is that the other people might want to extend components but don't want to have to map all of the objects again. Just want to add some new methods.

    Currently for coherent use of the MW, objects that inherit mappings must be in the same project (mapping file). This means that the common mapping file would need to be used as a starting point for the different components, and amendment methods/code APIs would have to be used at deployment by each of the components to modify the project according to their needs.
    HTH,
    -Mike

  • Mutiple mapping XML files for one datasource

    One of our projects raised the following question. Any help would be greatly appreciated.
    "Can we have mutiple ToplinkMappings.xml files for one database? The reason we are looking at it is, our toplinkMappings.xml file size is keep growing in size(right now 2.2MB), we are getting into issues while comparing with the previous versions. The PVCS diff tool and beyond compare tools are not able to interpret the corresponding blocks of code on both the versions properly."
    Haiwei

    Hi Haiwei,
    Yes, you can have multiple deployment.xml files in a session. Take a look at Configuring Multiple Mapping Projects.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Calling Ant Tasks on mulitple files

    Hello, I was wondering if this was possible in Ant. I have a directory with multiple sub-directories. In each of those subdiretories there is a build.xml Ant file. Each one of them has a Target that I run, called "build".
    Is it possible to create a main Ant Build file that will iterate through every build.xml file it finds in the sub-directories and call the target "build" on it? I couldn't find a way to do this. Thanks!

    Hi,
    I hope the following Script may help you
    build.xml
         |
         --dir
             |
             build.xml
             |
             dir1
                |
                build.xml
             |
             dir2
                |
                build.xml
    The master build.xml may call the build.xml which is commmon to all sub-directories
    <project>
      <target name="Master build" description="The master build" >
        <ant antfile="/dir/build.xml" target="build_directories" />
      </target>
    </project>
    "dir" directory may have a common build.xml which call the build.xml of each and every subdirectory.
    <?xml version="1.0" encoding="UTF-8"?>
    <project default="build_dir">
         <target name="build_directories" description="Builds sub directories" >
              <subant>
                   <fileset dir="../dir">
                             <include name="*/build.xml" />
                   </fileset>
              </subant>
        </target>     
    </project>
    subdir1 and subdir2 may have each and own copy of build.xml.
    <?xml version="1.0" encoding="UTF-8"?>
    <project default="make">
    <target name="Common-build" description="Build Common jar">
         <jar destfile="test1.jar" basedir="." />
    </target>
    </project>Please let me know if you've any queries/suggestions
    Cheers,
    Ajaykumar.sr

  • Help -- Who has experience with ant and build.xml files ?

    Hi,
    I think my build.xml file is missing setting a classpath I need, but I have never played around with a build.xml file. Could someone help ?
    Thank you.
    Grazia

    A lot of people here use ant. But not all of us can read your mind, and those of us that can are sadistic bastards that like to force people to provide details of their problems just for the hell of it.
    So please do the following:
    * Go through an ant tutorial or other introductory docs, doing an example or two if present.
    * Set up your build.xml according to what you've learned.
    * If it still doesn't work, post the relevant portions of it (hopefully you'll have a small, representative sample that reproduces the problem), along with your relevant directory and file structure, the command you're running, and what error messages you're getting.

  • Generate XSD from an not well formed xml File

    Hi,
    I have following problem:
    XML File:
    <readme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://localhost:8888/home/XDB/xsd/readme_neu.xsd">
         <title lang="de-DE">Preisliste Antriebselektronik </title>
         <title lang="en-DE">Preisliste Antriebselektronik </title>
         <edition lang="de-DE">date</edition>
         <doctype lang="de-DE">Preisliste</doctype>
         <projectstartdate lang="de-DE">date</projectstartdate>
         <projectenddate lang="de-DE">date</projectenddate>
    <projectenddate lang="en-DE">date</projectenddate>
         <status lang="de-DE">Druckvorstufe</status>
         <doku-key>PA300000</doku-key>
         <orderno lang="de-DE">
         <actual>11500204</actual>
         <previous>11341408</previous>
         </orderno>
         <orderno lang="lv-LV">
              <actual>11500476</actual>
              <previous>11341653</previous>
         </orderno>
         <orderno lang="lt-LT">
              <actual>11500484</actual>
              <previous>11341661</previous>
         </orderno>
         <orderno lang="nl-BE">
              <actual>11500492</actual>
              <previous>11341688</previous>
         </orderno>
    </readme>
    The Tags title and projectenddate makes the problem. I'd like to make an Objekt TITEL_OBJECT and PROJECTEND_OBJECT to differ the tags, but my problem is:
    xdb_titel_type is NOT FINAL
    Name Null? Typ
    SYS_XDBPD$ XDB$RAW_LIST_T
    SPRACHE VARCHAR2(4000 CHAR)
    that I lose the content the tags.
    What can i do?? is there any possible solution or isn't it possible
    thx PHIL
    I have solved the problem
    Message was edited by:
    user534856

    Hi,
    I have following problem:
    XML File:
    <readme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://localhost:8888/home/XDB/xsd/readme_neu.xsd">
         <title lang="de-DE">Preisliste Antriebselektronik </title>
         <title lang="en-DE">Preisliste Antriebselektronik </title>
         <edition lang="de-DE">date</edition>
         <doctype lang="de-DE">Preisliste</doctype>
         <projectstartdate lang="de-DE">date</projectstartdate>
         <projectenddate lang="de-DE">date</projectenddate>
    <projectenddate lang="en-DE">date</projectenddate>
         <status lang="de-DE">Druckvorstufe</status>
         <doku-key>PA300000</doku-key>
         <orderno lang="de-DE">
         <actual>11500204</actual>
         <previous>11341408</previous>
         </orderno>
         <orderno lang="lv-LV">
              <actual>11500476</actual>
              <previous>11341653</previous>
         </orderno>
         <orderno lang="lt-LT">
              <actual>11500484</actual>
              <previous>11341661</previous>
         </orderno>
         <orderno lang="nl-BE">
              <actual>11500492</actual>
              <previous>11341688</previous>
         </orderno>
    </readme>
    The Tags title and projectenddate makes the problem. I'd like to make an Objekt TITEL_OBJECT and PROJECTEND_OBJECT to differ the tags, but my problem is:
    xdb_titel_type is NOT FINAL
    Name Null? Typ
    SYS_XDBPD$ XDB$RAW_LIST_T
    SPRACHE VARCHAR2(4000 CHAR)
    that I lose the content the tags.
    What can i do?? is there any possible solution or isn't it possible
    thx PHIL
    I have solved the problem
    Message was edited by:
    user534856

  • SQL insert scripts generation from repository data xml file

    Hi All,
    I want to generate sql insert scripts from repository data xml file which contain <add-item>elements.
    Example: data xml file is contains
    <add-item item-descriptor="user" id="741">
    <set-property name="gender"><![CDATA[female]]></set-property>
    <set-property name="emailStatus"><![CDATA[__NULL__]]></set-property>
    <set-property name="receiveEmail"><![CDATA[__NULL__]]></set-property>
    <set-property name="email"><![CDATA[[email protected]]]></set-property>
    <set-property name="password"><![CDATA[a694cb1d6d011eddc444acb77338c1df6a22bac5de26330e2fe1d20f15f97ed6]]></set-property>
    <!-- rdonly derived <set-property name="abandonedOrderCount"><![CDATA[0]]></set-property> -->
    <set-property name="locale"><![CDATA[de_DE]]></set-property>
    <set-property name="userType"><![CDATA[1]]></set-property>
    <set-property name="autoLogin"><![CDATA[__NULL__]]></set-property>
    <set-property name="lastName"><![CDATA[Springford]]></set-property>
    <set-property name="member"><![CDATA[true]]></set-property>
    <set-property name="dateOfBirth"><![CDATA[7/18/1951 00:00:00]]></set-property>
    <!-- rdonly derived <set-property name="age"><![CDATA[61]]></set-property> -->
    <set-property name="registrationDate"><![CDATA[5/16/1996 00:00:00]]></set-property>
    <set-property name="login"><![CDATA[sally]]></set-property>
    <set-property name="lastActivity"><![CDATA[6/9/1999 00:00:00]]></set-property>
    <set-property name="homeAddress"><![CDATA[741]]></set-property>
    <set-property name="passwordSalt"><![CDATA[sally]]></set-property>
    <set-property name="generatedPassword"><![CDATA[__NULL__]]></set-property>
    <set-property name="firstName"><![CDATA[Sally]]></set-property>
    <set-property name="lastPasswordUpdate"><![CDATA[__NULL__]]></set-property>
    </add-item>
    Thanks
    Siva

    HI Rohan,
    Thanks for reply..
    I have checked the startSQLRepository script by using this we can export or import repository data from xml to repository.But in startSQLRepository there is no attribute to generate sql
    insert scripts from data xmls but there is a option to get the sql scripts(-ouputSQL).

  • Problem in Creating .wsdl file and mapping.xml with ant

    hi
    i am created my .wsdl file and mapping.xml file with wscompile tool but when i run this by ant tool it show a problem.
    the command runs on command prompt but when run throught ant file it shows a following error :-
    Execute failed: java.io.IOException: CreateProces: wscompile -define -mapping build\classes\META-INF\mapping.xml -d . -nd build\.................and so on
    so if anybody have any idea then plz help me asap
    thanx

    The following Ant snippet is the way I've defined my wscompile task. I'm creating a web application and it looks like yours might be an EJB endpoint, but you can adjust where necessary:
    <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
         <classpath refid="compile.classpath" />
    </taskdef>
    <target name="init">
         <echo message="-------- ${appname} --------" />
    </target>
    <!-- This target compiles the server components using an existing WSDL as the driving document.
           The configuration file must use the <wsdl> element giving the location (local file system
           or URL) of the WSDL document.
           Note: the fork argument is needed to over come a bug when using the mapping argument. See
           http://forum.java.sun.com/thread.jspa?threadID=592994&tstart=0
      -->
         <target name="generate-server-from-WSDL" depends="init">
              <wscompile fork="yes"
                           keep="true"
                           base="${basedir}/WebContent/WEB-INF/classes"
                           import="true"
                           features="wsi"
                           xPrintStackTrace="true"
                           verbose="true"
                           mapping="${basedir}/WebContent/WEB-INF/jaxrpc-mapping.xml"
                           sourcebase="${basedir}/src"
                           config="${config.server.doclit.file}">
                   <classpath>
                        <path refid="compile.classpath" />
                   </classpath>
              </wscompile>
         </target>
         <target name="compile-server-from-WSDL" depends="generate-server-from-WSDL">
              <javac srcdir="${basedir}/src" destdir="${basedir}/WebContent/WEB-INF/classes" debug="${compile.debug}">
                   <classpath refid="compile.classpath" />
              </javac>
         </target>Just make sure that the named destination directories exist before you run the script.
    If you'd like more details on the wscompile Ant task, I found the following pages invaluable:
    https://jax-rpc.dev.java.net/whitepaper/1.1/index-part1.html

  • Mappings code generation : regular SQL / cursor PL/SQL

    Hi,
    When designing mappings, I fear that code generation can be potentially dangerous, because OWB automatically chooses the best method to generate the code (regular SQL or PL/SQL).
    I am looking for some examples where code generation for a mapping:
    - gives a regular SQL statement
    - gives a cursor-based PL/SQL
    - a small change in a mapping makes a regular SQL mapping to be transformed in a cursor-based PL/SQL
    Thank you
    Alexandre
    Message was edited by:
    Alexandre Abric

    I have not said that different modes executes at the same way – what the use to have different options if they actually mean the same, right? I have said that they produced the same result i.e. if you expect the mapping to insert 1000 rows from the source to the target – it will be done no matter which operation mode you choose.
    But by different ways. To keep it simple lets say that:
    set base mode will result in:
    insert into target (…)
    select … from source;
    row based will result in:
    begin
    for a in (select * from source) loop
    insert … into target
    end loop;
    end;
    Now lets assume that 5 rows from those 1000 you are going to insert, will break some NOT NULL constraint at the target.
    If you choose Set-base mode entire insert from select will fail resulting no rows is inserted into target. Audit trail will contain message like “constraint … violated” and that’s it. You will have to find bad records by yourself.
    If you choose Row-base mode – 995 rows will be inserted (depending on mapping configuration) into the target and 5 will be listed in audit trail with the same “ constraint violated” message.
    That’s why default operating mode is “Set based fail over to Row based”. That means OWB will try to execute mapping in the fastest way – set based, but if it fail, it will try again to accomplish the task by running in row base mode, providing complete audit trail fro bad rows.

Maybe you are looking for

  • Financial Document check Not OK

    Hi All, We are using Letter of credit to approve the credit checks in the orders. We have two sales organizations. When we use the Financial document no for the normal sales for one sales organization, while saving the order the error is coming Finan

  • Why won't logic read my guitar??

    I have input 1 set to instrument.  I've tried every combination of phase invert and phantom power (although i dont even know what those things are) and my guitar still won't read.  Fresh batteries, volume turned up.  I've tried all diff settings on m

  • [Solved] Steam Can't Download Games

    Numerous people have been having this problem, where Steam will not download games correctly. It will start the download, then it slows to a crawl until it completely stops. I have found two reasons so far as to why this could be happening. One is th

  • Somehow when i click (arrange) nothing seems to be available.. it's all light and nonclikable.??

    for example the group function etc.. is not available.. i have a simple 3 layers with a shadow... i could use thoses functions before but somhow .. they are not working now.. what am i doing wrong ??

  • Microsoft JScript Runtime Error, Line: 0, Error: Object Expected?

    Hi, I just got a new computer and I have Java 2 Runtime Environment SE v 1.4.2. I keep having problems with it. It says, "Microsoft JScript Runtime Error, Line:0, Error: Object Expected. I have no idea what to do or what is actually causing this. It