userLogin is null in context

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

userLogin is null in context

Muhammad Aamir
I implemented a simple service in java and made sure in declaration auth is true. However while calling this service I get null when I get userLogin from context.

Plz note that I am calling this service from RMI client.

Regards

Reply | Threaded
Open this post in threaded view
|

Re: userLogin is null in context

BJ Freeman
I believe RMI is only simple (string) data.
you have to have your service to the work on ofbiz size.
there have been a lot of discussion
do a google
ofbiz rmi
http://www.opendocs.net/apache/ofbiz/OFBiz-SOAP-RMI-Tutorial.pdf

=========================
BJ Freeman
http://bjfreeman.elance.com
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>

Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man
Linkedin
<http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro>


Muhammed Aamir sent the following on 6/27/2010 1:57 PM:
> I implemented a simple service in java and made sure in declaration auth is true. However while calling this service I get null when I get userLogin from context.
>
> Plz note that I am calling this service from RMI client.
>
> Regards
>
>

Reply | Threaded
Open this post in threaded view
|

Re: userLogin is null in context

Muhammad Aamir
Thanks for quick reply.

I am sorry but didn't get you. RMI does support all objects that are serializable. However regardless of it's support, I understand userLogin parameter is set internally by ofbiz and in this case it shouldn't matter how the service is called.

Besides, what do you mean by 'have your service work to the work on ofbiz side'?

regards
>
Reply | Threaded
Open this post in threaded view
|

Re: userLogin is null in context

BJ Freeman
sounds like you know more than me, as I said I am notup on RMI
from
https://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-SomethingsYouShouldKnowAboutRMI

One of the problems of using RMI is that complex objects such as
GenericValues are available but entity methods on that object won't work
as they require the entity engine. A workaround is to define facade
services that return simple pojos. Then rmi works pretty well.

Muhammed Aamir sent the following on 6/27/2010 7:24 PM:


=========================
BJ Freeman
http://bjfreeman.elance.com
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>

Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man
Linkedin
<http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro>

> Thanks for quick reply.
>
> I am sorry but didn't get you. RMI does support all objects that are serializable. However regardless of it's support, I understand userLogin parameter is set internally by ofbiz and in this case it shouldn't matter how the service is called.
>
> Besides, what do you mean by 'have your service work to the work on ofbiz side'?
>
> regards
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: userLogin is null in context

Shi Jinghai
In reply to this post by Muhammad Aamir
How do you know your userLogin is null?

在 2010-06-27日的 23:57 +0300,Muhammed Aamir写道:
> I implemented a simple service in java and made sure in declaration auth is true. However while calling this service I get null when I get userLogin from context.
>
> Plz note that I am calling this service from RMI client.
>
> Regards
>

Reply | Threaded
Open this post in threaded view
|

Re: userLogin is null in context

Muhammad Aamir
It was a silly mistake. Instead of getting value from Map (context), I was
doing getAttribute() on DispatchContext.

On Mon, Jun 28, 2010 at 8:52 AM, Shi Jinghai <[hidden email]> wrote:

> How do you know your userLogin is null?
>
> 在 2010-06-27日的 23:57 +0300,Muhammed Aamir写道:
> > I implemented a simple service in java and made sure in declaration auth
> is true. However while calling this service I get null when I get userLogin
> from context.
> >
> > Plz note that I am calling this service from RMI client.
> >
> > Regards
> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: userLogin is null in context

Shi Jinghai
As a remote object, your GenericDelegator will be null, you can use
getAllFields().get(fieldName) to get a field from GenericValue.

在 2010-06-28一的 17:47 +0300,Muhammad Aamir写道:

> It was a silly mistake. Instead of getting value from Map (context), I was
> doing getAttribute() on DispatchContext.
>
> On Mon, Jun 28, 2010 at 8:52 AM, Shi Jinghai <[hidden email]> wrote:
>
> > How do you know your userLogin is null?
> >
> > 在 2010-06-27日的 23:57 +0300,Muhammed Aamir写道:
> > > I implemented a simple service in java and made sure in declaration auth
> > is true. However while calling this service I get null when I get userLogin
> > from context.
> > >
> > > Plz note that I am calling this service from RMI client.
> > >
> > > Regards
> > >
> >
> >