Kbase P121631: How to get XQEndpointConfig using SonicESB 7.0.1 ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
How to get XQEndpointConfig using SonicESB 7.0.1 ?
GOAL:
How to retrieve connection information of the endpoint a service uses through the XQInitContext ?
FACT(s) (Environment):
SonicESB 7.0.1
FIX:
Add the following code:
XQAddress entryEndpointAddress = (XQAddress) initialContext.getParameters().getParameterObject(XQConstants.SERVICE_PARAM_ENTRY_ENDPOINT_ADDRESS, XQConstants.PARAM_OBJECT);
XQEndpoint entryEp = (XQEndpoint)initialContext.getEndpointManager().getEndpoint(entryEndpointAddress.getName());
InitialContext iCtx = new InitialContext();
XQEndpointConfig epCfg=(XQEndpointConfig)iCtx.lookup("endpoint/"+entryEp.getName());
XQConnectionConfig connCfg = (XQConnectionConfig)
iCtx.lookup("connection/" + epCfg.getConnection());
String connUser = connCfg.getParameters().getParameter("user",XQConstants.PARAM_STRING);
String connPwd = connCfg.getParameters().getParameter("password",XQConstants.PARAM_STRING);
String connUrls = connCfg.getParameters().getParameter("url",XQConstants.PARAM_STRING);
m_xqLog.logInformation("Connection: " +connUser+" "+connPwd+""+connUrls);