Hi Deepal,
thanks for your reply. How can I access the SOAPHeader from the
ServiceClient?
Michele
Deepal Jayasinghe wrote:
> Hi Michele;
> None of the property is send to wire , all the properties for internal
> processing I mean if you set a property in one server instance there is
> no way that you can access that in some other server.
>
> If you want to share properties between two servers you have to send
> those in SOAP message as SOAP headers.
>
> Michele Mazzucco wrote:
>
>> Hi all,
>>
>> I've got two handlers (A and B), deployed on two different tomcat
>> servers (1 and 2).
>> When server 2 is started, handler B sends a message to handler A (server
>> 1 is running). My problem is that handler B inserts a message property
>> into the options and that option is received as NULL:
>>
>>
>> ============ Handler A
>>
>> public void invoke(MessageContext messageContext) throws AxisFault {
>>
>> MessageType type = (MessageType)
>>
>> messageContext.getProperty(QOSPConstants.QOSP_MESSAGE_TYPE);
>>
>> if (type != null)
>> log.info("Message type [" + type.value() + "]");
>> else
>> log.error("Message type is NULL");
>> }
>>
>> //......
>> }
>>
>>
>>
>> ============== Handler B
>>
>>
>> // Method called into the constructor
>>
>> private final void register() throws AxisFault {
>>
>> if (log.isDebugEnabled()) {
>> log.debug("Registering node");
>> }
>>
>> ServiceClient sender = new ServiceClient();
>> Options options = new Options();
>> EndpointReference managerEPR = new
>> EndpointReference(System.getProperty("qosp.manager.epr"));
>>
>> if (log.isDebugEnabled()) {
>> log.debug("Manager EPR [" + managerEPR.getAddress() + "]");
>> }
>> options.setTo(managerEPR);
>>
>> options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>>
>> options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
>> options.setProperty(QOSPConstants.QOSP_MESSAGE_TYPE,
>> MessageType.NEW_NODE);
>> sender.setOptions(options);
>>
>>
>> MessageType type = (MessageType)
>> options.getProperty(QOSPConstants.QOSP_MESSAGE_TYPE);
>> if (type == null) {
>> log.error("Message type is NULL!");
>> } else {
>> log.info("Message type [" + type.value() + "]");
>>
>>
>> OMElement method = factory.createOMElement(SOAPConstants.ADD_NODE,
>> this.omNs);
>>
>> method.addChild(this.factory.createOMText(NodeDispatcher.name));
>>
>>
>> if (log.isDebugEnabled()) {
>> log.debug("Request [" + method.toString() + "]");
>> }
>>
>> sender.sendRobust(method);
>>
>> if (log.isInfoEnabled()) {
>> log.info("Registered node [" + name + "]");
>> }
>>
>> }
>>
>>
>> }
>>
>>
>>
>> The log messages are
>>
>>
>> // Handler A
>>
>> ERROR ncl.qosp.modules.manager.RouterDispatcher - Message type is NULL
>>
>>
>>
>> // Handler B
>>
>> DEBUG ncl.qosp.modules.node.NodeDispatcher - Codestore endpoint
>> [http://localhost:8080/axis2/services/CodestoreService]
>> DEBUG ncl.qosp.modules.node.NodeDispatcher - Registering node
>> DEBUG ncl.qosp.modules.node.NodeDispatcher - Manager EPR
>> [http://localhost:8080/axis2/services/RoutingService]
>> INFO ncl.qosp.modules.node.NodeDispatcher - Message type [New node]
>> DEBUG ncl.qosp.modules.node.NodeDispatcher - Request [<codestore:addNode
>> xmlns:codestore="http://org.ncl.ac.uk/qosp">10.8.149.156</codestore:addNode>]
>>
>>
>>
>> What happened? Are property values sent to the wire?
>>
>>
>>
>> Thanks in advance,
>> 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]