MockHttpServletResponse response = new MockHttpServletResponse();
exporter.handleRequest(request, response);
InputSource source = new InputSource(new ByteArrayInputStream(response.getContentAsByteArray()));
WSDLFactory factory = WSDLFactory.newInstance();
WSDLReader reader = factory.newWSDLReader();
Definition definition = reader.readWSDL("", source);
Service service = definition.getService(new QName(namespace, name));
assertNotNull(service);
assertEquals(namespace, service.getQName().getNamespaceURI());
// The service name should be equal to th
assertEquals(name, service.getQName().getLocalPart());
Binding binding = definition.getBinding(new QName(namespace, "EchoServiceHttpBinding"));
assertNotNull(binding);
SOAPBinding soapBinding = (SOAPBinding) binding.getExtensibilityElements().get(0);
assertNotNull(soapBinding);
assertEquals(SoapConstants.STYLE_DOCUMENT, soapBinding.getStyle());
}