3rd party integration: How to get XML Schema (.xsd) for a custom entity, to use with a mapper

Is there an easy way to get the xml schema/DTD for a custom entity, specifically an .XSD file for that entity (which will then be used to create a map to be able to transform the fields of the entity to a 3rd-party message format)?
So have a custom entity with lots and lots of fields. Each of the fields will map to a differently named field to match the schema of the 3rd party entity. A very common situation. Looking to use a tool like the Biztalk mapper or Altova's MapForce to generate
an .xslt file to transform the downloaded entity (service.Retrieve with all columns) to the new format. (Will implement a typical VETR pattern.)
Apparently with CRM 4 there was a call that provided this, but from 2011 has not been available. Working with a crm 2015 system.

That will give a descriptor of the table and allow creation of an .XSD file, but it's really complex in terms of types, and the there's type conversion. It might be an easy way to get a schema, with the downside being it's hard to use that schema. 
It seems easier to do a fetch of the record with all fields filled in using service.Retrieve, and then converting this to xml, using Microsoft's guidance leads to using https://msdn.microsoft.com/en-us/library/hh675409.aspx which will serialize the entity
into XML with all the fields converted to type string, and with complex fields likewise converted to strings with additional information about the type. 
Using this it's possible using an number of tools to create an easier to use .XSD file.
However, it would seem most integrations of this type are using 3rd party CRM connectors. Perhaps this is why Microsoft hasn't provided anything direct (and took away what they did have in crm4.0 due to it generating a hard to use .XSD or due to letting
their partners continue income streams from selling connectors").
But without using 3rd party connectors, or following the still tedious method of generating .XSD (a useable .xsd), have not yet come up with an easy, automatic way to get an .XSD or to easily integrate with 3rd party message format.

