Guru,
Could you post your xbean files for whatever is in between these two
HTTP endpoints as well (servicemix-eip and servicemix-bean probably)? I
would like to see how you fitted your POJO in between these two.
---
Gert Vanthienen
http://www.anova.be
nautilis22 wrote:
Hi Gert,
The idea is to get hold of the normalized message from the frontend http
consumer end point and add the property. I tried using the "in" normalised
message but results have been the same. I have pasted the http xbean.xml
below.
<http:endpoint service="frontend:Frontend"
endpoint="Frontend"
role="consumer"
locationURI="http://0.0.0.0:8192/vdss"
soap="true" />
<http:endpoint service="operation:Operation"
endpoint="Operation"
role="provider"
locationURI="http://localhost:9080/OriginalService"
soap="true"
soapAction=""
soapVersion="1.1" />
</beans>
Regards,
Guru
Gert Vanthienen wrote:
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
-----
---
Gert Vanthienen
http://www.anova.be