JAXB 1 : generating simpleTypes classes

Sorry, I posted an uncompleted message.
Hello, I'm new to JAXB technology.
Since I'm working with j2sdk 1.4 I c'ant use JAXB 2, so I'm using JAXB 1.0.6.
When I call the xjc ant task, my java classes are generated... buy simple types do not generate any java class.
Let's say I have the following xsd:
<xs:complexType name="EXAMPLE">
<xs:sequence>
<xs:element name="market-type" type="po:market-type"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="MARKET-TYPE">
<xs:restriction base = "xs:string">
<xs:enumeration value = "PRIM"/>
<xs:enumeration value = "SECOND"/>
</xs:restriction>
</xs:simpleType> After xjc compilation I have a EXAMPLE Java class, but its element "market-type" is a String and not a MARKET-TYPE as I expected.
Is it normal? Can I customize the output in order to generate java classes for simpleTypes?

The base data type of the simpleType MARKET-TYPE is xsd:string.

Similar Messages

  • JAXB to generate java classes for XSD.

    Hi
    I have a XSD, which is importing other couple of xsds in it, tried to generate java classes using xjc, it is throwing error.
    C:\vittal\Project\received\development-1\da_xsd>xjc -p com daAuthoring.xsd
    parsing a schema...
    [ERROR] Property "Alt" is already defined. Use <jaxb:property> to resolve thi
    s conflict.
      line 42 of file:/C:/vittal/Project/received/development-1/da_xsd/commonElement
    s.xsd
    [ERROR] The following location is relevant to the above error
      line 2205 of file:/C:/vittal/Project/received/development-1/da_xsd/daCommonEle
    ments.xsd
    Failed to parse a schema.Please let me know how to fix this issue.

    Thanks for information,
    I do understand xml well, and having basic knowledge on XSD.
    1. can i generate a java classes for a xsd which is including other XSDs.
    2. how to overwrite the issue, using annotation, point me to a location where i will get more information, that will be great help.
    here is my xsd.
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" xmlns:dctm="http://www.documentum.com" elementFormDefault="qualified">
         <xs:import namespace="http://dita.oasis-open.org/architecture/2005/" schemaLocation="ditaarch.xsd"/>
         <xs:import namespace="http://www.documentum.com" schemaLocation="dctmAttrs.ent.xsd"/>
         <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
         <xs:group name="alt">
              <xs:sequence>
                   <xs:element ref="alt"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="desc">
              <xs:sequence>
                   <xs:element ref="desc"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="title">
              <xs:sequence>
                   <xs:element ref="title"/>
              </xs:sequence>
         </xs:group>
         <!-- Elements in tblDecl.mod -->
         <xs:group name="colspec">
              <xs:sequence>
                   <xs:element ref="colspec"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="entry">
              <xs:sequence>
                   <xs:element ref="entry"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="row">
              <xs:sequence>
                   <xs:element ref="row"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="tbody">
              <xs:sequence>
                   <xs:element ref="tbody"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="tgroup">
              <xs:sequence>
                   <xs:element ref="tgroup"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="thead">
              <xs:sequence>
                   <xs:element ref="thead"/>
              </xs:sequence>
         </xs:group>
    </xs:schema>

  • JAXB problem generating java classes

    I'm doing some integration and have received a schema from the vendor the other day. When I try to generate java classes with the jaxb compiler I get this output
    parsing a schema...
    [ERROR] Property "Value" is already defined.
      line 14 of jar:file:/C:/win32app/Java/jdk6/lib/tools.jar!/com/sun/xml/internal/xsom/impl/parser/datatypes.xsd
    [ERROR] The following location is relevant to the above error
      line 384 of file:/C:/code/sca-ecr.xsd
    Failed to parse a schema.
        <xsd:complexType name="options">
            <xsd:sequence>
                <xsd:element name="option" maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:simpleContent>
                            <xsd:extension base="xsd:string">
    (Line 384)                  <xsd:attribute name="value" type="xsd:string"/>
                            </xsd:extension>
                        </xsd:simpleContent>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>So, googling about this I came across these to articles that almost describes my problem.
    http://weblogs.java.net/blog/kohsuke/archive/2005/05/compiling_mathm_1.html
    https://jaxb.dev.java.net/guide/Dealing_with_errors.htmlAdding the this code did not help. Downloading JAXB 2.1.4 did not help, adding the -extension parameter still same result.
            <xsd:annotation>
              <xsd:appinfo>           
                <jaxb:property name="someAttribute" />
              </xsd:appinfo>
            </xsd:annotation>      Why is jaxb failing ? Could it be that and attribute is not allowed to be called "value" ?
    Any answers will do
    regards abq

    Well, after hours of digging I found a solution which actually was right in front of me the whole time.
    This is how I edited the schema.
        <xsd:complexType name="options">
            <xsd:sequence>
                <xsd:element name="option" maxOccurs="unbounded" >
                    <xsd:complexType>
                        <xsd:simpleContent>
                            <xsd:extension base="xsd:string">
                               <xsd:attribute name="value" type="xsd:string" >
                                  <xsd:annotation><xsd:appinfo>
                                    <jaxb:property name="realValue" />
                                  </xsd:appinfo></xsd:annotation>
                                 </xsd:attribute>
                            </xsd:extension>
                        </xsd:simpleContent>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>Before, I placed the <xsd:annotation> tag efter the first line but inside the <xsd:attribute> made much better if you would like it to work.
    When marshling an @XmlRoot object will produce valid xml code. So even though that the server have a different xml schema, they will be able to talk to each other.
    abq

  • JAXB not generating correct class definition

    Hi,
    I am using JAXB 2.0 and the JAXB plugin for Eclipse 3.x.
    The problem I have is that when I run XJC on my XSD file the class definition for
    a particular class is not what I am expecting. The class only defines 1 get method instead of three. While I am expecting to see getX getY and getZ I am seeing only 1 method getXAndgetYAndgetZ. Here is a snippet of the XSD file:
         <xs:element name="Sql">
              <xs:complexType>
                   <xs:sequence minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="Query"/>
                        <xs:element ref="Table" maxOccurs="unbounded"/>
                        <xs:element name="Database" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>I have defined the Table element in the XSD.
    In this case my generated Sql class has the following method:
    public List<JAXBElement<String>> getQueryAndTableAndDatabase() {
            if (queryAndTableAndDatabase == null) {
                queryAndTableAndDatabase = new ArrayList<JAXBElement<String>>();
            return this.queryAndTableAndDatabase;
        }Is there a problem with my XSD file or am I omitting a parameter when running XJC? Any help greatly appreciated

    LDAPLoginModule uses the jackrabbit UserManagerImpl to create user's in CRX (CQ), not the CQ5 implementation which is disappointing. Have to manually add the sling:resourceType.

  • JAXB - Generated Java Classes error

    Hi,
    I am having a problem generating java classes given the follow snippet from a DTD. The ImplemenationData class that is generated does not include ImplementationPlatform and ProgramParameters as attributes. Instead, it includes these two elements in the PredicatedLists and then generates a content exception when those elements are not found. Can anyone tell me why these two elements are not being generated as attributes with the associated setter/getter methods to go with them? The ExeOptions, DllOptions and ExternalOptions are being generated properly and included in the PredicatedLists as they should be. Any help would be greatly appreciated.
    <!ELEMENT ImplementationPlatform           (#PCDATA)>
    <!ELEMENT ProgramParameters                (#PCDATA)>
    <!ELEMENT ImplementationData
         (ImplementationPlatform,
         ProgramParameters,
         (ExeOptions
         |DllOptions
         |ExternalOptions))>
    <!ELEMENT ExeOptions
         (PathAndFileName,
         WorkingDirectoryName?,
         Environment?,
         InheritEnvironment,
         StartInForeGround?,
         AutomaticClose?,
         WindowStyle?,
         RunInXTerm?)>
    <!ELEMENT DllOptions
         (PathAndFileName,
         EntryPointName,
         ExecuteFenced?,
         KeepLoaded?)>
    <!ELEMENT ExternalOptions
         (ServiceName,
         ServiceType,
         InvocationType,
         ExecutableName,
         ExecutableType,
         IsLocalUser,
         IsSecurityRoutineCall,
         CodePage?,
         TimeoutPeriod,
         TimeoutInterval?,
         IsMappingRoutineCall,
         MappingType?,
         ForwardMappingFormat?,
         ForwardMappingParameters?,
         BackwardMappingFormat?,
         BackwardMappingParameters?)>

    Just a thumb suck but, have you tried placing the defintitions after the declarations instead of before.
    Dave

  • Error when generating Java Classes from XSD

    I'm getting the following error when using oragc to generate Java classes from a schema:
    Error: Schema Class Generator failed to generate classes. oracle.xml.parser.schema.XSDException: Invalid facet 'pattern' in element 'simpleType'
    Any thoughts?
    Here's the part where it is getting the error:
    +111 <!-- Timestamp Type - Timezone portion is required and fractional seconds are prohibited -->
    +112 <xsd:simpleType name="TimestampType">
    +113 <xsd:annotation>
    +114 <xsd:documentation>Base type for a date and time stamp</xsd:documentation>
    +115 </xsd:annotation>
    +116 <xsd:restriction base="xsd:dateTime">
    +117 <xsd:pattern value="[1-9][0-9]{3}\-.+T[^\.]+(Z|[\+\-].+)" />
    +118 </xsd:restriction>
    +119 </xsd:simpleType>

    I would recommend using JAXB instead of the Oracle class generator. This will give a standards based object-to-XML platform.
    Oracle provides two JAXB implementations: one in the TopLink product, and the other in the XDK.
    For an example of using TopLink JAXB see:
    http://www.oracle.com/technology/products/ias/toplink/technical/tips/jaxb/index.htm
    TopLink also provides the ability to map existing Java objects to an existing XML Schema, for an example of this see:
    http://www.oracle.com/technology/products/ias/toplink/technical/tips/ox/index.htm
    -Blaise

  • JAXB: Problem generating java enums

    Hi
    I'm having som problems configuring JAXB to generate type safe enums. The schema I'm using has several structures similar to this simplified example:
        <xs:element name="Car">
            <xs:complexType>
                <xs:sequence>
                    <xs:element name="CarTypeEnumInComplexType">
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:enumeration value="Truck"/>
                                <xs:enumeration value="Jeep"/>
                                <xs:enumeration value="SUV"/>
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:element>
                </xs:sequence>
            </xs:complexType>
        </xs:element>In the resulting Java code CarTypeEnumInComplexType is just generated as a String value in the Car Interface.
    What I really want is a separate Java class for "CarTypeEnumInComplexType" - with constants for each enumeration value.
    However, I do not want to change the schema - as this is maintained by another company.
    For a moment I thought I'd found the solution: By setting the global binding setting "typesafeEnumBase" to "xs:string" I made JAXB generate this kind of enumeration classes in cases like this:
    <xs:simpleType name="CarTypeEnum">
            <xs:restriction base="xs:string">
                <xs:enumeration value="Truck"/>
                <xs:enumeration value="Jeep"/>
                <xs:enumeration value="SUV"/>
            </xs:restriction>
        </xs:simpleType>However, I still can't make this work for enumerations nested within a complex type as illustrated in the first example.
    I'm new to XML schemas and JAXB - so I may be missing something obvious here...
    Is there any way to make JAXB generate an enum class for "CarTypeEnumInComplexType" in my first example without altering the schema structure?
    Vidar

    Well I couldnt really find any clear documentation to this , however with this post I was able to get going in the right direction I thought I would post the solution here.
    This assumes you have some control of your schema , it doesnt solve the problem where you cant touch the schema at all.
    So first my bindings.xjb file looks like:
    <?xml version="1.0"?>
    <jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jxb:extensionBindingPrefixes="xjc">
         <jxb:bindings schemaLocation="CMSOSS.xsd" node="/xs:schema">
              <jxb:globalBindings typesafeEnumBase ="xs:string">
                   <xjc:serializable uid="12343"/>
              </jxb:globalBindings>
              <jxb:schemaBindings>
                   <jxb:package name="com.cms.oss"/>
                   <jxb:nameXmlTransform>
                        <jxb:elementName suffix="Element"/>
                   </jxb:nameXmlTransform>
              </jxb:schemaBindings>
         </jxb:bindings>
    </jxb:bindings>
    First its necessary to have the enum type defined outside of the complex type:
    <xs:simpleType name="serviceTypeEnum">
              <xs:annotation>
                   <xs:documentation>Type of service being added (RES, BUS, FAX, POTS)</xs:documentation>
              </xs:annotation>
              <xs:restriction base="xs:string">
                   <xs:enumeration value="RES"/>
                   <xs:enumeration value="BUS"/>
                   <xs:enumeration value="FAX"/>
                   <xs:enumeration value="POTS"/>
              </xs:restriction>
         </xs:simpleType>
    Then you can use the enum in your complex type in the following manner
         <xs:element name="service">
              <xs:annotation>
                   <xs:documentation>Create a service tag for each new line of service</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="phone"/>
                        <xs:element name="type" type="serviceTypeEnum">
                             <xs:annotation>
                                  <xs:documentation>Type of service being added (RES, BUS, FAX, POTS)
                                  </xs:documentation>
                             </xs:annotation>
                        </xs:element>
                        <xs:element ref="lineDevice"/>
                        <xs:element ref="LNP" minOccurs="0"/>
                        <xs:element ref="VMPIN"/>
                        <xs:element ref="location"/>
                        <xs:element name="userService" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    Some better documentation on this would sure help ... however I dont think this solves completely the original problem...
    I would think that type safe enums should be built into the specification without all this custom binding stuff.
    R
    S

  • How to omit xmlns from generated Java classes

    Hi,
    I'm using JAXB and xjc to generate Java classes from xsd fils. I've noticed that when marshalling these Java classes to XML string, there are few xmlns attributes that (as far as I concern :-))
    "waste" space on the generated xml (space is critical resource in our application). Is there a way to order the Marashaller to omit these xmlns attributes from the generated files?
    I tried to edit the generated xml string. I removed the xmlns attributes, but unmarshall it back to Java objects failed...
    Thanks for any help,
    Barak.

    If the xmlns is specified in the xsd, it is also required in the xml. If you do not want it, however you can remove it from your xsd and then generate your xml

  • Jaxb bind to custom class

    Hi,
    i have a wsdl with such schema: complextype person with elements COLBOBPPHONE, COLBOBPPHONE and COLBOBPEMAIL. wsimport generates than class Person and getters/setters for this elements. I'd like a custom binding, than makes one member in Person named communications. In communications i'd have getters and setters for COLBOBPPHONE, COLBOBPPHONEand COLBOBPEMAIL. Than i would access it by person.getCommunications().getCOLBOBPPHONE(). So i try like this, i created a new complextype:
    <complexType name="Communications">
    <all>
      <element name="telephones" type="ns:COLBOBPPHONE" minOccurs="1"
    maxOccurs="1" nillable="true" />
      <element name="faxes" type="ns:COLBOBPPHONE" minOccurs="1"
    maxOccurs="1" nillable="true" />
      <element name="emails" type="ns:COLBOBPEMAIL" minOccurs="1"
    maxOccurs="1" nillable="true" />
    </all>
    </complexType>How to i say in jaxb custom bindings that the elements COLBOBPPHONE, COLBOBPPHONEand COLBOBPEMAIL should be bind to property communications which is class Communications? Is this even possible with jaxb? Maybe i have to use jixb or something else?
    for better understanding, is the structure mapping that description follows possible also with jaxb? [jibx structure mapping|http://jibx.sourceforge.net/binding/tutorial/binding-structures.html]
    Edited by: juro on Jun 23, 2009 6:50 AM

    yes. check getter and setter functions.

  • About generating Java classes from XSD Schema ???

    I need a powerfull tool to generate Java classes from XML Schema. I want that generated classes to have the option to validate XML(to be JAXP1.2 compliant).
    I used XML Spy 5.4 but the generated classes can't validate an XML file.
    Can you help me with other tools that:
    - generate Java classes from XSD
    - generate sample XML from XSD
    - are JAXP1.2 compliant(validate a XML file with a schema)
    Thanks.

    You can also use Castor: http://www.castor.org
    It generates classes from XML Schemas and enables data
    binding without writing any line of a fuckin SAX
    parser :-)I evaluated Castor and JAXB and while JAXB isn't perfect, it's got some things over Castor. Castor almost looks abandonded when I go to the site. The documentation just sort of trails off.

  • Xjc generates incomplete .class files

    Hi,
    I want to generate java classes using xml schema with jAXB.
    I have the following xml schema:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="clinicalDocument" type="ClinicalDocumentType"/>
    <xsd:element name="comment" type="xsd:string"/>
    <xsd:complexType name="ClinicalDocumentType">
    <xsd:sequence>
    <xsd:element name="typeId" type="TypeId"/>
    <xsd:element name="id" type="Id"/>
    <xsd:element name="code" type="Code"/>
    <xsd:element name="title" type="xsd:string"/>
    <xsd:element name="effectiveTime" type="EffectiveTime"/>
    <xsd:element name="confidentialityCode" type="ConfidentialityCode"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="TypeId">
    <xsd:attribute name="extension" type="xsd:string"/>
    <xsd:attribute name="root" type="xsd:string"/>
    </xsd:complexType>
    <xsd:complexType name="Id">
    <xsd:attribute name="value" type="xsd:string"/>
    <xsd:attribute name="root" type="xsd:string"/>
    </xsd:complexType>
    <xsd:complexType name="Code">
    <xsd:attribute name="value" type="xsd:string"/>
    <xsd:attribute name="codeSystem" type="xsd:string"/>
    <xsd:attribute name="codeSystemName" type="xsd:string"/>
    <xsd:attribute name="displayName" type="xsd:string"/>
    </xsd:complexType>
    <xsd:complexType name="EffectiveTime">
    <xsd:attribute name="value" type="xsd:string"/>
    </xsd:complexType>
    <xsd:complexType name="ConfidentialityCode">
    <xsd:attribute name="code" type="xsd:string"/>
    <xsd:attribute name="codeSystem" type="xsd:string"/>
    </xsd:complexType>
    </xsd:schema>
    Upon running xjc the only files generated was:
    ClinicalDocumentType.java
    Code.java
    ConfidentialityCode.java
    EffectiveTime.java
    Id.java
    ObjectFactory.java
    TypeId.java
    Why does ClinicalDocument.java missing?
    Thanks.

    it is generating clinicalDocument.java in my case.

  • How to generate a class automatically in JDev

    Suppose from OS side, I create a new empty Java file in the src directory of a project in JDev. Then in JDev, I click on the "refresh"/reload button for that project. Now I see the new java file. Double click it to open it; it is blank. In this case, how can I generate a class using the file name as the class name, and a default constructor or even a main method etc.?
    Is there any convenient way of doing this, rather than going to the usual route, which is File menu, then new, java file, from that UI to give a class name, choose to include a main method etc..
    Thank you.

    Duncan Mills blogged about how to build your own templates http://blogs.oracle.com/groundside/entry/adventures_in_adf_logging_part1
    Not exactly your case, but you should get the idea.
    Timo

  • Best Practice for WSDL Generate Proxy Class for Web Service with Two Versions

    Dear All
    Thank you in advance for you help.
    I would like to generate proxy classes for same function but with two versions.
    Old version web service (v23.2) is used for stable modules in a project which is not going to modify.
    However, enhancement is added in new version web service (v24) and is going to use in any future modules.
    For example,
    wsdl.exe -o="TestProxy.cs" -l:CS -n:Test -sharetypes https://community.workday.com/custom/developer/API/Notification/v23.2/Notification.wsdl https://community.workday.com/custom/developer/API/Notification/v24.0/Notification.wsdl
    It generates similar classes with an '1' added at the end of the class name.
    ublic partial class Event_TargetObjectType {
    private Event_TargetObjectIDType[] idField;
    public partial class Event_TargetObjectType1 {
    private Event_TargetObjectIDType1[] idField; ...}
    Since the function inside some class is the same, is it possible for WSDL.exe to generate proxy classes automatically that if the class is the same, then generate one class only (sameFunction())  but if it detects the class is different, then add '1'
    to the end of class name (differentFunction() and differentFunction1())
    i.e.
    public class sameFunction()
    public class differentFunction()
    private int a;}
    public class differentFunction1()
    { private int b;
    Best Regards
    mintssoul

    Hi  mintssoul,
      As per this case, I have shared corresponding details below :
    1.As far as I know, WCF doesn’t support method overloading directly
    2.Because WSDL doesn’t support method overloading (not OOPs).
    3.WCF generates WSDL which specifies the location of the service and the operation or methods the service exposes.
    4.WCF use Document/Literal WSDL Style : Microsoft proposed this standard where the soap body element will contain the web method name.
    5.By default all the WCF services conform to the document literal standard where the soap body should include the method name.
    6.but you can differ the method in the same manually by using Name attribute like below 
    For example:
        [OperationContract(Name="Integers")]
        int Display(int a,int b)
        [OperationContract(Name="Doubles")]
    double Display(double a,double b)
    7. Or I suggest you that can use svcutil to map multiple namespaces for generating wcf service proxies .
        for more information about this, refer here :
    http://stackoverflow.com/questions/1103686/use-svcutil-to-map-multiple-namespaces-for-generating-wcf-service-proxies

  • Compilation Error for import classes not found in generated Proxy Class

    Hi,
    We are generating java classes for the COM dll using JCOM com2java compiler.
    We are getting a compilation error for import class not found when compiling the
    generated Proxy java source code. It can't find the com.bea.jcom.Dispatch class that
    the generated Proxy java source code extends. It also can't find com.bea.jcom.Variant
    or com.bea.jcom.Param. These are interfaces or data types or classes used by COM
    library.
    I added weblogic.jar to my class path and the only Dispatch class i found inside
    the weblogic.jar is com.linar.jintegra.Dispatch;
    We have com objects for which we want to develop an EJB client to interface with
    the COM object using JCOM with Native Mode disabled.
    Any help on the compilation error..I tried changing the extends for Dispatch to com.linar.jintegra.Dispatch
    but the other errors are still there.
    To begin with, I think the generated code should not refer to any of the COM data
    types.
    Any help please.
    Thank you in advance,
    Regards,
    Rahul Srivastava
    [email protected]

    Hi,
    I resolved the other errors by changing all references from com.bea.jcom.Variant
    etc to com.linar.jintegra.class name..all were present under the com.linar.jintegra
    package.
    Thank you all anyways,
    Regards,
    rahul
    "Rahul Srivastava" <[email protected]> wrote:
    >
    Hi,
    We are generating java classes for the COM dll using JCOM com2java compiler.
    We are getting a compilation error for import class not found when compiling
    the
    generated Proxy java source code. It can't find the com.bea.jcom.Dispatch
    class that
    the generated Proxy java source code extends. It also can't find com.bea.jcom.Variant
    or com.bea.jcom.Param. These are interfaces or data types or classes used
    by COM
    library.
    I added weblogic.jar to my class path and the only Dispatch class i found
    inside
    the weblogic.jar is com.linar.jintegra.Dispatch;
    We have com objects for which we want to develop an EJB client to interface
    with
    the COM object using JCOM with Native Mode disabled.
    Any help on the compilation error..I tried changing the extends for Dispatch
    to com.linar.jintegra.Dispatch
    but the other errors are still there.
    To begin with, I think the generated code should not refer to any of the
    COM data
    types.
    Any help please.
    Thank you in advance,
    Regards,
    Rahul Srivastava
    [email protected]

  • Can't fill ByteArray in EJB-Method with generated Model-Class from WD-Model

    Hello everybody,
    i try to call an ejb-method with data from an FileUpload-UI-Element in WD. The EJB-Method is receiving the byte-data to create a document in KM via a Web-Service.
    The ebj-methid has the following signature:
    public FObject putFileDataSimple (byte [] btContent, String fullFileName, String username, String password)
    After importing the Model and creating a context node i have the following structure:
    Request_X_putFileDataSimple
    +---btContent (Node)
          +-- item
    + fullFileName
    + username
    + password
    btContent is of the generated Type Byte_Item, which is itself a generated Model-Class of modelClassType ARRAY
    item is of Type byte
    But i simply have problems to fill the context node (or the binded model-object). i tried different ways and looked at thread [https://www.sdn.sap.com/irj/scn/thread?messageID=1954223] but i cant get it work.
    So my Method in WD looks like this to fill the structure and start the ejb-method:
    public boolean putKMDataSimple( com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource fin )  {
    try
      wdContext.currentRequest_X_putFileDataSimpleElement().setFullFileName("abc");
      wdContext.currentRequest_X_putFileDataSimpleElement().setUsername("def");
      wdContext.currentRequest_X_putFileDataSimpleElement().setPassword("xxx");
      byte[] buffer = new byte[1];
      InputStream in = fin.read(false);
      int i = 1;
      int j = 0;
      while (i!=-1)
         i = in.read(buffer);
         if (i!=-1)
           Byte_Item bi = new Byte_Item(mAlf);     // mAlf ist global defined Model-Class-Instance
           bi.setItem(buffer[0]);
            wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().addBtContent(bi);
      wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().execute();
    Doing this results in Error-Messages like:
    Model-Object is not a complex type for every byte added this way.
    And finally an IllegalArgumentException at java.lang.reflect.Array.set(Native Method)
    The second way i tried is:
    public boolean putKMDataSimple( com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource fin )  {
    try
      wdContext.currentRequest_X_putFileDataSimpleElement().setFullFileName("abc");
      wdContext.currentRequest_X_putFileDataSimpleElement().setUsername("def");
      wdContext.currentRequest_X_putFileDataSimpleElement().setPassword("xxx");
      byte[] buffer = new byte[1];
      ArrayList<Byte> btlist = new ArrayList<Byte>();
      InputStream in = fin.read(false);
      int i = 1;
      int j = 0;
      while (i!=-1)
         i = in.read(buffer);
         if (i!=-1)
              btList.add(buffer[0]);
      wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().setBtContent(btList);
      wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().execute();
    Trying so results in:
    java.lang.ClassCastException: class java.lang.Byte:null incompatible with interface com.sap.tc.cmi.model.ICMIModelClass:library:com.sap.tc.cmi(at-sign)[email protected]@alive
    whenn calling the setBtContent Method
    I don't what to do now to fill the context/model-object the right way.
    Any helpfull hints are very welcome
    Edited by: Matthias Hayk on Dec 1, 2008 5:51 PM
    Edited by: Matthias Hayk on Dec 2, 2008 10:56 AM

    Ok Vesselin and thanx for your idea,
    so i adapted the source in the way you told like the following:
                     ArrayList<Byte_Item> btlist = new ArrayList<Byte_Item>();
                     byte[] buffer = new byte[1];
                     InputStream in = fin.read(false);
                     int i = 1;
                     int j = 0;
                     while (i!=-1)
                          i = in.read(buffer);
                          if (i!=-1)
                               // Byte gelesen
                               Byte_Item bi = new Byte_Item(mAlf);
                               bi.setItem(buffer[0]);
                               btlist.add(bi);
                               j++;
                     wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().setBtContent(btlist);     
                     wdContext.currentRequest_X_putFileDataSimpleElement().modelObject().execute();
    This results also in the following Exception when exceuting the WS-proxy:
    execute
    [EXCEPTION]
    java.lang.IllegalArgumentException
    at java.lang.reflect.Array.set(Native Method)
    at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.getInputParameters(EJBGenericModelClassExecutable.java:215)
    at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.execute(EJBGenericModelClassExecutable.java:112)

Maybe you are looking for

  • Unknown error -50 from iTunes

    When I download albums I get this error 'an unknown error ocurred -50) and certain tracks will not download.  Never had it before, though I upgraded itunes to the latest version.  I'm running crappy Lion and I have no firewall on router.  Anyone know

  • Should I output to DLT using DDP 2.0 or 2.10 ?

    Should I output to DLT using DDP 2.0 or 2.10 ?

  • Issue - [Receiving Text]

    My aplogies if this has already been dealt with in a previous post. Since yesterday every text I receive from my girlfriend is incomplete and has [Receiving Text] either at the end or sometimes half way through a message (the rest of the message foll

  • Impact of 603 mvt type

    i would like to know impact of 603 mvt type. my user is using vl01no transaction for outbound delivery process.    in this transaction system is generating 603 mvt type. even though receiving plant is not processing GR for this OBD,still system is sh

  • Fix for X-grid agents losing their config across reboots??

    Hello, We have a podcast producing system with 5 servers, 3 of which are Xgrid agents, and one of the others is the Xgrid controller. Sometimes we need to reboot some of the machines, and when we do the whole Xgrid set up goes. We need to go in to XG