private Definition buildDefinition() throws WSDLException {
WSDLFactory factory = WSDLFactory.newInstance();
Definition definition = factory.newDefinition();
definition.setDocumentBaseURI("META-INF/wsdl/fake.wsdl");
ExtensionRegistry extensionRegistry = factory.newPopulatedExtensionRegistry();
BindingOperation bindingOperation = buildBindingOperation(definition, extensionRegistry);
Binding binding = definition.createBinding();
binding.setQName(new QName(NAMESPACE, "MockPortBinding"));
//add soap:binding
SOAPBinding soapBinding = (SOAPBinding) extensionRegistry.createExtension(Binding.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "binding"));
soapBinding.setTransportURI("http://schemas.xmlsoap.org/soap/http");
soapBinding.setStyle("rpc");
binding.addExtensibilityElement(soapBinding);
binding.addBindingOperation(bindingOperation);
PortType portType = definition.createPortType();
portType.setQName(new QName(NAMESPACE, "MockPort"));
portType.addOperation(bindingOperation.getOperation());
binding.setPortType(portType);
Port port = definition.createPort();
port.setName("MockPort");
//add soap:address
SOAPAddress soapAddress = (SOAPAddress) extensionRegistry.createExtension(Port.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "address"));