@Test
public void testAddMessages() throws Exception {

	String definitionNamespace = "http://springframework.org/spring-ws";
	definition.addNamespace("tns", definitionNamespace);
	definition.setTargetNamespace(definitionNamespace);
	String schemaNamespace = "http://www.springframework.org/spring-ws/schema";
	definition.addNamespace("schema", schemaNamespace);
	Resource resource = new ClassPathResource("schema.xsd", getClass());
	Document schemaDocument = documentBuilder.parse(SaxUtils.createInputSource(resource));
	Types types = definition.createTypes();
	definition.setTypes(types);
	Schema schema = (Schema) definition.getExtensionRegistry().createExtension(Types.class,
			new QName("http://www.w3.org/2001/XMLSchema", "schema"));
	types.addExtensibilityElement(schema);
	schema.setElement(schemaDocument.getDocumentElement());
	provider.addMessages(definition);
	Assert.assertEquals("Invalid amount of messages created", 3, definition.getMessages().size());
	Message message = definition.getMessage(new QName(definitionNamespace, "GetOrderRequest"));
	Assert.assertNotNull("Message not created", message);
	Part part = message.getPart("GetOrderRequest");
	Assert.assertNotNull("Part not created", part);
	Assert.assertEquals("Invalid element on part", new QName(schemaNamespace, "GetOrderRequest"),
			part.getElementName());
	message = definition.getMessage(new QName(definitionNamespace, "GetOrderResponse"));
	Assert.assertNotNull("Message not created", message);
	part = message.getPart("GetOrderResponse");
	Assert.assertNotNull("Part not created", part);
	Assert.assertEquals("Invalid element on part", new QName(schemaNamespace, "GetOrderResponse"),
			part.getElementName());
	message = definition.getMessage(new QName(definitionNamespace, "GetOrderFault"));
	Assert.assertNotNull("Message not created", message);
	part = message.getPart("GetOrderFault");
	Assert.assertNotNull("Part not created", part);
	Assert.assertEquals("Invalid element on part", new QName(schemaNamespace, "GetOrderFault"), part.getElementName());
}