Hello guys!
I get the "ServiceContext in OperationContext does not match" error this
error when I try to do this:
I have 2 webservices: Service A and B. All the invocations are sent to
service A. So, service A has the actual state in it's session.
Then I serialize the MessageContext in A and send it as a string to service
B. In B, I rebuild MessageContext, activate it and try to set B's context. I
do this on the following piece of code:
ByteArrayInputStream bios = new
ByteArrayInputStream(decode.decodeBuffer(teste));
ObjectInputStream ois = new ObjectInputStream(bios);
MessageContext state = (MessageContext)ois.readObject();
state.activate(
MessageContext.getCurrentMessageContext().getConfigurationContext());
//Setting Service B content
MessageContext.getCurrentMessageContext().setOperationContext(state.getOperationContext());
MessageContext.getCurrentMessageContext().setServiceContext(state.getServiceContext());
I'm using Application scope, and the information I try to retrieve is saved
on ServiceContext. The last operation gives me the error I mentioned before.
Is there something else I can do in order to fix it?
Thanks in advance,
Igor Nogueira Santos