ich habe folgendes problem:
ich lese ein objekt aus einem ldap verzeichnis, wandle es in in einen dsml string um und will daraus xml document machen mit folgendem code:
Code
batchReqStr = "<dsml:batchRequest dsml:requestID=\"TestBatchRequest\" xmlns:dsml=\"urn:oasis:names:tc:DSML:2:0:core\"><dsml:modifyRequest dsml:dn=\"gvGid=9a1fd62c0281474f83504905f7ec3617,ou=people,gvOuId=AT:b:450,dc=gv,dc=at\" dsml:requestID=\"\"><dsml:modification dsml:name=\"gvGid\" dsml:operation=\"replace\"><dsml:value>9a1fd62c0281474f83504905f7ec3617</dsml:value></dsml:modification></dsml:modifyRequest></dsml:batchRequest>";
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
final Document document = builder.newDocument();
Document doc = builder.parse(new InputSource(new StringReader(batchReqStr)));
leider wirft die letzte anweisung folgende exception:
Code
org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
at com.sun.org.apache.xerces.internal.dom.ElementNSImpl.setName(ElementNSImpl.java:176)
at com.sun.org.apache.xerces.internal.dom.ElementNSImpl.<init>(ElementNSImpl.java:112)
at com.sun.xml.messaging.saaj.soap.impl.ElementImpl.<init>(ElementImpl.java:60)
at com.sun.xml.messaging.saaj.soap.impl.ElementFactory.createElement(ElementFactory.java:54)
at com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.createElement(SOAPDocumentImpl.java:81)
at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1485)
at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1688)
at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1444)
at com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.importNode(SOAPDocumentImpl.java:128)
at com.sun.xml.messaging.saaj.soap.impl.BodyImpl.addDocument(BodyImpl.java:175)
at at.lfrz.LDAPSchemaTest.createSOAPMessage(LDAPSchemaTest.java:420)
at at.lfrz.LDAPSchemaTest.doSearchTest(LDAPSchemaTest.java:307)
at at.lfrz.LDAPSchemaTest.main(LDAPSchemaTest.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Alles anzeigen