public static void main(String[] args) {
junit.textui.TestRunner.run(SoapBindingFactoryTest.class);
}
public void testCreateClientBinding() throws Exception {
Bus bus = Bus.init(new String[0]);
BindingFactory factory =
bus.getBindingManager().getBindingFactory(
"http://schemas.xmlsoap.org/wsdl/soap/");
assertNotNull(factory);
URL url = getClass().getClassLoader().getResource(".");
URL wsdlUrl = new URL(url, "../classes-tests/wsdl/hello_world.wsdl");
assertNotNull(wsdlUrl);
QName serviceName = new QName("http://objectweb.org/hello_world_soap_http", "SOAPService");
EndpointReferenceType address = EndpointReferenceUtils
.getEndpointReference(wsdlUrl, serviceName, "SoapPort");
ClientBinding clientBinding = factory.createClientBinding(address);
assertNotNull(clientBinding);
assertTrue(SOAPClientBinding.class.isInstance(clientBinding));
SOAPClientBinding soapClientBinding = (SOAPClientBinding)clientBinding;
Binding b = soapClientBinding.getBinding();
assertNotNull(b);
assertTrue(SOAPBindingImpl.class.isInstance(b));
bus.shutdown(true);
}