Tuesday, September 22, 2009

Weblogic webservice hiding behind a network switch

The webservices are either deployed on weblogic server or as aqualogic(alsb) proxies. Services are deployed in weblogic cluster in test and prod environment. A network switch separates client and services for load balancing, fault tolerance and security purpose.
when client (jws using sun impl) makes request, it fetches wsdl which contains service url location (sometimes such wsdl is called concrete wsdl, as it has exact loc and protocol details). the client worked well in dev environment. But in test environment when we switched off node1 in the weblogic cluster, the service became unavailable. The issue was in case of java webservices wsdl url contains private IP of node1. so client makes specific call to node1.
there were two possible resolution.
a) on client side ask it go to vip rather than node1 to get to the service.
the code
----------
port = (TestServicePortType) service.getTestServiceSoapPort();
((BindingProvider)port).getRequestContext().put( BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "https://test.x.abc.xyz.us/TestService/TestService?WSDL");

b) option B web service server option - create weblogic deployment plan. Provide wsdl uri pretext should be switch entry url, followed by context.
https://test.x.abc.xyz.us/TestService/TestService?WSDL

but it always worked for alsb, reason being alsb wsld query contains machine name which switch is able to resolve rather than private IP address.