assertTrue( "isProviderAvailable 7",
!WSIFPluggableProviders.isProviderAvailable(
"http://schemas.xmlsoap.org/wsdl/xxx/") );
// test the default SOAP provider
WSIFProvider p1 = WSIFPluggableProviders.getProvider(
"http://schemas.xmlsoap.org/wsdl/soap/" );
Class c1 = p1.getClass();
assertTrue( "defaultprovider 0", DEFAULT_SOAP_PROVIDER.equals( c1 ) );
// test changing the default provider
WSIFProvider p = null;
try {
p = (WSIFProvider)NON_DEFAULT_SOAP_PROVIDER.newInstance();
} catch (Exception ex) {
assertTrue( "exception instantiating non default provider: " + ex.getMessage(), false );
}
WSIFPluggableProviders.overrideDefaultProvider(
"http://schemas.xmlsoap.org/wsdl/soap/",
p );
WSIFProvider p2 = WSIFPluggableProviders.getProvider(
"http://schemas.xmlsoap.org/wsdl/soap/" );
Class c2 = p2.getClass();
assertTrue( "defaultprovider 1", NON_DEFAULT_SOAP_PROVIDER.equals( c2 ) );
WSIFPluggableProviders.overrideDefaultProvider(
"http://schemas.xmlsoap.org/wsdl/soap/",
null );
WSIFProvider p3 = WSIFPluggableProviders.getProvider(
"http://schemas.xmlsoap.org/wsdl/soap/" );
Class c3 = p3.getClass();
assertTrue( "defaultprovider 2", c1.equals( c3 ) );
assertTrue( "defaultprovider 3", p1 == p3 );
WSIFPluggableProviders.overrideDefaultProvider(
"http://schemas.xmlsoap.org/wsdl/soap/",