Re: [Axis2 1.0] parameters in services.xml

2006-08-01 Thread Deepal Jayasinghe
If you want to get access to AxisService object you do one of the following
  *option1 *
  - add the init method (need to change your method)
 init(ServiceContext sctx){  
  this.sctx=sctx
 }
  Then using the above service context you can get the axisService and
from that you can get the parameter

 *option2
  *- add setOperationContext into service impl class
 
setOperationContext(OperationContext opCtx){
 inmgsCtx = opctx.getMessageConetxt("in");
}


if you want to know more about these stuff pls see Axis2 session
management article  in developer.com.

Thanks
Deepal

Nirmit Desai wrote:

>Hi all,
>
>I am trying to set a parameter in my services.xml file and get it in my
>service like this (all document/literal with ADB):
>
>SampleMember
>
>And in my service implementation class:
>
>private MessageContext msgCtx=null;
>
>public void init(MessageContext ctx)
>{
>  msgCtx=ctx;
>  System.out.println("init called..context:"+ctx);
>}
>
>public  com.ibm.sobe.xsd.PingReturn ping(com.ibm.sobe.xsd.PingParam param0)
>{
>  PingReturn pr=new PingReturn();
>  System.out.println("Param:"+msgCtx.getParameter("memberName"));
>  .
>}
>
>It throws a NullPointerException when any operation on msgCtx is attempted,
>implying that msgCtx is null. I followed the advice give in this article:
>http://www.developer.com/open/print.php/10930_3589126_3
>
>Is this the best way to do this? If so, what am I doing wrong? I really
>need a way to access statically set parameters in services.xml.
>
>Thanks,
>
>-Nirmit
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>  
>

-- 
Thanks,
Deepal

~Future is Open~ 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Axis2 1.0] parameters in services.xml

2006-07-31 Thread Nirmit Desai

Hi all,

I am trying to set a parameter in my services.xml file and get it in my
service like this (all document/literal with ADB):

SampleMember

And in my service implementation class:

private MessageContext msgCtx=null;

public void init(MessageContext ctx)
{
  msgCtx=ctx;
  System.out.println("init called..context:"+ctx);
}

public  com.ibm.sobe.xsd.PingReturn ping(com.ibm.sobe.xsd.PingParam param0)
{
  PingReturn pr=new PingReturn();
  System.out.println("Param:"+msgCtx.getParameter("memberName"));
  .
}

It throws a NullPointerException when any operation on msgCtx is attempted,
implying that msgCtx is null. I followed the advice give in this article:
http://www.developer.com/open/print.php/10930_3589126_3

Is this the best way to do this? If so, what am I doing wrong? I really
need a way to access statically set parameters in services.xml.

Thanks,

-Nirmit


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]