First, you need access to the Axis service object, which you can get by
defining a special method as follows in your service impl class (Java
reflection is used to find this). It is called once to initialize your
service:
private MessageContext msgContext = null; private AxisService service;
public void setOperationContext(OperationContext opContext)
throws AxisFault {
this.msgContext =
opContext.getMessageContext(
WSDLConstants.MESSAGE_LABEL_IN_VALUE);
service = msgContext.getAxisService();
}
Then in your service impl class you can use the service object to get
parameters:
Parameter sp = service.getParameter("something");
Object value = sp.getValue();
Or get all parameters;
Map<String, Object> m = new HashMap<String, Object>(); List sl =
service.getParameters(); int cnt = sl.size(); for (int i = 0; i < cnt;
i++) {
Parameter pn = (Parameter) sl.get(i);
m.put(pn.getName(), pn.getValue());
}
Gary
-----Original Message-----
From: Airline Pedestal [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 28, 2006 3:32 PM
To: [email protected]
Subject: Server side configuration parameters
How can I access parameters that I define
in services.xml from within my Java Class
implementing the web service?
Thank you,
A
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]