Any element with JAXB are always empty

Hi guys!
I'm trying to use the any element to specify some content for my web service. My XML schema contains this:
<complexType name="casObject">
  <sequence>
    <element name="type"     type="string"/>
    <element name="key"          type="long"     nillable="true" />
    <any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
  </sequence>
</complexType>I'm using jaxb 1.6 and it provides a method to get my any elements. In my example: List fieldList = casObject.getAny();
The schema validation doesn't complain, the logging interceptor shows that the additional elements (from any element) are transfered, but the list is always empty. Any idea why this list is always empty?
I've also have a question to the xsi:type element and jaxb in the web service forum called "missing xsi:type", maybe it it fits better in this forum. Please take a look.
http://forum.java.sun.com/thread.jspa?threadID=743719&tstart=0
Cheers,
Ingo

Hi Achim,
According to my knowledge, there are no known problems with a "required Extended Protection" / "Always On" / "Livelink Server" combination.
Extended Protection helps to prevent an authentication relay attack by using service binding and channel binding. We need to note that when Extended Protection is set to
Required, only connections from protected applications on protected operating systems are accepted. This setting is the most secure but connections from operating systems or applications that do not support Extended Protection will not be able
to connect to SQL Server. For more details, please review the following article.
Connect to the Database Engine Using Extended Protection
https://msdn.microsoft.com/en-us/library/ff487261(v=sql.110).aspx
Thanks,
Lydia Zhang
If you have any feedback on our support, please click
here.
Lydia Zhang
TechNet Community Support

