nautilis22,

Shouldn't you be modifying the 'in' normalized message of the MessageExchange you're sending to your HTTP provider endpoint? Or is this code being executed inside a pipeline to copy the out to in?

Is the HTTP endpoint a <http:endpoint/> or an <http:provider/>?

Gert

nautilis22 wrote:
Hi Gert,

  I made the foolowing changes in the  code

public OpererationResponse operation(OpererationRequest request) {
// throw new UnsupportedOperationException();
        OpererationResponse responseobj = new OpererationResponse ();

        try{

/* Code to access the normalised message of the jsr-181 component
   */                   
        MessageExchange exchange =
org.apache.servicemix.jsr181.JBIContext.getMessageExchange() ;  
        
        NormalizedMessage msg = exchange.getMessage("out");
if (msg == null) { System.out.println("2"); msg = exchange.createMessage(); exchange.setMessage(msg,"out"); } /* Setting the property */ msg.setProperty(JbiConstants.HTTP_DESTINATION_URI,"http://localhost:9080/AlternateService";);
        
    /* service object is a property declared in a xbean.xml of jsr-181
component. Calling the webservice.
     */
        String responsestring = service.operation(request);
        
        
        responseobj.setOperationResponse(responsestring);
        return responseobj;
        }catch(Exception e){
                String ex= e.getMessage();
                return responseobj;
        }
    }

However, the endpoint address is stiil pointing to
http://localhost:9080/OriginalService that I have configured in Xbean.xml. The end point address is not getting dynamically changed.

Regards,
nautilis22



Reply via email to