Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when importing DOM level 1 into SOAP Message #149

Open
jmongard opened this issue Mar 20, 2020 · 0 comments
Open

Crash when importing DOM level 1 into SOAP Message #149

jmongard opened this issue Mar 20, 2020 · 0 comments

Comments

@jmongard
Copy link

jmongard commented Mar 20, 2020

In saaj-impl version 1.5.x, When trying to import an element created with Document::createElement into a SOAP message it crashes with the exception:
java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName

This type of import worked fine in java 8 / saaj-impl 1.3.

public void testImportNodeIntoMessage() throws Exception {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
    dbf.setNamespaceAware(true);
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.newDocument();
   
    Element request = doc.createElementNS("http://example.com/", "request");
    
    //Adding a DOM level 1 element causes exception when importing
    request.appendChild(doc.createElement("DOMLevel1"));
    
    SOAPMessage msg = MessageFactoryImpl.newInstance().createMessage();        
	Node importNode = msg.getSOAPPart().importNode(request, true);		
	assertNotNull(msg.getSOAPBody().appendChild(importNode));   
}
@jmongard jmongard changed the title Crash when importing DOM levrvl 1 into SOAP Message Crash when importing DOM level 1 into SOAP Message Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant