You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by navigator09 <ga...@gmail.com> on 2008/04/17 06:00:14 UTC

Accessing a normalised message inside jsr181 using jbi api

HI,

  I am trying to access a normalised message created automatically by the
the jsr181 component. I need to set a property inside the normalised
message. Does anyone know how to go about it?

Regards,
Navigator09
-- 
View this message in context: http://www.nabble.com/Accessing-a-normalised-message-inside-jsr181-using-jbi-api-tp16738454p16738454.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Accessing a normalised message inside jsr181 using jbi api

Posted by navigator09 <ga...@gmail.com>.
Hi,

  I have made the  changes mentioned and also used the following
modification to set the endpoint property


exchange.setProperty("org.apache.servicemix.http.destination.uri","http://GKSSimulation/Operations
<http://gkssimulation/Operations>");

However it still does not work. One more thing is that, the JbiConstants
interface does not have the property 'HTTP_DESTINATION_URI". I have attached
the jar file to the post.

Regards,
navigator09
 

gnodet wrote:
> 
> Also, JbiConstants is an interface and HTTP_DESTINATION_URI a constant
> defined by this interface.
> So either remove the quotes, or use the value
>    "org.apache.servicemix.http.destination.uri"
> 
> On Thu, Apr 17, 2008 at 11:49 AM, Guillaume Nodet <gn...@gmail.com>
> wrote:
> 
>> IIRC, the url will be retrieved on the JBI message, not on the exchange
>> itself.
>> You can try
>>
>> MessageExchange exchange =
>> org.apache.servicemix.jsr181.JBIContext.getMessageExchange() ;
>> NormalizedMessage msg = exchange.getMessage("out");
>> if (msg == null) {
>>      msg = exchange.createMessage();
>>      exchange.setMessage("out", msg);
>> }
>> message.setProperty("JbiConstants.HTTP_DESTINATION_URI", "
>> http://GKSSimulation/Operations <http://gkssimulation/Operations>");
>>
>> It may work better.
>>
>>
>>
>>/
> 
> 
http://www.nabble.com/file/p16743317/servicemix-jbi-3.2.1.jar
servicemix-jbi-3.2.1.jar 
-- 
View this message in context: http://www.nabble.com/Accessing-a-normalised-message-inside-jsr181-using-jbi-api-tp16738454p16743317.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Accessing a normalised message inside jsr181 using jbi api

Posted by Guillaume Nodet <gn...@gmail.com>.
Also, JbiConstants is an interface and HTTP_DESTINATION_URI a constant
defined by this interface.
So either remove the quotes, or use the value
   "org.apache.servicemix.http.destination.uri"

On Thu, Apr 17, 2008 at 11:49 AM, Guillaume Nodet <gn...@gmail.com> wrote:

> IIRC, the url will be retrieved on the JBI message, not on the exchange
> itself.
> You can try
>
> MessageExchange exchange =
> org.apache.servicemix.jsr181.JBIContext.getMessageExchange() ;
> NormalizedMessage msg = exchange.getMessage("out");
> if (msg == null) {
>      msg = exchange.createMessage();
>      exchange.setMessage("out", msg);
> }
> message.setProperty("JbiConstants.HTTP_DESTINATION_URI", "
> http://GKSSimulation/Operations <http://gkssimulation/Operations>");
>
> It may work better.
>
>
>
> On Thu, Apr 17, 2008 at 11:17 AM, navigator09 <ga...@gmail.com>
> wrote:
>
> >
> >
> > Hi,
> >
> >
> >  I have incorporated the following modifications as per suggestions
> > given
> >
> >  public OperationAResponse OperationA(OperationARequest request) {
> >
> > // to get the message exachenge object
> >    MessageExchange
> > message=org.apache.servicemix.jsr181.JBIContext.getMessageExchange() ;
> >
> > // setting property
> > message.setProperty("JbiConstants.HTTP_DESTINATION_URI",
> > "http://GKSSimulation/Operations");
> >
> > //calling the operation
> > OperationAResponse response =
> > operations.getOperationA(request.getOperationARequest());
> >
> > //returning the response
> > return response ;
> >
> >  }
> >
> > It still uses the Xbean. xml http endpoint and dosent take the end point
> > set
> > here. whats the right way of doing it?
> >
> > Regards,
> > Ganesh
> >
> > >
> > > HI,
> > >
> > >  I am trying to access a normalised message created automatically by
> > the
> > > the jsr181 component. I need to set a property inside the normalised
> > > message. Does anyone know how to go about it?
> > >
> > > Regards,
> > > Navigator09
> > > --
> > > View this message in context:
> > >
> > http://www.nabble.com/Accessing-a-normalised-message-inside-jsr181-using-jbi-api-tp16738454p16738454.html
> > > Sent from the ServiceMix - User mailing list archive at Nabble.com.
> > >
> > >
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Blog: http://gnodet.blogspot.com/
> >
> >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/Accessing-a-normalised-message-inside-jsr181-using-jbi-api-tp16738454p16741987.html
> > Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >
> >
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Re: Accessing a normalised message inside jsr181 using jbi api

Posted by Guillaume Nodet <gn...@gmail.com>.
IIRC, the url will be retrieved on the JBI message, not on the exchange
itself.
You can try

MessageExchange exchange =
org.apache.servicemix.jsr181.JBIContext.getMessageExchange() ;
NormalizedMessage msg = exchange.getMessage("out");
if (msg == null) {
     msg = exchange.createMessage();
     exchange.setMessage("out", msg);
}
message.setProperty("JbiConstants.HTTP_DESTINATION_URI", "
http://GKSSimulation/Operations <http://gkssimulation/Operations>");

It may work better.


On Thu, Apr 17, 2008 at 11:17 AM, navigator09 <ga...@gmail.com>
wrote:

>
>
> Hi,
>
>
>  I have incorporated the following modifications as per suggestions given
>
>  public OperationAResponse OperationA(OperationARequest request) {
>
> // to get the message exachenge object
>    MessageExchange
> message=org.apache.servicemix.jsr181.JBIContext.getMessageExchange() ;
>
> // setting property
> message.setProperty("JbiConstants.HTTP_DESTINATION_URI",
> "http://GKSSimulation/Operations");
>
> //calling the operation
> OperationAResponse response =
> operations.getOperationA(request.getOperationARequest());
>
> //returning the response
> return response ;
>
>  }
>
> It still uses the Xbean. xml http endpoint and dosent take the end point
> set
> here. whats the right way of doing it?
>
> Regards,
> Ganesh
>
> >
> > HI,
> >
> >  I am trying to access a normalised message created automatically by the
> > the jsr181 component. I need to set a property inside the normalised
> > message. Does anyone know how to go about it?
> >
> > Regards,
> > Navigator09
> > --
> > View this message in context:
> >
> http://www.nabble.com/Accessing-a-normalised-message-inside-jsr181-using-jbi-api-tp16738454p16738454.html
> > Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >
> >
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Accessing-a-normalised-message-inside-jsr181-using-jbi-api-tp16738454p16741987.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Re: Accessing a normalised message inside jsr181 using jbi api

Posted by navigator09 <ga...@gmail.com>.

Hi, 


 I have incorporated the following modifications as per suggestions given

  public OperationAResponse OperationA(OperationARequest request) {

// to get the message exachenge object
    MessageExchange
message=org.apache.servicemix.jsr181.JBIContext.getMessageExchange() ;

// setting property
message.setProperty("JbiConstants.HTTP_DESTINATION_URI",
"http://GKSSimulation/Operations");

//calling the operation
OperationAResponse response =
operations.getOperationA(request.getOperationARequest());

//returning the response
return response ;

  }

It still uses the Xbean. xml http endpoint and dosent take the end point set
here. whats the right way of doing it?

Regards,
Ganesh

>
> HI,
>
>  I am trying to access a normalised message created automatically by the
> the jsr181 component. I need to set a property inside the normalised
> message. Does anyone know how to go about it?
>
> Regards,
> Navigator09
> --
> View this message in context:
> http://www.nabble.com/Accessing-a-normalised-message-inside-jsr181-using-jbi-api-tp16738454p16738454.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/



-- 
View this message in context: http://www.nabble.com/Accessing-a-normalised-message-inside-jsr181-using-jbi-api-tp16738454p16741987.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Accessing a normalised message inside jsr181 using jbi api

Posted by Guillaume Nodet <gn...@gmail.com>.
>From within your method, try:
   org.apache.servicemix.jsr181.JBIContext.getMessageExchange()

On Thu, Apr 17, 2008 at 6:00 AM, navigator09 <ga...@gmail.com>
wrote:

>
> HI,
>
>  I am trying to access a normalised message created automatically by the
> the jsr181 component. I need to set a property inside the normalised
> message. Does anyone know how to go about it?
>
> Regards,
> Navigator09
> --
> View this message in context:
> http://www.nabble.com/Accessing-a-normalised-message-inside-jsr181-using-jbi-api-tp16738454p16738454.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/