@Test
public void testToNameNamespace() throws Exception {
SOAPMessage message = messageFactory.createMessage();
QName qName = new QName("namespace", "localPart");
SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
envelope.addNamespaceDeclaration("prefix", "namespace");
Name name = SaajUtils.toName(qName, envelope);
Assert.assertNotNull("Invalid name", name);
Assert.assertEquals("Invalid namespace", qName.getNamespaceURI(), name.getURI());
Assert.assertEquals("Invalid local part", qName.getLocalPart(), name.getLocalName());
Assert.assertEquals("Invalid prefix", "prefix", name.getPrefix());