Hi Ajith,
no, I want to send the message to a service running on another server.
Ajith Ranabahu wrote:
> Hi,
> You want to send a message to the same server at module init ? AFAIK
> this is somewhat weird because the module init is called when the
> server starts up (actually when the config context is made) so the
> Axis2 system is not "up" at module init in the servlet case. So it is
> not really possible for you to call the same server at module init!
>
> Ajith
>
> On 6/1/06, Michele Mazzucco <[EMAIL PROTECTED]> wrote:
>> Hi all,
>>
>> I'm running Axis2 1.0 and I would like to send a message from my own
>> module, during the initialization phase, so I added the code into the
>> init() method:
>>
>>
>> public class MyModule implements Module {
>>
>>
>> public void init(ConfigurationContext configContext, AxisModule
>> module) throws AxisFault {
>>
>> ServiceClient sender = new ServiceClient();
>> Options options = new Options();
>> options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>> EndpointReference managerEPR = new
>> EndpointReference("http://localhost:8080/axis2/services/ManagerService");
>> options.setTo(managerEPR);
>>
>>
>> options.setProperty(QOSPConstants.QOSP_MESSAGE_TYPE,
>> QOSPMessageType.NEW_NODE.value());
>>
>> OMElement payload = getHostOMElement(address);
>> sender.fireAndForget(payload);
>>
>>
>> // send a message to another service (deployed on a running
>> Tomcat server)
>> }
>>
>> //...
>>
>> private final OMElement getHostOMElement(final String host) {
>> OMFactory factory = OMAbstractFactory.getOMFactory();
>> OMNamespace omNs = factory.createOMNamespace(
>> QOSPSOAPConstants.URI,
>> QOSPSOAPConstants.EXEUCUTOR_NODE);
>>
>> OMElement payload =
>> factory.createOMElement("registerNode", omNs);
>> OMElement value = factory.createOMElement("value", omNs);
>> value.setText(host);
>> payload.addChild(value);
>>
>> return payload;
>> } //-- getHostOMElement()
>>
>> }
>>
>> Unfortunately I get an error ("No address information in EPR, cannot
>> infer transport; nested exception is ConfigurationContextFactory:107
>> ....... ConfigurationContextFactory:128)
>>
>>
>> which prevents me both from sending the message and both from running
>> that tomcat instance.
>>
>>
>> Any suggestion is welcome.
>>
>> Michele
>>
>> ---------------------------------------------------------------------
>> 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]