You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Igor Nogueira <ig...@gmail.com> on 2008/09/24 03:45:23 UTC

ServiceContext in OperationContext does not match error

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

Re: ServiceContext in OperationContext does not match error

Posted by Deepal Jayasinghe <de...@opensource.lk>.

> Ok! Thanks again. So I must send the properties instead of the
> context. Thanks Deepal!
here we go ;-)

-Deepal

-- 
Thank you!


http://blogs.deepal.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: ServiceContext in OperationContext does not match error

Posted by Igor Nogueira <ig...@gmail.com>.
Ok! Thanks again. So I must send the properties instead of the context.
Thanks Deepal!

2008/9/24 Deepal jayasinghe <de...@gmail.com>

>
> >   Hi Deepal! Thanks for answering! That´s what I wanna do: I have two
> > services. Service A and service B. Both are stateful, and they may not
> > be on the same server. Service A proccess the client's invocations and
> > consequently update the session state.
> You mean when client invoke the service A , it updates it session data
> (a database)
> > Service B is a backup service and sometimes need to have it's session
> > updated with the values in service A's state. To do this, I serialize
> > the context in A and send it to B as a string. In B I rebuild it and
> > try to set B's context with this value.
> Thats the problem , you have to find some other way to do that. I mean
> you are missing the idea behind Message context and Operation context (I
> mean the context hierarchy).
> What you should do is , find the session related data and try sending
> that from service A to service B.
>
> Thank you!
> Deepal
>
> --
> Thank you!
>
>
> http://blogs.deepal.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: ServiceContext in OperationContext does not match error

Posted by Deepal jayasinghe <de...@gmail.com>.
>   Hi Deepal! Thanks for answering! That´s what I wanna do: I have two
> services. Service A and service B. Both are stateful, and they may not
> be on the same server. Service A proccess the client's invocations and
> consequently update the session state.
You mean when client invoke the service A , it updates it session data
(a database)
> Service B is a backup service and sometimes need to have it's session
> updated with the values in service A's state. To do this, I serialize
> the context in A and send it to B as a string. In B I rebuild it and
> try to set B's context with this value.
Thats the problem , you have to find some other way to do that. I mean
you are missing the idea behind Message context and Operation context (I
mean the context hierarchy).
What you should do is , find the session related data and try sending
that from service A to service B.

Thank you!
Deepal

-- 
Thank you!


http://blogs.deepal.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: ServiceContext in OperationContext does not match error

Posted by Igor Nogueira <ig...@gmail.com>.
  Hi Deepal! Thanks for answering! That´s what I wanna do: I have two
services. Service A and service B. Both are stateful, and they may not be on
the same server. Service A proccess the client's invocations and
consequently update the session state. Service B is a backup service and
sometimes need to have it's session updated with the values in service A's
state. To do this, I serialize the context in A and send it to B as a
string. In B I rebuild it and try to set B's context with this value. But
then I get that error. I'm using MessageContext to access the ServiceContext
where my values are saved.
I use "MessageContext.getCurrentMessageContext().getServiceContext" to do
this.



Thanks again!




2008/9/23 Deepal jayasinghe <de...@gmail.com>

> >
> > 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.
> Why do you need  to have a message context (I mean new) to send from A
> to B ?
>
> Can you please provide some more information on what exactly you are
> trying yo do here.
>
> Thank you!
> Deepal
>
> --
> Thank you!
>
>
> http://blogs.deepal.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: ServiceContext in OperationContext does not match error

Posted by Deepal jayasinghe <de...@gmail.com>.
>
> 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.
Why do you need  to have a message context (I mean new) to send from A
to B ?

Can you please provide some more information on what exactly you are
trying yo do here.

Thank you!
Deepal

-- 
Thank you!


http://blogs.deepal.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org