Similar Messages

  • How to get the owner name for the file in ftp using abap ?

    Hi folks ,
    How to get the owner name for the file in ftp using abap ? please help me very ugernt . I tried with all standard FTP commands
    but doest work out me . Helping in this regard highly appreciated ...
    Thanks and regards,
    Swarupa Vanarchi

    Hi
    dont you  have used the os user while calling the FTP_CONNECT FM?
    Hope you are not talking about the user executing the FTP program.
    Else If you are talking about the FTP file creator then its not related to abap as you can handle it by maintaining the user in file name itself.
    May be i am going too far with if and elses here as your question possesses no  clarity.
    Plz elaborate your requirement  before anybody can help.
    Regards
    sateesh

  • How to get On Account Balance for a Customer in Accounts Receivables(AR)

    Hi,
    Pls let me know how i can get the On Account Balance and Customer Balance for a particular customer in AR.
    Pls let me if there is any SQL query or function availabe to get On Account Balance in AR.
    Is On Account Balance and Customer balance is same in AR.
    Pls let me know how i can get both the values.
    regards
    Udit

    try to join your query from these tables:
    1.Customer - RA_CUSTOMERS_ALL
    2.Customer Name - RA_CUSTOMERS_ALL
    3. Ship to /Bill to & Location - HZ_CUST_ACCT_SITES_ALL and RA_TERRITORIES
    4.Account Balance - AR_PAYMENT_SCHEDULES_ALL
    5.Current Balance - AR_PAYMENT_SCHEDULES_ALL
    if you additionally need aging try to set from here
    a)1-30 Past - AR_PAYMENT_SCHEDULES_ALL
    b)31-60 Past - AR_PAYMENT_SCHEDULES_ALL
    c)Over 90 Past - AR_PAYMENT_SCHEDULES_ALL
    This way you can achieve the outcome

  • How to get a bootable vhd for a Linux on Hyper-V with two disks ?

    Hi folks,
    I am running a custom linux on my Hyper-V in Windows Server 2008 R2. I initially configured one disk(4GB) and then I added one more hard disk of higher capacity (8GB). Now I got two vhd files with different sizes.
    If I want to create a new linux VM (with two hard disks as original), with an existing vhd file, which one can I use?
    I tried the first one, but it is not working as expected.
    Is there any other way to get a bootable vhd file for a linux VM with two hard disks? 
    Any tools to make it?
    Thanks in advance,
    Saleem

    Hi Tim,
    Thanks for your response. I am rephrasing my question and requirement again.
    I need to create a pre-configured Virtual Machine package(something like OVA in ESXi) in Hyper-V. This package should have disk, memory and network configs.
    These are the steps I performed:
    1. I created a Linux VM with a single 4GB disk.
    2. I added another 80GB SCSI disk.
    3. Now I got two .vhd files with 108MB and 80GB sizes
    When I tried to create a new VM using VHD file, I was able to give one VHD file as input and selected 108MB VHD file for my VM.
    With this VM got created but with only one disk of size 4GB. I need to add a new disk manually to get two disks.
    My requirement is to create a VM with two/more disks using one VHD file without any manual input.
    In other words, I need to create a pre-configured VM package (Similar to OVA) that could be used to create a VM with two or more disks.
    This single package file could be given to users, so that they can deploy a similar VM as defined in the package file.
    When we create VM using ESXi OVA file, we get the configured number of disks.
    What is the similar packaging mechanism in Hyper-V?
    Does Hyper-V on Windows Server 2008/2012 and SCVMM 2008/2012 support OVF/OVA to export and import?
    Thanks,
    Saleem

  • How to get Sales rep information for each customer

    Hi
    For each record in ra_customers, I want to find associated Sales rep for each customer.
    Can some one please tell me what table stores this information?
    Thanks
    Aali

    Try
    SELECT rc.customer_name, rc.customer_number, jrs.NAME
      FROM jtf_rs_salesreps jrs, ra_customers rc
    WHERE rc.primary_salesrep_id = jrs.salesrep_idHope this helps,
    Sandeep Gandhi

  • How to change XML Schema in MDM Console?

    Hi Experts,
    My scenario: SRM send products to MDM Catalog using PI.
    I need to change the XML Schema (XSD) for processing some new fields that don't exist in Catalog. So I created a copy of the XSD file in my station and made the necessary changes.
    In XML Schema (MDM Console), I changed the FileName for getting the XSD I created.
    But when I tested SRM Shopping Cart again, this couldn't access the products in Catalog anymore.
    1) After my chage the FileName shows the name with "c:\Documents and Settings\...". Does it work?? Is this the cause of the error?
    2) Do you know why my change affect the Shopping Cart access to the products in the Catalog?
    3) Now I don't know how to undo my change in FileName. I can't do it because in the FileName MDM Console it doesn't allow to write it. It allows only to choose a file in some place, my station for example.
    Could anyone help me?
    Thanks!
    Rose

    Hi Kanstantsin,
    I was analysing what you explain, but it was not exactly this problema. But what you wrote, help me to understand better the MDM and lets me know more about schemas .
    Thank you very much for your help.
    Hi Vinary,
    It was exactly this. I had edited the name. I changed it and now it is working.
    Thank you very much for your help!
    Rose

  • All 3rd Party PlugIn Pref's get reset after InDesignCrash

    AdobeInDesignCS 6
    Steps to reproduce
    1. Install third party plugins
    2. Create Preference Settings
    3. save and quit out of InDesign
    4. launch InDesign, Verify pref settings.
    5. Force Quit InDesign
    6. Launch InDesign/Verfiy pref settings and they will not be there.

    Well, now it's official, thanks to 3rd party apps and/or faulty system software my iPod is Dead.
    When I created this thread I was having all 3rd party apps crash constantly, and instantly upon launch. The myriad of methods used to recover it to working order failed. I decided to do a Restore and use the last successful backup. It got to about the 95% mark on the restore and hung for 2 hours. The exact same place for 2 hours.
    Not having the ability or patience to wait for my iPod to get done tying up my computer, I reset it. Now, all I've got is a $299.99 Paperweight that constantly displays a nice and shiny apple logo on it's screen.
    An attempt to restore it to factory settings only gave me an error dialogue box:
    The iPod "Kuhnaydeein's iPod" could not be restored.
    An unknown error occurred (0xE8000035).
    Now what am I supposed to do? I don't live near an Apple Store, the only place that sells apple merch is the store where I work, in the department I work. I know our policy on taking back/exchanging iPods.
    What I've failed to mention is how I'm EVER going to sell one of these to someone if there's a chance they'll just be getting the same FAULTY Hardware/Software I'm now stuck with? Is Apple going to come to the rescue, read this post and replace my iPod? I sincerely hope they read this, because they don't give the slightest hint at any Direct Email addresses on the Apple.com website. (What's with that anyway?)
    So what do I do now? RESTORING IS NOT AN OPTION.

  • 1)    Is there North Bound Interface / API from SAP Solution Manager available for 3rd party integration?       i. The list of the modules that are being managed by SAP Solution Manager(s)      ii. The performance metrics of those modules/components at th

    1)
    Is there North Bound Interface / API from SAP Solution Manager available for 3rd party integration?
    i. The list of the modules that are being managed by SAP Solution Manager(s)
    ii. The performance metrics of those modules/components at the high level
    iii. The information about Early Watch Alerts (or situations to watch for)
    2)
    Is there a full SNMP interface for getting the above information from SAP Solution Manager?
    3)
    Is that understanding that SAP has SNMP support for forwarding alerts to a 3rd party system, correct?
    4)
    Does SAP has both free and licensed? If yes then what are the advantages of licensed over the open/free version?

    Mugunthan
    Yes we have applied 11i.AZ.H.2. I am getting several errors still that we trying to resolve
    One of them is
    ===========>>>
    Uploading snapshot to central instance failed, with 3 different messages
    Error: An invalid status '-1' was passed to fnd_concurrent.set_completion_status. The valid statuses are: 'NORMAL', 'WARNING', 'ERROR'FND     at oracle.apps.az.r12.util.XmlTransmorpher.<init>(XmlTransmorpher.java:301)
         at oracle.apps.az.r12.extractor.cpserver.APIExtractor.insertGenericSelectionSet(APIExtractor.java:231)
    please assist.
    regards
    girish

  • How to create our own XML Schema (.xsd) in Weblogic WorkShop

    Hi,
    I am new to Weblogic Workshop.I want to create one xml schema with custom elements.
    when I am creating a file xml schema(.xsd).The file contains default namespace and no child elements in it.I don't know how to add elements to that file.
    please tell me how to add parent elements and child elements and also our own xml namingspace.

    Hi Sivaram,
    Unfortunately, the 8.1 IDE did not have special tooling for schema generation.
    You will need to create it by hand or using an external tool
    If you are using an external tool to create the file within the schema project, you might want to disable the schema project auto build, which will be triggered every time a file save takes place
    cheers
    Raj

  • How to get XML form.

    Hi All,
    Can anybody suggest me how to get XML file of System form.
    Means i want XML file of Sales order. Where i get it ?
    Thanks,

    Hi Harish,
    Lets try this code.It will solve ur problem.
    Public Class SystemForm
          Private WithEvents SBO_Application As SAPbouiCOM.Application
        Private oOrderForm As SAPbouiCOM.Form
        Private oNewItem As SAPbouiCOM.Item
        Private oItem As SAPbouiCOM.Item
        Private oFolderItem As SAPbouiCOM.Folder
        Private oOptionBtn As SAPbouiCOM.OptionBtn
        Private oCheckBox As SAPbouiCOM.CheckBox
        Private i As Integer
        Private Sub SetApplication()
            Dim SboGuiApi As SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            SboGuiApi = New SAPbouiCOM.SboGuiApi()
            sConnectionString = Command     
            SboGuiApi.Connect(sConnectionString)   
            SBO_Application = SboGuiApi.GetApplication()
        End Sub
        Private Sub AddItemsToOrderForm()     
            oOrderForm.DataSources.UserDataSources.Add("OpBtnDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
            oOrderForm.DataSources.UserDataSources.Add("CheckDS1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
            oOrderForm.DataSources.UserDataSources.Add("CheckDS2", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
            oOrderForm.DataSources.UserDataSources.Add("CheckDS3", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
    oItem = oOrderForm.Items.Item("126")
    For i = 1 To 3
                oNewItem = oOrderForm.Items.Add("CheckBox" & i, SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX)
                oNewItem.Left = oItem.Left
                oNewItem.Width = 100
                oNewItem.Top = oItem.Top + (i - 1) * 19
                oNewItem.Height = 19           
                oNewItem.FromPane = 5
                oNewItem.ToPane = 5
                oCheckBox = oNewItem.Specific           
                oCheckBox.Caption = "Check Box" & i            '
                oCheckBox.DataBind.SetBound(True, "", "CheckDS" & i)
            Next i
            oItem = oOrderForm.Items.Item("44")
            For i = 1 To 3
                oNewItem = oOrderForm.Items.Add("OpBtn" & i, SAPbouiCOM.BoFormItemTypes.it_OPTION_BUTTON)
                oNewItem.Left = oItem.Left
                oNewItem.Width = 100
                oNewItem.Top = oItem.Top + (i - 1) * 19
                oNewItem.Height = 19         
                oNewItem.FromPane = 5
                oNewItem.ToPane = 5
                oOptionBtn = oNewItem.Specific    
                oOptionBtn.Caption = "Option Button" & i
                If i > 1 Then
                    oOptionBtn.GroupWith("OpBtn" & i - 1)
                End If
                oOptionBtn.DataBind.SetBound(True, "", "OpBtnDS")
            Next i
        End Sub
        Public Sub New()
            MyBase.New()
            SetApplication()
           End Sub
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
    If ((pVal.FormType = 139 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = True)) Then           
    oOrderForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
    If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then
    oNewItem = oOrderForm.Items.Add("UserFolder", SAPbouiCOM.BoFormItemTypes.it_FOLDER)               
                    oItem = oOrderForm.Items.Item("138")
                    oNewItem.Top = oItem.Top
                    oNewItem.Height = oItem.Height
                    oNewItem.Width = oItem.Width
                    oNewItem.Left = oItem.Left + oItem.Width
                    oFolderItem = oNewItem.Specific
                    oFolderItem.Caption = "User Folder"
                    oFolderItem.GroupWith("138")
                    AddItemsToOrderForm()
                    oOrderForm.PaneLevel = 1
                End If     
    If pVal.ItemUID = "UserFolder" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.Before_Action = True Then              
                    oOrderForm.PaneLevel = 5
                End If
            End If
        End Sub
        Private Sub SBO_Application_AppEvent(ByVal EventType As SAPbouiCOM.BoAppEventTypes)
            Select Case EventType
                Case SAPbouiCOM.BoAppEventTypes.aet_ShutDown
                    SBO_Application.MessageBox("A Shut Down Event has been caught" & _
                        vbNewLine & "Terminating 'Order Form Manipulation' Add On...")
                    End
           End Select
        End Sub
    End Class
    Regards
    Mohana

  • How read a XML Schema

    Hi,
    i wish to ask you a question: how i can read a XML Schema? Which library i have to use to visit a XML Schema? There are examples on internet? I haven't found anything about it.
    Please help me.
    Thank you, regards
    Gianni

    WXS schemas and RelaxNG schemas have an XML encoding, so any XML parser can read them. ASN1 XML schemas and compact RNG schemas require specialist parsers.
    If you wish to populate a more useful structure than DOM, then Castor has classes to represent and manipulate WXS, though I've not used them myself.
    Pete

  • When i upload my site via ftp to 3rd party hosting i only get 'index of/' when looking at the webpag

    I have exported my site and even tested on adobe and everything looks ok.  For some reason when I export and uplaod via ftp to my 3rd party hosting and look at the site I just get the index of/  and a list of the pages and directories underneath

    Thanks for that.  Now sorted.  It was a problem on my hosting
    Ian
    cid:[email protected]
    cid:[email protected]<http://twitter.com/dieselthefrog>[cid:[email protected]][cid:[email protected]]<http://www.facebook.com/dieselfrog>[cid:[email protected]][cid:[email protected]]<http://uk.linkedin.com/pub/ian-royle/30/a20/928>
    From: Abhishek Maurya [email protected]
    Sent: 04 July 2012 23:02
    To: Ian
    Subject: when i upload my site via ftp to 3rd party hosting i only get 'index of/' when looking at the webpag
    Re: when i upload my site via ftp to 3rd party hosting i only get 'index of/' when looking at the webpag
    created by Abhishek Maurya<http://forums.adobe.com/people/Abhishek+Maurya> in Help with using Adobe Muse - View the full discussion<http://forums.adobe.com/message/4538835#4538835

  • How to get SUPPLIER2 schema for OBIEE training

    Hi all,
    I am a newbie to OBIEE.
    I have been provided with a study material which guides me through with the SUPPLIERS2 schema examples.
    Is it by anyway I can get that schema from any where ?
    Also have checked with my DBA people, they are not aware of that schema, and asked me to do a search on getting it.
    Guide me in this so that I can get in touch with my DBA people on achieving the same.
    Thank you all !

    Thank you very much for replying for my post.
    Tried searching for study materials with the keywords, but still I am confused on which to start with !
    Is it possible for you to post the exact URL address to learn OBIEE from the scratch in a easy and understandable manner.
    This would be of great help to me.
    Thanks again !

  • How to parse XML against XSD,DTD, etc.. locally (no internet connection) ?

    i've searched on how to parse xml against xsd,dtd,etc.. without the needs of internet connection..
    but unfortunately, only the xsd file can be set locally and still there needs the internet connection for the other features, properties.
    XML: GML file input from gui
    XSD: input from gui
    javax.xml
    package demo;
    import java.io.File;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.xml.XMLConstants;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    import org.xml.sax.SAXException;
    public class Sample1WithJavaxXML {
         public static void main(String[] args) {
              URL schemaFile = null;
              try {
                   //schemaFile = new URL("http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd");
                   File file0 = new File("AppSchema-C01-v1_0.xsd");
                   schemaFile = new URL(file0.toURI().toString());
              } catch (MalformedURLException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              //Source xmlFile = new StreamSource(new File("web.xml"));
              Source xmlFile = new StreamSource(new File("C01.xml"));
              SchemaFactory schemaFactory = SchemaFactory
                  .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
              //File file1 = new File("XMLSchema.dtd");
              //SchemaFactory schemaFactory = SchemaFactory
                   //.newInstance("javax.xml.validation.SchemaFactory:XMLSchema.dtd");
              Schema schema = null;
              try {
                   schema = schemaFactory.newSchema(schemaFile);
              } catch (SAXException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              Validator validator = schema.newValidator();
              try {
                validator.validate(xmlFile);
                System.out.println(xmlFile.getSystemId() + " is valid");
              } catch (SAXException e) {
                System.out.println(xmlFile.getSystemId() + " is NOT valid");
                System.out.println("Reason: " + e.getLocalizedMessage());
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }Xerces
    package demo;
    import java.io.File;
    import java.util.Date;
    import org.apache.xerces.parsers.DOMParser;
    public class SchemaTest {
         private String xmlFile = "";
         private String xsdFile = "";
         public SchemaTest(String xmlFile, String xsdFile) {
              this.xmlFile = xmlFile;
              this.xsdFile = xsdFile;
         public static void main (String args[]) {
              File file0 = new File("AppSchema-C01-v1_0.xsd");
              String xsd = file0.toURI().toString();
              SchemaTest testXml = new SchemaTest("C01.xml",xsd);
              testXml.process();
         public void process() {
              File docFile = new File(xmlFile);
              DOMParser parser = new DOMParser();
              try {
                   parser.setFeature("http://xml.org/sax/features/validation", true);
                   parser.setFeature("http://apache.org/xml/features/validation/schema", true);
                   parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
                             xsdFile);
                   ErrorChecker errors = new ErrorChecker();
                   parser.setErrorHandler(errors);
                   System.out.println(new Date().toString() + " START");
                   parser.parse(docFile.toString());
              } catch (Exception e) {
                   System.out.print("Problem parsing the file.");
                   System.out.println("Error: " + e);
                   System.out.println(new Date().toString() + " ERROR");
                   return;
              System.out.println(new Date().toString() + " END");
    }

    Thanks a lot Sir DrClap..
    I tried to use and implement the org.w3c.dom.ls.LSResourceResolver Interface which is based on the SAX2 EntityResolver.
    please give comments the way I implement it. Here's the code:
    LSResourceResolver Implementation
    import org.w3c.dom.ls.LSInput;
    import org.w3c.dom.ls.LSResourceResolver;
    import abc.xml.XsdConstant.Path.DTD;
    import abc.xml.XsdConstant.Path.XSD;
    public class LSResourceResolverImpl implements LSResourceResolver {
         public LSResourceResolverImpl() {
          * {@inheritDoc}
         @Override
         public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
              ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
              LSInput input = new LSInputImpl(publicId, systemId, baseURI);
              if ("http://www.w3.org/2001/xml.xsd".equals(systemId)) {
                   input.setByteStream(classLoader.getResourceAsStream(XSD.XML));
              } else if (XsdConstant.PUBLIC_ID_XMLSCHEMA.equals(publicId)) {
                   input.setByteStream(classLoader.getResourceAsStream(DTD.XML_SCHEMA));
              } else if (XsdConstant.PUBLIC_ID_DATATYPES.equals(publicId)) {
                   input.setByteStream(classLoader.getResourceAsStream(DTD.DATATYPES));
              return input;
    }I also implement org.w3c.dom.ls.LSInput
    import java.io.InputStream;
    import java.io.Reader;
    import org.w3c.dom.ls.LSInput;
    public class LSInputImpl implements LSInput {
         private String publicId;
         private String systemId;
         private String baseURI;
         private InputStream byteStream;
         private String stringData;
         public LSInputImpl(String publicId, String systemId, String baseURI) {
              super();
              this.publicId = publicId;
              this.systemId = systemId;
              this.baseURI = baseURI;
         //getters & setters
    }Then, here's the usage/application:
    I create XMLChecker class (SchemaFactory implementation is Xerces)
    import java.io.File;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.XMLConstants;
    import javax.xml.stream.FactoryConfigurationError;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import abc.xml.XsdConstant.Path.XSD;
    public class XMLChecker {
         private ErrorMessage errorMessage = new ErrorMessage();
         public boolean validate(String filePath){
              final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
              List<Source> schemas = new ArrayList<Source>();
              schemas.add(new StreamSource(classLoader.getResourceAsStream(XSD.XML_SCHEMA)));
              schemas.add(new StreamSource(classLoader.getResourceAsStream(XSD.XLINKS)));
              schemas.add(new StreamSource(classLoader.getResourceAsStream("abc/xml/AppSchema.xsd")));
              SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
              schemaFactory.setResourceResolver(new LSResourceResolverImpl());
              try {
                   Schema schema = schemaFactory.newSchema(schemas.toArray(new Source[schemas.size()]));
                   Validator validator = schema.newValidator();
                   validator.setErrorHandler(new ErrorHandler() {
                        @Override
                        public void error(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                        @Override
                        public void fatalError(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                        @Override
                        public void warning(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                   StreamSource source = new StreamSource(new File(filePath));
                   validator.validate(source);
              } catch (SAXParseException e) {
                   return false;
              } catch (SAXException e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              } catch (FactoryConfigurationError e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              } catch (IOException e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              return true;
         public ErrorMessage getErrorMessage() {
              return errorMessage;
    }Edited by: erossy on Aug 31, 2010 1:56 AM

  • [JAXB 2.x] Defining the XML Schema Type for XmlElementDecl

    How can an XML Schema Type (XmlSchemaType) be defined for an XmlElementDecl/Ref?
    The classes are as follows:
        @XmlRegistry
        class ObjectFactory {
            // XmlSchemaType is desired, but cannot be used with XmlElementDecl/Ref: @XmlSchemaType(name = "unsignedShort")
            @XmlElementDecl(namespace = "urn:com:test:namespace", name = "char", scope = com.test.Arguments.class)
            @XmlJavaTypeAdapter(com.test.CharacterAdapter.class )
            public JAXBElement<Character> createArgumentsChar(Character value) {
                return new JAXBElement<Character>(_ArgumentsChar_QNAME, Character.class, com.test.Arguments.class, value);
        @XmlAccessorType(XmlAccessType.FIELD)
        @XmlType(name = "", propOrder = { "arguments" })
        class Arguments {
            @XmlElementRefs( {
                    @XmlElementRef(name = "char", namespace = "urn:com:test:namespace", type = JAXBElement.class),
            protected List<JAXBElement<?>> arguments;
        }The desired schema is as follows:
        <xs:element name="arguments" minOccurs="0">
            <xs:complexType>
                <xs:sequence>
                    <xs:choice minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="char" type="xs:unsignedShort" />
                    </xs:choice>
                </xs:sequence>
            </xs:complexType>
        </xs:element>However, when generating the schema from these classes (schemagen), the resulting "char" element type is "xs:string," not "xs:unsignedShort" as desired. What annotation can be used to indicate that the type should be xs:unsignedShort? If the addition of an annotation is not possible, are there any other ways to accomplish this?
    Message was edited by: Shelley (Indicated "JAXB 2")

    There are mappings between XSD type and Java type table on the Sun website.

Maybe you are looking for

  • How do I remove an audiobook from my iphone?

    How do I remove or delete an audiobook from my iphone 4s?

  • Help:alternate for calling function in where clause

    Hi , In below query i'm calling function in where clause to avoid COMPLETE status records,due to this query taking 700 secs to return result.If i'm remove below function condition it's returning results with in 5 secs.Can you some one advice to any a

  • Portege R100: 4GB SD card runs very slow - unable to format

    Laptop working fine, no issues when using 1GB SD card. When 4GB SD card inserted PC runs very slow. Eventually I am able to run Toshiba SD Memory Card Format software (latest download version). It doesn't seem to recognise 4GB card. Unable to format.

  • Help with Adobe Photo Downloader in PSE 7?

    I do not allow PSE 7 to "see" pictures all over my hard drives; I have ONE watched folder called "my picture collection", in which are stored all of my "final copy" pictures, and these are the only pictures in "my catalog". Since I am using Photoshop

  • Translation problem - using browser language

    Hi, I have an application with french as the primary language and english as the secondary. To switch between both, i'm using an application item. When i'm on the application in french (application item set to french) the login page shows correctly u