Similar Messages

  • Creating empty-tag-elements with JAXB?

    Hi,
    is there any possibility to force JAXB to create empty-tag-elements? For example
    <exampletag attribute="value" />
    instead of
    <exampletag attribute="value">
    </exampletag>.
    I really need to close my tags in the described way but have found no possibility to do so.
    Thanks for your help
    Daniel

    Maybe this will help. I take advantage of the following behavior of the JAXB Marshaller to give me the form of output I require.
    When a class (element) has "null" content, the output is of the form <tagger id="Unique"/>. When it has "empty" content, the output is of the form <tagger id="Unique"></tagger>.
    Example code snippets:
    For "null" content:
    @XmlRootElement(name = "tagger")
    public class TagClose
      public void setId(String id) { this.id = id; }
      public String getId() { return this.id; }
      @XmlValue
      String content = null;
      @XmlAttribute(name="id")
      String id = null;
    }For "empty" content:
    @XmlRootElement(name = "tagger")
    public class TagClose
      public void setId(String id) { this.id = id; }
      public String getId() { return this.id; }
      @XmlValue
      String content = "";
      @XmlAttribute(name="id")
      String id = null;
    }

  • Marshalling HashMap with JAXB 2.0 - empty tags & ill schema

    Hi all,
    I expected JAXB 2.0 to be capable to handle basic classes like HashMap, but it does not look so. I have two classes: SimpleNegotiationManager which has a property HashMap in which are stored the instances of SimpleInitiatedConversation:
    package xml;
    import javax.xml.bind.annotation.*;
    import java.util.HashMap;
    @XmlAccessorType(AccessType.FIELD)
    @XmlRootElement
    public class SimpleNegotiationManager {
        @XmlElement
        protected HashMap<String, SimpleInitiatedConversation> initiatedConversations;
        public SimpleNegotiationManager() {
        public HashMap<String, SimpleInitiatedConversation> getInitiatedConversations() {
            if (initiatedConversations == null) {
                initiatedConversations = new HashMap();
            return initiatedConversations;
        public void setInitiatedConversations(HashMap<String, SimpleInitiatedConversation> initiatedConversations) {
            this.initiatedConversations = initiatedConversations;
    }and
    package xml;
    import javax.xml.bind.annotation.*;
    import java.util.ArrayList;
    import java.util.List;
    @XmlAccessorType(AccessType.FIELD)
    @XmlType
    public class SimpleInitiatedConversation {
        @XmlElement
        protected List<String> messages;
        protected String conversationID;
        protected int protocolState;
        public SimpleInitiatedConversation() {
        public List<String> getMessages() {
            if (messages == null) {
                messages = new ArrayList();
            return messages;
        public void setMessages(List<String> messages) {
            this.messages = messages;
        public int getProtocolState() {
            return protocolState;
        public void setProtocolState(int protocolState) {
            this.protocolState = protocolState;
        public String getConversationID() {
            return conversationID;
        public void setConversationID(String conversationID) {
            this.conversationID = conversationID;
    }When I marshalled SimpleNegotiationManager while the HashMap was filled with several <String,SimpleInitiatedConversation> entries, in the output were empty tags initiatedConversations:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <simpleNegotiationManager>
      <initiatedConversations>
      </initiatedConversations>
    </simpleNegotiationManager>When I used schemagen to generate a schema, it produced:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:complexType name="simpleInitiatedConversation">
        <xs:sequence>
          <xs:element name="messages" type="xs:string" maxOccurs="unbounded" minOccurs="0"/>
          <xs:element name="conversationID" type="xs:string" minOccurs="0"/>
          <xs:element name="protocolState" type="xs:int"/>
        </xs:sequence>
      </xs:complexType>
      <xs:element name="simpleNegotiationManager" type="simpleNegotiationManager"/>
      <xs:complexType name="simpleNegotiationManager">
        <xs:sequence>
          <xs:element name="initiatedConversations" type="hashMap" minOccurs="0"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="hashMap">
        <xs:complexContent>
          <xs:extension base="abstractMap">
            <xs:sequence/>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:complexType name="abstractMap" abstract="true"/>
    </xs:schema>Particularly the description of HashMap seems ill - there is not specified that the HashMap has keys String and values SimpleInitiatedConversation.
    Unfortunatelly, the j2s-xmlAdapter-field example available with JAXB 2.0 is more complicated than I need. I just need to store/load HashMap into/from XML and I do not care what it looks like. Is it possible to avoid extending XmlJavaTypeAdaptor for a simple storing a HashMap into XML? Perhaps I use improper annotations in the source code, but I cannot get it working. Any clue?

    Ok i figured out one way of doing this by using some classes from JAXP...
    SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema s = null;
    try{
        s = sf.newSchema(new File("Sources/schema/test.xsd"));                    
    }catch(Exception e){
        System.err.println("Exception e: " + e.getMessage());
    marshaller.setSchema(s);
    //MyValidationHandler class implements the ValidationEventHandler interface
    MyValidationHandler gv = new MyValidationHandler();
    marshaller.setEventHandler(gv);If anyone has something to add let me know!!

  • Remove XML element with JAXB

    Hi all,
    does anyone knows if it's possible to remove an xml element after that element has been set ? Using only jaxb if possible and not using other technology, for example DOM.
    I explain:
    umarshall car -->setOwner("me"); setSpeed("80"); -->marshall car
    will result into:
    <car>
    <owner>me</owner>
    <speed>80</speed>
    </car>
    I would like something that for example
    unmarshall car -->remove(speed); ....-->marshall car
    would result into:
    <car>
    <owner>me</owner>
    </car>
    could someone point out a way to do that ?
    thanks in advance...

    Okay, after peering over your code and trying a few things out I see one immediate problem and one possible improvement.
    The problem lies in this:
    1. if condition is true, remove item
    2. check recursively
    The problem is .. if an item is removed, the following recursive check will always fail. However, the entire loop is wrapped into a try..catch, so InDesign will not alert you that it failed. Instead, it will continue with what's after the loop, exactly because the try..catch is around the entire loop!
    Change the loop code to this
    if((elm.xmlElements[i].markupTag.name == "http") && (elm.xmlElements[i].parent.markupTag.name == "extlink"))
        var Store_CitAttri = elm.xmlElements[i].xmlAttributes.item("c_style").value;
        if(Store_CitAttri == "URL")
          elm.xmlElements[i].remove();
           foundtext = foundtext + 1;
           continue;
    Query_Remove(elm.xmlElements[i]);
    so the recursive checking is skipped. You can also remove the entire try..catch block, as this may hide additional errors ...
    The improvement is: as I started reading this thread from the top again, shouldn't you be removing the "extlink" items, rather than just the "http" ones inside?
    If so, remove the parent of the found item (which is always the "extlink"):
          elm.xmlElements[i].parent.remove();
    -- and, as this will break the loop (because you just removed the set of elements it was working in!), replace 'continue' with 'return'.
    Hope this helps

  • Text put into a canvas element with context.fillText() always has a black box where each letter goes. If the text is black you just see the black rectangle. If the text is not black you see it on the black bounding box. Surely this is not right.

    This has happened on the last few versions of firefox, as long as canvas has been supported. I see other people's screen shots from canvas tutorials, and the text always looks normal. On my system, any text put into a canvas element via context.fillText() will have a black bounding box for each letter, sized appropriately for the letter. If the text is black, of course you only see rectangles. If the text is a contrasting color, then you can read it, but it looks bizarre.

    Thomas...same kind of crap here.
    I used Custom Text - entered a sentence, hit return, entered another.
    Set to 72 pt.
    The default alignment is centred - I want left aligned text...the text start point stays at the centre of frame and the sentence runs off the edge of the bounding box.
    There is no settings in the Text or Title inspector dialog to correct that!
    Using Transform will not sort it!

  • First two messages retireved by FND_MESSAGE.GET are always empty.

    Hi All,
    I'm using the FND_MESSAGE APIs for Error Handling in the following way:
    * Clearing the message stack of all messages by calling FND_MESSAGE.CLEAR
    * Setting up messages by calling FND_MESSAGE.SET_NAME and FND_MESSAGE.SET_TOKEN.
    * Getting all messages in the stack (since last Clear) by calling FND_MESSAGE.GET
    Result: The first two times calling FND_MESSAGE.GET, the resulting messages are empty. Only on the third call of FND_MESSAGE.GET I get back the desired message.
    Furthermore, the messages are only cleared when calling FND_MESSAGE.GET - but not when calling FND_MESSAGE.CLEAR...
    Best Regards,
    Carolin
    Edited by: 788963 on 05.10.2010 08:58
    Edited by: 788963 on 06.10.2010 02:33

    Hi All,
    I'm using the FND_MESSAGE APIs for Error Handling in the following way:
    * Clearing the message stack of all messages by calling FND_MESSAGE.CLEAR
    * Setting up messages by calling FND_MESSAGE.SET_NAME and FND_MESSAGE.SET_TOKEN.
    * Getting all messages in the stack (since last Clear) by calling FND_MESSAGE.GET
    Result: The first two times calling FND_MESSAGE.GET, the resulting messages are empty. Only on the third call of FND_MESSAGE.GET I get back the desired message.
    Furthermore, the messages are only cleared when calling FND_MESSAGE.GET - but not when calling FND_MESSAGE.CLEAR...
    Best Regards,
    Carolin
    Edited by: 788963 on 05.10.2010 08:58
    Edited by: 788963 on 06.10.2010 02:33

  • BTE 503113 - FIS_VBREVK_1&FIS_VBREVK_2 always empty

    Hi,
    Did anyone worked with BTE 503113?
    It seems  FIS_VBREVK_1&FIS_VBREVK_2 are always empty.
    It's called within FORM MAINTAIN_RR_STATUS (include LVFRRF0M), like this, so with dummy parameters:
    perform maintain_rr_status using pis_xvbak
                                     pis_xvbap
                                     gcf_dummy_ctrl
                                     gcf_dummy_ctrl
                                     gvt_xvbreve-rrsta.
    One exception in LVFRRF0M, however during my debugging session that part was not executed
    Any idea?
    Thanks in advance,
    Peter

    Hello,
    i would not get the OutputStream by calling the Method "OutputStream os = myBlob.setBinaryStream(0);".
    I use the Method "blobDest.getBinaryOutputStream();"
    Unfortunately, it's not possible to use the abstract JDBC driver interface to set a BLOB (unlimited size) into a oracle database, or rather i don't how to do it...
    Here is the code which i use to insert a inputstream to a blob. Please note: In this example a string-type is used for the ID. This might be adapted in your solution....
    public static void setBlob(Connection connection, InputStream inputStream, String tableName,
    String columnName, String recordID) throws SQLException, IOException
    Statement statement = connection.createStatement();
    ResultSet resultSet = statement.executeQuery("SELECT ID, "+columnName+" FROM "+tableName+" WHERE ID='"+recordID+"' FOR UPDATE");
    resultSet.next();
    oracle.sql.BLOB blobDest = (oracle.sql.BLOB) ((OracleResultSet) resultSet).getBlob(2);
    byte[] buffer = new byte[ blobDest.getBufferSize() ];
    OutputStream outputStream = blobDest.getBinaryOutputStream();
    int length = -1;
    while ((length = inputStream.read(buffer)) != -1) {
    outputStream.write(buffer,0,length);
    outputStream.flush();
    statement.close();
    outputStream.close();
    inputStream.close();
    resultSet.close();
    Hope it's help
    best regards
    sschoenig

  • Mapping of any element in BPEL

    Hello Experts,
    Need some help on this.I am unable to understand how to map <any> element with the <any> element.In my xsd i have a input element with any any an Output element with any i am unable to map.While mapping it pops up the message as "cannot map any to anyAttribute from source" Enter xpath-expression manually.Plz help
    Thanks in Advance
    Edited by: Irfan Shaikh on Feb 8, 2013 2:10 PM
    Edited by: Irfan Shaikh on Feb 8, 2013 2:25 PM

    Just open the source view and Enter xpath-expression manually as the message suggests...

  • Bookmarks are always displayed and we don't want them.

    When I open any pdf file, bookmarks are always displayed. I do not use bookmarks, and would like to turn that feature off.  How do I disable them from opening automatically when I open a document?

    (This may or may not work) I found it in anothert thread.
    SOLUTION for hiding navigation panel in Adobe:
    1. When the navigation panel is opened, left-click and drag each individual icon to the right so that you pull it off the navigation panel and they each become bigger floating pop-up windows.
    2. Now continue doing this for all icons until the navigation panel is entirely gray.
    3. Click on the "X" in the upper right hand side until you close all those pop-up windows.
    4. Right click on the navigation panel gray area and click "hide".
    5. Now that navigation panel will be gone whenever you open up Adobe.
    I've found in both Windows and Mac  that if I close the panel and then close Reader, it doesn't open again.

  • After downloading a file, the downloads window pops up, but is always empty. the downloaded files are not visible.

    After downloading a file, the Downloads window pops up but it is always empty. The files downloaded are not visible on this window. In order to access them, they must be sought out via windows explorer. Any ideas? Thanks.

    Be sure Options > Privacy > "Remember download history" is checked.
    *[https://support.mozilla.com/en-US/kb/Options%20window%20-%20Privacy%20panel Options window-Privacy panel]
    If you want to retain download history, do not clear Download History when using Clear Recent History or "Clear history when Firefox closes" > Settings
    *[https://support.mozilla.com/en-US/kb/Clear%20Recent%20History Clear Recent History]
    *Clear history when Firefox closes: [https://support.mozilla.com/en-US/kb/Options%20window%20-%20Privacy%20panel Options window-Privacy panel]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • HELP I have lost all my motion 4 content from all the files, ive looked in all the files and they are all empty. can i get replacement content as I my dvds where stolen along. with my other laptop.

    HELP I have lost all my motion 4 content from all the files, ive looked in all the files and they are all empty. can i get replacement content as I my dvds where stolen along. with my other laptop. any Ideas. would be a great help. For Motion 4.

    Try a hard reset:- hold the home button AND the power switch - ignore the red "Slide to power off" and wait ubntil the iPhone powers down, and then restarts - at the Apple logo, release all the buttons and see if your contacts reappear.

  • JAXB unmarshalling elements with xs:type explicitly set

    I am working with XML content where the XSD defines an element as being of a complexType (say "ParentType") but the content explicitly sets the element's xs:type attribute to an extension of that complexType (say "ChildType").
    As far as I can tell the XML is valid, but JAXB issues the following when unmarshalling:
    DefaultValidationEventHandler: [ERROR]: Unexpected element {}:child1
    javax.xml.bind.UnmarshalException: Unexpected element {}:child1
    Where <child1> is added via the extension.
    Is this a problem with JAXB or my XSD?
    (XSD and XML enclosed below)
    XSD ------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:complexType name="ParentType">
    <xs:sequence>
    <xs:element name="parent1" type="xs:string"/>
    <xs:element name="parent2" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ChildType">
    <xs:complexContent>
    <xs:extension base="ParentType">
    <xs:sequence>
    <xs:element name="child1" type="xs:string"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:element name="root">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="child" type="ParentType"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    XML -----------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="problem.xsd">
    <child xsi:type="ChildType">
    <parent1/>
    <parent2/>
    <child1/>
    </child>
    </root>

    JAXB doesn't handle OO schema design. I tried to do something similar where I defined a type called base and then defined that my document contained 1 or more base elements. Then I tried to unmarshall a document that contained elements that were of types extending from base. I ended up with the same issue.
    It seems that when the xjc compiler defines the classes it isn't smart enough to realize the element defined as parent could also contain a child element since child extends parent. Your XSD and XML are valid.
    I would think that JAXB should identify that because there is a type the extends the defined type, that an element of the sub-type might be subsituted i.e. check the actual type of the element in the XML before attempting to unmarshall it as the default type. It doesn't do that. I am not sure if this is as desinged, or a flaw in the implementation.

  • XML (un)marshalling with JAXB and "any" blocks

    I have 2 very simple XSD schema's.
    SchemaA.xsd:
    [request]-------[element_A] is xs:string
    |__(ANY)
    SchemaB.xsd:
    [body]--------[element_B] is xs:string
    The any block says that there can follow any type of xml after the element_a.
    In the xsd it is coded as: <xs:any />
    I compiled both schema's with jaxb, using this command line:
    xjc SchemaA.xsd -p test.request
    xjc SchemaB.xsd -p test.body -use-runtime test.request.impl.runtime
    I created the following code :
    test.request.ObjectFactory of1 = new test.request.ObjectFactory();
    test.body.ObjectFactory of2 = new test.body.ObjectFactory();
    Request r = of1.createRequest();
    r.setElementA("testing, element one");
    Body b = of2.createBody();
    b.setElementB("testing, element two");
    r.setAny(b);
    Marshaller m = of1.createMarshaller();
    m.marshal(r,System.out);
    And the result is what I expected:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <request><element_a>testing, element one</element_a><body><element_b>testing, element two</element_b></body></request>
    JAXB added the xml from the second schema to the first.
    Ok, so far so good. Now I'm trying to do it the other way around, I want to unmarshall that XML to objects again:
    String xml <- contains the outputted xml from the marshall (as pasted a few lines above)
    Unmarshaller um = of1.createUnmarshaller();
    Request r2 = (Request)um.unmarshal(new ByteArrayInputStream(xml.getBytes()));
    System.err.println(r2.getElementA());
    System.err.println(r2.getAny());
    The output:
    testing, element one
    null
    now, the first message is good. The second is not however...why is the "getAny" null ? I can't figure this one out. In the best possible case it should return an object that can be cast to "Body" .
    In the worst case it should just return the "<Body> ...." xml as string. But not null ...
    Any help on this is appreciated !

    JAXB does not support xs:any

  • Jaxb and xs:any element binding  (REPOSTING)

    My schema has an element whose content is not known at schema design time so, my XML may look like:
    <client-submission>
    <aaa>
    <bbb/>
    </aaa>
    </client-submission>
    Or it may look like:
    <client-submission>
    <xxx>
    <yyy>
    <zzz/>
    </yyy>
    </xxx>
    </client-submission>
    This cab be implemented in xml schema with <any> element:
    <any
    id =
    maxOccurs =
    minOccurs =
    namespace =
    processContents = >
    </any>
    BUT IN JAXB, HOW CAN I insert that unknown xml tree as content of <client-submission>, to get proper XML when marshalling??
    Thanx.

    hi JAXB specification does not support full W3C schema
    support in version 1.0.
    u cant do "any"

  • I have a 19 digit Adobe Photoshop Elements 12 Serial number.  It should be 24.  Any help with this?

    I have a 19 digit Adobe Photoshop Elements 12 Serial number.  It should be 24.  Any help with this?

    Where are you looking for the serial number?
    If you have the disks, the number commencing 1057 is usually inside the packaging. It’s necessary to pull out the white inner box.
    If you purchased this some while ago and the product, the serial number should be in your Adobe account. Click on the red Adobe logo (top left on this web page) sign-in with your Adobe ID (email & password) and choose Manage Account. You should be able to browse your purchase history and registered products.

Maybe you are looking for