I am currently sending an object within a custom location in the Message (lets call it input) and the service I am sending it to is configured as follows (only INVM transport is available)
{code:xml}<service category="MainCategory" name="EntryService" invmScope="GLOBAL">
<property name="inVMPassByValue" value="true" />
<actions mep="OneWay">
somewhere here I route to another service service-category="ReplyServices" service-name="StatusSetting"
</actions>
</service>
<service category="ReplyServices" name="StatusSetting" invmScope="GLOBAL">
<property name="inVMPassByValue" value="true" />
<actions mep="RequestResponse">
// I get the object from location "input" without any problems as it has been de-serialized successfully.
MyObjectClass c = (MyObjectClass) response.getBody().get("input");
// I enhance the object and put it back in its location
obj.addStatus("ok");
response.getBody().add("input", obj);
//The Message Headers maintain the original ReplyTo and so returns successfully to client
</actions>
</service>
{code}
On the client side when I access the object as follows
{code}MyObjectClassobj = (MyObjectClass) response.getBody().get("input");{code}
I get
{code} ClassCastException org.mypackage.MyObjectClass cannot be cast to org.mypackage.MyObjectClass{code}
This error is similar to the one I was getting before I managed with the service configuration to set the
{code}To: InVMEPR .... <wsa:ReferenceProperties jbossesb:passByValue : true/> (from default false){code}
Now, I believe the same has to be done for the ReplyTo but
a) I am not sure how programmatically/configuration
b) Also am not 100% certain if the cause of the ClassCastException is the fact that the passByValue property is false and therefore I am willing to hear your ideas on this. What other causes could there be?
Thanks in advance