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 Michelantonio Trizio <mi...@gmail.com> on 2008/04/03 12:21:06 UTC

session problem

Hi,

I want to call a service from another service.
I make this with the creation of a new stub in the service for the service
that i want to call (I believe that it isn't the best solution, but is the
only that I have found).
So now the problem is that I want to use the same session of the service
that invoke the other.
How can I do?
Thanks in advance.

                               Mikelantonio

-- 
It's creepy, but here we are, the Pilgrims, the crackpots of our time,
trying to establish our own alternate reality. To build a world out of rocks
and chaos. What it's going to be, I don't know. Even after all that rushing
around, where we've ended up is the middle of nowhere in the middle of the
night. And maybe knowing isn't the point. Where we're standing right now, in
the ruins in the dark, what we build could be anything. [Choke - Chuck
Palahniuk]

Re: session problem

Posted by Michelantonio Trizio <mi...@gmail.com>.
This code is in a service that invoke another service in the same
servicegroup.
Thank you.

                             Michelantonio

2008/4/4, Deepal Jayasinghe <de...@opensource.lk>:
>
>
>
>
>
> >
> > I'd like someone make a comment on my solution.
> > Thanks
> >                 Mikelantonio
> >
> > ServiceGroupContext
> > sgc=MessageContext.getCurrentMessageContext().getServiceGroupContext();
> >
> Is this code in client side or the server side ?
>
> > HashMap<QName,OMElement> map=new HashMap<QName,OMElement>();
> >    QName qn=new QName("http://ws.apache.org/namespaces/axis2",
> > "ServiceGroupId");
> >    OMElement el = AXIOMUtil.stringToOM("<axis2:ServiceGroupId
> > xmlns:axis2=\"http://ws.apache.org/namespaces/axis2\<http://ws.apache.org/namespaces/axis2%5C><
> > http://ws.apache.org/namespaces/axis2%5C>" xmlns:wsa=\"
> > http://www.w3.org/2005/08/addressing\<http://www.w3.org/2005/08/addressing%5C><
> > http://www.w3.org/2005/08/addressing%5C>"
> > wsa:IsReferenceParameter=\"true\">"+sgc.getId()+"</axis2:ServiceGroupId>");
> >    map.put(qn, el);
> >    AdministratorServiceStub ass=new AdministratorServiceStub("
> > http://localhost:8080/Profiler0.1/services/AdministratorService");
> >    ass._getServiceClient().engageModule("addressing-1.3");
> >    ass._getServiceClient().getOptions().setManageSession(true);
> >
> >  ass._getServiceClient().getOptions().getTo().setReferenceParameters(map);
> >
> Please have a look at his too
> http://wso2.org/library/3184
>
> Thank you!
> Deepal
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
It's creepy, but here we are, the Pilgrims, the crackpots of our time,
trying to establish our own alternate reality. To build a world out of rocks
and chaos. What it's going to be, I don't know. Even after all that rushing
around, where we've ended up is the middle of nowhere in the middle of the
night. And maybe knowing isn't the point. Where we're standing right now, in
the ruins in the dark, what we build could be anything. [Choke - Chuck
Palahniuk]

Re: session problem

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


>
>
> I'd like someone make a comment on my solution.
> Thanks
>                  Mikelantonio
>
> ServiceGroupContext 
> sgc=MessageContext.getCurrentMessageContext().getServiceGroupContext();
Is this code in client side or the server side ?
> HashMap<QName,OMElement> map=new HashMap<QName,OMElement>();
>     QName qn=new QName("http://ws.apache.org/namespaces/axis2", 
> "ServiceGroupId");
>     OMElement el = AXIOMUtil.stringToOM("<axis2:ServiceGroupId 
> xmlns:axis2=\"http://ws.apache.org/namespaces/axis2\ 
> <http://ws.apache.org/namespaces/axis2%5C>" 
> xmlns:wsa=\"http://www.w3.org/2005/08/addressing\ 
> <http://www.w3.org/2005/08/addressing%5C>" 
> wsa:IsReferenceParameter=\"true\">"+sgc.getId()+"</axis2:ServiceGroupId>");
>     map.put(qn, el);
>     AdministratorServiceStub ass=new 
> AdministratorServiceStub("http://localhost:8080/Profiler0.1/services/AdministratorService");
>     ass._getServiceClient().engageModule("addressing-1.3");
>     ass._getServiceClient().getOptions().setManageSession(true);
>     
> ass._getServiceClient().getOptions().getTo().setReferenceParameters(map);
Please have a look at his too
http://wso2.org/library/3184

Thank you!
Deepal



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


Re: session problem

Posted by Michelantonio Trizio <mi...@gmail.com>.
Hi,

I'd like someone make a comment on my solution.
Thanks
                 Mikelantonio

ServiceGroupContext
sgc=MessageContext.getCurrentMessageContext().getServiceGroupContext();
HashMap<QName,OMElement> map=new HashMap<QName,OMElement>();
    QName qn=new QName("http://ws.apache.org/namespaces/axis2",
"ServiceGroupId");
    OMElement el = AXIOMUtil.stringToOM("<axis2:ServiceGroupId
xmlns:axis2=\"http://ws.apache.org/namespaces/axis2\" xmlns:wsa=\"
http://www.w3.org/2005/08/addressing\"
wsa:IsReferenceParameter=\"true\">"+sgc.getId()+"</axis2:ServiceGroupId>");
    map.put(qn, el);
    AdministratorServiceStub ass=new AdministratorServiceStub("
http://localhost:8080/Profiler0.1/services/AdministratorService");
    ass._getServiceClient().engageModule("addressing-1.3");
    ass._getServiceClient().getOptions().setManageSession(true);

ass._getServiceClient().getOptions().getTo().setReferenceParameters(map);

2008/4/3, Michelantonio Trizio <mi...@gmail.com>:
>
> Hi,
>
> I want to call a service from another service.
> I make this with the creation of a new stub in the service for the service
> that i want to call (I believe that it isn't the best solution, but is the
> only that I have found).
> So now the problem is that I want to use the same session of the service
> that invoke the other.
> How can I do?
> Thanks in advance.
>
>                                Mikelantonio
>
> --
> It's creepy, but here we are, the Pilgrims, the crackpots of our time,
> trying to establish our own alternate reality. To build a world out of rocks
> and chaos. What it's going to be, I don't know. Even after all that rushing
> around, where we've ended up is the middle of nowhere in the middle of the
> night. And maybe knowing isn't the point. Where we're standing right now, in
> the ruins in the dark, what we build could be anything. [Choke - Chuck
> Palahniuk]




-- 
It's creepy, but here we are, the Pilgrims, the crackpots of our time,
trying to establish our own alternate reality. To build a world out of rocks
and chaos. What it's going to be, I don't know. Even after all that rushing
around, where we've ended up is the middle of nowhere in the middle of the
night. And maybe knowing isn't the point. Where we're standing right now, in
the ruins in the dark, what we build could be anything. [Choke - Chuck
Palahniuk]