XML-Deserialize with JAXB

Hello!
I'm new to JAXB so maybe my question is a newbie question.
Why can I deserialize the following XML:
<ns3:vida xmlns:ns3="http://cpsnet.de/dms/schnittstellen/volvo/vida_dms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</ns3:vida> but I can't deserialize this one:
<vida xmlns="http://cpsnet.de/dms/schnittstellen/volvo/vida_dms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</vida>As far as I understand XML right now, they are both the same. Aren't they?
The Unmarshaller returns the Object for the first XML - but returns null on the second one...

Well... once again this was a ClassLoader problem... solved!

Similar Messages

  • Unmarshalling a DOM node to an XML file with JAXB

    I'm trying to unmarshall a DOM node to an XML file using JAXB. However I keep receiving a NullPointerException. This only seems to occur when I create the DOM Node from scratch. The stack trace looks like the following:
    java.lang.NullPointerException
            at com.sun.xml.bind.unmarshaller.SAXUnmarshallerHandlerImpl.startElement
    (SAXUnmarshallerHandlerImpl.java:87)
            at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:109)
            at com.sun.xml.bind.unmarshaller.DOMScanner.parse(DOMScanner.java:64)
            at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.unmarshal(Unmarshaller
    Impl.java:149)
            at Main.main(Main.java:103)(If I unmarshal an XML file into a DOM node, I can successfully marshall the DOM node out to a new XML file using JAXB without error.)
    Any insight into what I am doing wrong would be greatly appreciated!
    Sample code and XSD follow...
    Sample Code:
    import itemlistsample.*;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Iterator;
    import java.util.List;
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.JAXBException;
    import javax.xml.bind.Marshaller;
    import javax.xml.bind.Unmarshaller;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Node;
    import org.w3c.dom.Text;
    public class Main
      public static void main(String[] args)
          try
              JAXBContext jc = JAXBContext.newInstance( "itemlistsample" );
              Unmarshaller u = jc.createUnmarshaller();
              * Set up DOM Node Document Object.
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              dbf.setNamespaceAware(true);                   
              DocumentBuilder db = dbf.newDocumentBuilder(); 
              Document doc = db.newDocument();
              System.out.println();
              System.out.println();
              System.out.println("Create a DOM Node and unmarshall to an XML file");
              * Generate elements within DOM document
              Element itemListElt = (Element)doc.createElement("item_list");
              Element itemInfo = (Element)doc.createElement("item_info");
              Element name = (Element)doc.createElement("name");
              Element price = (Element)doc.createElement("price");
              * 3-Ring Binder @ 4.99
              name.appendChild(doc.createTextNode("3-Ring Binder"));
              itemInfo.appendChild(name);
              price.appendChild(doc.createTextNode("4.99"));
              itemInfo.appendChild(price);
              itemListElt.appendChild(itemInfo);
              * Large Paper Clips @ 1.23
              itemInfo = (Element)doc.createElement("item_info");
              name = (Element)doc.createElement("name");
              price = (Element)doc.createElement("price");
              name.appendChild(doc.createTextNode("Large Paper Clips"));
              itemInfo.appendChild(name);
              price.appendChild(doc.createTextNode("1.23"));
              itemInfo.appendChild(price);
              itemListElt.appendChild(itemInfo);
              doc.appendChild(itemListElt);
              * Display DOM document as a sanity check
              itemListElt = doc.getDocumentElement();
              System.out.println(itemListElt.getTagName());
              NodeList nl = itemListElt.getElementsByTagName("item_info");
              traverse("  ", nl.item(0));
              * Use JAXB to unmarshal the DOM document into
              * an instance of the generated JAXB class for
              * the root element.  Stack trace occurs here!
              ItemListType il = (ItemListType)u.unmarshal(doc);
              * Marshal to an XML file
              Marshaller m = jc.createMarshaller();
              m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
              m.marshal( il, new FileOutputStream("item_new.xml") );
          catch (Exception e)
         e.printStackTrace();
      public static void traverse(String indent, Node n)
        if (n != null)
          if (n.getNodeName() != null)
            System.out.println(indent + n.getNodeName());
            traverse(indent + "  ", n.getFirstChild());
          if (n.getNodeValue() != null)
            System.out.println(indent + n.getNodeValue());
          traverse(indent, n.getNextSibling());
    }Sample XSD:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <xsd:element name="item_list" type="ItemListType"/>
         <xsd:complexType name="ItemListType">
              <xsd:sequence>
                   <xsd:element name="item_info" type="ItemInfoType" maxOccurs="unbounded"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="ItemInfoType">
              <xsd:sequence>
                   <xsd:element name="name" type="xsd:string"/>
                   <xsd:element name="price" type="xsd:double"/>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:schema>

    Modified schema
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="item_list">     
    <xsd:complexType>          
    <xsd:sequence>               
    <xsd:element ref="item_info" maxOccurs="unbounded"/>     
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="item_info">
         <xsd:complexType>          
    <xsd:sequence>               
    <xsd:element name="name" type="xsd:string"/>     
         <xsd:element name="price" type="xsd:double"/>     
         </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

  • 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

  • How to marshal XML fragments with JAXB

    Hello,
    I have Object unashamed from XML. I would like to insert part of this object in another XML document. I�m using Cocoon Transformer for this. In startElement then I detect element which I would like replace I would like to write something like this:
    Marshaller m = jc.createMarshaller();
    m.marshal(myElem, contentHandler);
    However this method try to marshal it as whole document with: <?xml version="1.0" encoding="UTF-8" ?> This probably case problems for next Transformer.
    I have this problem in Cocoon and with SAX, but there should be some general solution to marshal JAXB objects as XML fragments, not whole documents. However I can�t found it.
    Thanks for any help
    Arek Stryjski

    In JAXB mailing list I got this answer:
    It currently doesn't have any explicit support for fragment marshalling,
    but like you said, you can easily write an XMLFilter that blocks
    start|endDocument. In your case, you just need to:
    Marshaller m = jc.createMarshaller();
    m.marshal(myElem, new FragmentFilter(contentHandler));
    where FragmentFilter is:
    class FragmentFilter extends XMLFilterImpl {
    FragmentFilter( ContentHandler handler ) {
    setContentHandler(handler);
    public void startDocument() {}
    public void endDocument() {}
    Perhaps this could be another example.
    regards,
    Kohsuke KAWAGUCHI

  • Unmarshal SOAP response, as raw XML String with JAXB

    Hi,
    I have a soap response, as raw xml (a java.lang.String), and I want to unmarshal it's content into the classes generated by wsimport.
    This must be a simple task but I couldn't find a way to do it.
    Can someone tell me how I can achieve this ?
    Edited by: Raphael_Lemaire on May 25, 2010 8:30 AM

    Raphael_Lemaire wrote:
    Yes it works this way.
    I kind of hoped that i could use a jax-ws api to shorten the code.well, how exactly do you get that string full of xml? (as a side note, you need to be careful turning xml into strings, the data can easily broken if you don't translate the bytes into characters correctly). if you use the jaxws api to make soap calls, then you don't really need to deal with the xml at all.
    Edited by: jtahlborn on May 26, 2010 7:38 AM

  • Unmarshaling XML file with JAXB from JAR doesn't work?

    Hi
    I'm pretty new to JAXB... I'm unmarshaling an XML file, and everything works fine in my JUnit test, using XML files. However, the caller of my unmarshalling is a Web Start application using signed JARs.
    When I try to access the XML file, I log the URL and get an exception:
    INFO[slf5s.PRIORITY] javawsApplicationMain[slf5s.THREAD] ch.ige.main.client.menu.MenuBuilder[slf5s.CATEGORY] Creating menu from URL jar:file:C:/Program%20Files/JRE/1.4.2/cache/http/...Main.jar!/res/JippsAdminMenuBaum.xml[slf5s.MESSAGE]
    ERROR[slf5s.PRIORITY] javawsApplicationMain[slf5s.THREAD] ch.ige.main.client.MenuPane[slf5s.CATEGORY] exception caught[slf5s.MESSAGE]
    java.io.IOException: Couldn't unmarshal configuration from java.util.jar.JarVerifier$VerifierStream@15f1f9c: null
         at ch.ige.main.client.menu.MenuBuilder.unmarshalConfiguration(MenuBuilder.java:110)
         at ch.ige.main.client.menu.MenuBuilder.<init>(MenuBuilder.java:86)
         at ch.ige.main.client.MenuPane.createMenuBuilder(MenuPane.java:485)
         at ch.ige.main.client.MenuPane.createTreeLevel(MenuPane.java:460)
         at ch.ige.main.client.MenuPane.jbInit(MenuPane.java:316)
         at ch.ige.main.client.MenuPane.<init>(MenuPane.java:122)
         at ch.ige.jippsadmin.MepJipps.<init>(MepJipps.java:32)
         at ch.ige.jippsadmin.JippsMain.run(JippsMain.java:64)
         at ch.ige.auth.ClientAuthenticator.executePrivilegedCode(ClientAuthenticator.java:166)
         at ch.ige.authz.client.AuthMain.executePrivilegedCode(AuthMain.java:128)
         at ch.ige.authz.client.AuthMain.run(AuthMain.java:213)
         at ch.ige.jippsadmin.JippsMain.main(JippsMain.java:77)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)Btw, does anyone know where to find the runtime JARs that are required for JAXB (from JWSDP 1.5)?
    Thanks & best regards,
    Eric

    Well... once again this was a ClassLoader problem... solved!

  • Error while generating an XML Document from XML Schema with JAXB

    Hi,
    I am following this OTN tutorial to generate the XML document from Java classes got from the XSD document.
    http://www.oracle.com/technology/pub/notes/technote_jaxb.html
    I am able to generate all the Java classes but getting error on compiling the XMLConstructor.java class which is use for generating the XML document :
    I am using JDK 1.5 and
    Oracle 10g XML Developer's Kit (XDK) Production for Java. xdk_nt_10_1_0_2_0_production
    (though these are warnings I am not able to run it.)
    Error
    C:\Prototype\classes\jaxbderived\catalog>javac -Xlint XMLConstructor.java
    warning: [path] bad path element "%CLASSPATH%": no such file or directory
    XMLConstructor.java:42: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
    journalList.add(journal);
    ^
    XMLConstructor.java:46: warning: [unchecked] unchecked call to add(E) as a membe
    r of the raw type java.util.List
    articleList.add(article);
    Thanks
    Sanjeev ([email protected])

    Use JDK 1.4.

  • Parsing (skipping) unknown tags with JAXB...

    Does anybody know how can I skip unrecognised tags, during unmarshalling an XML document with JAXB?
    For example : the schema-compliant document is :
    <document>
    <Version>3.20</Version>
    <Account>Account</Account>
    <Password>Password</Password>
    </document>
    and a possible modification would be :
    <document>
    <Version>3.21</Version>
    <unknowntag>aaaabbbb</unknowntag>
    <Account>Account</Account>
    <Password>Password</Password>
    </document>
    (a new unknown tag was introduced).
    so : the document is well-formed anyway (not strictly valid), but the second time a new unknown tag was introduced. I couldn't map it to a Java object (of course, because my data model could not foresee it), but I would like JAXB to skip it and have the program flow behaving exactly as the first case... ignoring this new unknown tag.
    Thanks for any answer anybody could ever give me...
    Emilio.

    Finally I found a workaround to this problem :
    I used an XSL transformation from the incoming document into itself, according to the pattern matching provided by an xsl stylesheet, before giving it to JAXB. Definitely an XSL specular preprocessor (wow! sound cool!).
    That is :
    having an incoming XML document, I write an XSL stylesheet that transforms the original XML document into another XML having the same tags (that is... itself).
    In this way, I can then give to JAXB a resulting XML document that contains ONLY those tags that I was expecting it to elaborate, since all the others (the unknown ones) were discarded by the xsl preprocessor.
    And... that's it.
    In this way I finally wrote an application able to skip unrecognized tags and elaborating by JAXB only the know ones. And that's what I was looking for :-)
    Hope it could help you.
    Bye,
    emils.

  • Compare 2 XML Docs using JAXB

    Hello List,
    I use JAXB for parsing and generating XML docs. It works well after some time to learn to use it.
    But now I want compare 2 xml docs.
    I think the equal function is the right way, but I can't find any implementation from this function in the generated classes.
    Do I look right? Is it possible to compare xml docs with JAXB?
    Any other hints.
    regards Dietmar

    Earlier this year, I needed such a tool and finally wrote one after not being able to find one. It was a lot of work. It compared two DOM documents.
    In our case, we were testing a new server implementation to create XML result files from requests from our client. I connected to a new server and an old server and sent the identical input to both. I then validated the two results using DTD's (which is all we had) and then did a brute force comparison of the two Document objects.
    To make things more difficult, there were some known differences. The new version returned a few new tags and attributes in certain cases. I had to avoid using these as a reason to declare a mismatch. Also, there were timestamps and URLs returned in the files I was processing, so I had to ignore these tags as well.
    Another thing to consider is that attributes do not have to be presented in any sequence, so I had to compare in a non-order-specific way. I built two HashMaps, and first looked up each old attribute in the HashMap for new attributes. If I found a match, I removed this attribute from BOTH HashMaps, when I got to the end, anything lef t over in either HashMap was an orphan.
    It was a lot of work, and my solution is probably not usable outside of its environment, and I don't have permission to release the source anyway.
    Dave Patterson

  • Problem with XML Deserialization Error

    Hi! when I test my webservice, I take the following error: Deserializing fails. Nested message: XML Deserialization Error. Result class com.sap.gram.SelRec.SelRec_CompGenModel does not have property of type java.lang.String. It is required to load XML..
    I don´t understand why occur this!! CiEntId is a string with the property of a primaryKey
    What can I do??
    Thanks
    Rose

    Hi Rosa,
    I've got the same error message, but in another scenario. I'm testing a XI Web Service, with a defined WSDL. To test it I'm using WS Navigator (http://host:port/wsnavigator/enterwsdl.html). Although all the types I'm returning are on the WSLD definition, the dumb WS Navigator fires the "XML Deserialization Error", and says that a type is not defined in the wsdl (but the type is there, and other test tools are working fine with it!).
    roberti

  • 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

  • Web services with JAXB

    Hi All,
    I am new to Web services with JAXB in ECLIPS.
    When I tried to unmarshal the XML file, I am getting the following exception.
    javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"order"). Expected elements are <{http://webservices/}read>,<{http://webservices/}readResponse>
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent
    xml , schema and java class are in follow.
    Please help me to solve this issue.
    Mohseni Rad.
    ----------------------------------po.xsd-----------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="order" type="OrderType"/>
    <xsd:complexType name="OrderType">
    <xsd:sequence>
    <xsd:element name="shipTo" type="xsd:string"/>
    <xsd:element name="billTo" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    ------------------------------------po.xml----------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <order>
    <shipTo>shipto</shipTo>
    <billTo>billto</billTo>
    </order>
    ------------------TestWS.java---------------------
    import java.io.FileInputStream;
    import java.io.IOException;
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.JAXBElement;
    import javax.xml.bind.JAXBException;
    import javax.xml.bind.Unmarshaller;
    import wsclient.*;
    public class TestWs {
         public static void main(String[] args) {
              try{
                   SecondWebServices webService = new SecondWebServicesService
    .getSecondWebServicesPort();
                   JAXBContext jctx = JAXBContext.newInstance("wsclient");
                   Unmarshaller unmarshaller = jctx.createUnmarshaller();
                   FileInputStream fl = new FileInputStream( "etc//po.xml" );
         JAXBElement<?> order = (JAXBElement<?>)unmarshaller.unmarshal( fl );
                   OrderType orderType = (OrderType)order.getValue();
                   webService.read( orderType);
              }catch (JAXBException je) {
                   je.printStackTrace();
              catch (IOException ioe) {
                   ioe.printStackTrace();
    }

    Hi,
    When you are using JAX-WS, there is a tool wsimport, with which you are going to generate the artifacts required to implement the web service.
    When you pass the WSDL as a parameter to the wsimport tool, it will be create the required beans also(JAXB Objects).
    So need of any other external implementation of JAXB when you are working with JAXWS
    Thanks,

  • XML Deserialization Error

    Hi,
    I'm workin on a prototyp based on the netweaver developer studio preview. after i've steped to the several tutorial for webservices und webdynpro.
    I've implemented a ejb/webservice combination for selecting a insurance contract from our databases based on existing java-classes to use the webservice as a model in the webdynpro-app. So fare everything worked fine.
    Know I've made a little change and filled the contract with aditional information about the customer to this contract (i didn't modified the class if just filled e member of the contract which was null bevor). After deploying the webservice i got the following error message:
    Service call exception; nested exception is: com.sap.engine.services.werservices.jaxrpc.exceptions.XmlUnmarshalException: XML Deserialization Error. XML is not valid. Element [urn:de.deutscherring.base]<nummer> is required in <ns16:personVn> but can not be found.
    When i test the webservice i get the same error.
    I've searched a the classes which a direct or indirect owned by the Person-Object and found only on member named nummer but it's an int, which can't cause trouble with deserialization.
    Are anyone their wo can help me?
    Thanks in advance.
    Oliver

    Hi Oliver,
    Check what is the request and the response. Where does the deserialization fail - on the client or on the server side?
    <i>You can increase the severity of your web service location via the Visual Admin and Log Configurator Service to debug in order to log also the request and response messages (Location: com.sap.engine.services.webservices.runtime...)</i>
    If the response is fine, then maybe your WS Client Proxy needs to be regenerated in order to reflect your change.
    Otherwise, please create a CSN message.
    Best regards,
    Alexander

  • XmlUnmarshalException: XML Deserialization Error

    Hi, I have generated a Deployable WebService Proxy of a external WebService from the Provider ESRI (http://arcweb.esri.com/arcwebonline/index.htm) with SAP Dev Studio SP9 and deployed to the WAS 6.40 SP9.
    Within a Servlet i called first the WebService Authentication to get a Token which works fine and then the WebService AddressFinder.findAddress() to get the Datas but this Call throw a Exception
    ==> "Service call exception; nested exception is:
    com.sap.engine.services.webservices.jaxrpc.exceptions.XmlUnmarshalException: XML Deserialization Error. XML is not valid. Element []<errorCode> is required in <soap:Body> but can not be found."
    The required element <errorCode> descriped in the WDSL Definition is nillable="true" so not required!
    - <xsd:complexType name="LocationInfo">
    - <xsd:sequence>
      <xsd:element name="matchType" nillable="true" type="xsd:string" />
      <xsd:element name="candidates" nillable="true" type="ns12:ArrayOfLocation" />
      <xsd:element name="hasMore" type="xsd:boolean" />
      <b><xsd:element name="errorCode" nillable="true"</b> type="xsd:string" />
      </xsd:sequence>
      </xsd:complexType>
    I checked also the SOAP response on the J2EE which was ok:
    Message : HTTP/1.1 200 OK
    Server: Sun-ONE-Application-Server/7.0
    Date: Wed, 12 Jan 2005 10:11:31 GMT
    Content-length: 1534
    Content-type: text/xml; charset=UTF-8
    Optimizable: true
    Connection: close
    <?xml version='1.0' encoding='UTF-8'?>
    <soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns5='http://www.themindelectric.com/package/com.esri.is.services.common.v2/' xmlns:ns6='http://www.themindelectric.com/package/com.esri.is.services.common.v2.geom/'><soap:Body><n:findAddressResponse xmlns:n='http://arcweb.esri.com/v2'><Result href='#id0'></Result></n:findAddressResponse><id0 id='id0' soapenc:root='0' xsi:type='ns5:LocationInfo'><matchType xsi:type='xsd:string'>EXACT</matchType><candidates href='#id1'></candidates><hasMore xsi:type='xsd:boolean'>false</hasMore></id0><id1 id='id1' soapenc:root='0' xsi:type='soapenc:Array' soapenc:arrayType='ns5:Location[1]'><i href='#id2'></i></id1><id2 id='id2' soapenc:root='0' xsi:type='ns5:Location'><point href='#id3'></point><description1 xsi:type='xsd:string'>Ammann Strasse 2, 3074, Muri Bei Bern</description1><score xsi:type='xsd:double'>0.0</score><matchType xsi:type='xsd:string'>100</matchType></id2><id3 id='id3' soapenc:root='0' xsi:type='ns6:Point'><x xsi:type='xsd:double'>7.496564</x><y xsi:type='xsd:double'>46.926945</y><coordinateSystem href='#id4'></coordinateSystem></id3><id4 id='id4' soapenc:root='0' xsi:type='ns6:CoordinateSystem'><projection xsi:type='xsd:string'>4326</projection></id4></soap:Body></soap:Envelope>
    Is there anything wrong, has anybody a solution?
    Thanks Vince

    Hi Vilish,
    I have a Web Dynpro application that uses a Web Service model. The Web Service is located on a remote non-SAP server, and i generated proxies based on its WSDL.
    The error occurs at this procedure,
    someElementObj.modelObject.execute();
    This procedure is to send a request with parameters to a Web method, and then retrieving data from the response XML before storing the data in the model context. So, I suspect this happens during retrieving process.
    Thanks,
    Teecheu

  • XmlUnmarshalException: XML Deserialization Error Please Help!!!

    Hi All,
    I am consuming the standard webservice
    Name: /SAPAPO/SDM_PARCRTRC
    I am getting the following error on execution of the web service:
    Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.XmlUnmarshalException: XML Deserialization Error. XML is not valid. Element []<ScheduleLine> is required in <NameSpecification> but can not be found.
    Please help me with this problem.
    Thanks in Advance.

    Hi All,
    Thanks for your replies.
    They were helpful but this what I did that solved the problem
    I used the following code to set the required parameters
    item.getOriginalBean().setScheduleLine(new ScheduleLineInner[] {scheduleLine.getOriginalBean()});
    instead of
    item.addScheduleLine(scheduleLine);
    Similarly all the parameters were set using the orginalBean
    Now it is working perfectly fine....
    Thanks a lot..
    Setu

Maybe you are looking for