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 Ali Sadik Kumlali <as...@yahoo.com> on 2006/05/03 12:35:36 UTC

Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5

Deepal,

I've just tried it with axis2 war distribution (RC5) and got NPE.

Here is my code snippet that uses ListenerManager:

---------------------------------------------------------
System.out.println("ListenerManager.defaultConfigurationContext: " +
ListenerManager.defaultConfigurationContext);
System.out.println("ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
" +
ListenerManager.defaultConfigurationContext.getServiceGroupContexts());
com.mycompany.service.test.account.AccountServicesStub stub = new
com.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,
targetEndpoint);
---------------------------------------------------------

Here is the output:

---------------------------------------------------------
ListenerManager.defaultConfigurationContext:
org.apache.axis2.context.ConfigurationContext@1453d72
ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
{}
java.lang.NullPointerException
	at
org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)
	at
org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:101)
	at
com.mycompany.service.test.account.AccountServicesStub.<init>(AccountServicesStub.java:329)
	at 
...
---------------------------------------------------------

What I've seen from the output is
ListenerManager.defaultConfigurationContext is successfully set as it's
not null. But I cannot think furthermore :-)

What should I do?

Thanks a lot.

Ali Sadik Kumlali


--- Ali Sadik Kumlali <as...@yahoo.com> wrote:

> Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result.
> 
> Best regards,
> 
> Ali Sadik Kumlali
> 
> --- Deepal Jayasinghe <de...@opensource.lk> wrote:
> 
> > You can have this with Axis2 RC or above :)
> > 
> > You have to follow the following procedure for doing this
> >   - When you creating stub , it has a constructor which take
> > configuration context as argument.
> >   - So pass that as "ListenerManager.defaultConfigurationContext"
> >   - In this case client will be created using server configuration
> > context
> >   - And this will work in axis2 war distribution out of the box
> > 
> > Note : In the case of AxisServlet , it will create a
> ListenerManager
> > and
> > will set defaultConfigurationContext as the server configuration
> > context.
> > 
> > If you are using some other thing say simpleHTTPServer then you
> have
> > to
> > do the following procedure.
> >    - Create a ConfigurationConetx using some axis2.xml and that
> > axis2.xml can have all the transport listeners that you want
> >    - Then create a ListenerManager
> >    - and  call startSystem
> >    - and finally
> >       ListenerManager.defaultConfigurationContext=
> > configurationcotext;
> > 
> > Ali Sadik Kumlali wrote:
> > 
> > >Hi all,
> > >
> > >Since there is no response yet, I assume that my posting had a
> lack
> > of
> > >information :)
> > >
> > >Here is my scenario:
> > >1) I have serviceA.wsdl and serviceB.wsdl. 
> > >2) I generate skeletons and stubs with WSDL2Java
> > >3) I have serviceA.aar which has serviceB.wsdl's stub
> > >4) When I call serviceB's stub from a class found in serviceA.aar,
> > my
> > >soap message does not have addressing and security headers.
> > >5) When I explicitly pass a repository location to constructor of
> > >serviceB's stub, it fails saying double initialization of
> addressing
> > >and security modules.
> > >6) It cannot find the modules and gives me error when I try to
> > engage
> > >the addressing and security modules by following code: 
> > >  stubB._getServiceClient().engageModule(new QName("addressing"));
> > >  stubB._getServiceClient().engageModule(new QName("security"));
> > >
> > >Thanks again.
> > >
> > >Ali Sadik Kumlali
> > >
> > >
> > >--- Ali Sadik Kumlali <as...@yahoo.com> wrote:
> > >
> > >  
> > >
> > >>Hi all,
> > >>
> > >>I need my service to call another service. But, it somehow cannot
> > see
> > >>modules and thus doesn't add security/addressing headers.
> > >>
> > >>I tried engaging the modules manually as in test client. But, it
> > >>couldn't find the modules.
> > >>
> > >>Any help would be appreciated.
> > >>
> > >>Thanks,
> > >>
> > >>Ali Sadik Kumlali
> > >>
> > >>__________________________________________________
> > >>Do You Yahoo!?
> > >>Tired of spam?  Yahoo! Mail has the best spam protection around 
> > >>http://mail.yahoo.com 
> > >>
> > >>    
> > >>
> > >
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Tired of spam?  Yahoo! Mail has the best spam protection around 
> > >http://mail.yahoo.com 
> > >
> > >
> > >  
> > >
> > 
> > -- 
> > Thanks,
> > Deepal
> > ................................................................
> > ~Future is Open~ 
> > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

RE: [Axis2][0.95] How can my service make call to another service? (More details) - RC5

Posted by "Popuri, Monica" <mo...@hp.com>.
Hi All,
 
Infact I also have similar requirement but in Axis C++ . Is it possible with Axis C++?
 
thanks,
Monica

-----Original Message-----
From: Latha Venkat [mailto:acumen_s@yahoo.com]
Sent: Thursday, May 04, 2006 7:11 AM
To: axis-user@ws.apache.org
Subject: Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5


Hello 
I'm trying to do the same in axis1.3 , ie my web service trying to call another web service , will appreciate if anyone has code sample .
 
 
Thankyou 
 
Latha 

Ali Sadik Kumlali <as...@yahoo.com> wrote:

Deepal,

I've just tried it with axis2 war distribution (RC5) and got NPE.

Here is my code snippet that uses ListenerManager:

---------------------------------------------------------
System.out.println("ListenerManager.defaultConfigurationContext: " +
ListenerManager.defaultConfigurationContext);
System.out.println("ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
" +
ListenerManager.defaultConfigurationContext.getServiceGroupContexts());
com.mycompany.service.test.account.AccountServicesStub stub = new
com.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,
targetEndpoint);
---------------------------------------------------------

Here is the output:

---------------------------------------------------------
ListenerManager.defaultConfigurationContext:
org.apache.axis2.context.ConfigurationContext@1453d72
ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
{}
java.lang.NullPointerException
at
org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)
at
org.apache.axis2.client.ServiceClient.(ServiceClient.java:101)
at
com.mycompany.service.test.account.AccountServicesStub.(AccountServicesStub.java:329)
at 
...
---------------------------------------------------------

What I've seen from the output is
ListenerManager.defaultConfigurationContext is successfully set as it's
not null. But I cannot think furthermore :-)

What should I do?

Thanks a lot.

Ali Sadik Kumlali


--- Ali Sadik Kumlali wrote:

> Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result.
> 
> Best regards,
> 
> Ali Sadik Kumlali
> 
> --- Deepal Jayasinghe wrote:
> 
> > You can have this with Axis2 RC or above :)
> > 
> > You have to follow the following procedure for doing this
> > - When you creating stub , it has a constructor which take
> > configuration context as argument.
> > - So pass that as "ListenerManager.defaultConfigurationContext"
> > - In this case client will be created using server configuration
> > context
> > - And this will work in axis2 war distribution out of the box
> > 
> > Note : In the case of AxisServlet , it will create a
> ListenerManager
> > and
> > will set defaultConfigurationContext as the server configuration
> > context.
> > 
> > If you are using some other thing say simpleHTTPServer then you
> have
> > to
> > do the following procedure.
> > - Create a ConfigurationConetx using some axis2.xml and that
> > axis2.xml can have all the transport listeners that you want
> > - Then create a ListenerManager
> > - and call startSystem
> > - and finally
> > ListenerManager.defaultConfigurationContext=
> > configurationcotext;
> > 
> > Ali Sadik Kumlali wrote:
> > 
> > >Hi all,
> > >
> > >Since there is no response yet, I assume that my posting had a
> lack
> > of
> > >information :)
> > >
> > >Here is my scenario:
> > >1) I have serviceA.wsdl and serviceB.wsdl. 
> > >2) I generate skeletons and stubs with WSDL2Java
> > >3) I have serviceA.aar which has serviceB.wsdl's stub
> > >4) When I call serviceB's stub from a class found in serviceA.aar,
> > my
> > >soap message does not have addressing and security headers.
> > >5) When I explicitly pass a repository location to constructor of
> > >serviceB's stub, it fails saying double initialization of
> addressing
> > >and security modules.
> > >6) It cannot find the modules and gives me error when I try to
> > engage
> > >the addressing and security modules by following code: 
> > > stubB._getServiceClient().engageModule(new QName("addressing"));
> > > stubB._getServiceClient().engageModule(new QName("security"));
> > >
> > >Thanks again.
> > >
> > >Ali Sadik Kumlali
> > >
> > >
> > >--- Ali Sadik Kumlali wrote:
> > >
> > > 
> > >
> > >>Hi all,
> > >>
> > >>I need my service to call another service. But, it somehow cannot
> > see
> > >>modules and thus doesn't add security/addressing headers.
> > >>
> > >>I tried engaging the modules manually as in test client. But, it
> > >>couldn't find the modules.
> > >>
> > >>Any help would be appreciated.
> > >>
> > >>Thanks,
> > >>
> > >>Ali Sadik Kumlali
> > >>
> > >>__________________________________________________
> > >>Do You Yahoo!?
> > >>Tired of spam? Yahoo! Mail has the best spam protection around 
> > >>http://mail.yahoo.com 
> > >>
> > >> 
> > >>
> > >
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Tired of spam? Yahoo! Mail has the best spam protection around 
> > >http://mail.yahoo.com 
> > >
> > >
> > > 
> > >
> > 
> > -- 
> > Thanks,
> > Deepal
> > ................................................................
> > ~Future is Open~ 
> > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 





  _____  

How low will we go? Check out Yahoo! Messenger's low PC-to-Phone  <http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com> call rates.


Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5

Posted by Latha Venkat <ac...@yahoo.com>.
Hello 
  I'm trying to do the same in axis1.3 , ie my web service trying to call another web service , will appreciate if anyone has code sample .
   
   
  Thankyou 
   
  Latha 

Ali Sadik Kumlali <as...@yahoo.com> wrote:
  Deepal,

I've just tried it with axis2 war distribution (RC5) and got NPE.

Here is my code snippet that uses ListenerManager:

---------------------------------------------------------
System.out.println("ListenerManager.defaultConfigurationContext: " +
ListenerManager.defaultConfigurationContext);
System.out.println("ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
" +
ListenerManager.defaultConfigurationContext.getServiceGroupContexts());
com.mycompany.service.test.account.AccountServicesStub stub = new
com.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,
targetEndpoint);
---------------------------------------------------------

Here is the output:

---------------------------------------------------------
ListenerManager.defaultConfigurationContext:
org.apache.axis2.context.ConfigurationContext@1453d72
ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
{}
java.lang.NullPointerException
at
org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)
at
org.apache.axis2.client.ServiceClient.(ServiceClient.java:101)
at
com.mycompany.service.test.account.AccountServicesStub.(AccountServicesStub.java:329)
at 
...
---------------------------------------------------------

What I've seen from the output is
ListenerManager.defaultConfigurationContext is successfully set as it's
not null. But I cannot think furthermore :-)

What should I do?

Thanks a lot.

Ali Sadik Kumlali


--- Ali Sadik Kumlali wrote:

> Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result.
> 
> Best regards,
> 
> Ali Sadik Kumlali
> 
> --- Deepal Jayasinghe wrote:
> 
> > You can have this with Axis2 RC or above :)
> > 
> > You have to follow the following procedure for doing this
> > - When you creating stub , it has a constructor which take
> > configuration context as argument.
> > - So pass that as "ListenerManager.defaultConfigurationContext"
> > - In this case client will be created using server configuration
> > context
> > - And this will work in axis2 war distribution out of the box
> > 
> > Note : In the case of AxisServlet , it will create a
> ListenerManager
> > and
> > will set defaultConfigurationContext as the server configuration
> > context.
> > 
> > If you are using some other thing say simpleHTTPServer then you
> have
> > to
> > do the following procedure.
> > - Create a ConfigurationConetx using some axis2.xml and that
> > axis2.xml can have all the transport listeners that you want
> > - Then create a ListenerManager
> > - and call startSystem
> > - and finally
> > ListenerManager.defaultConfigurationContext=
> > configurationcotext;
> > 
> > Ali Sadik Kumlali wrote:
> > 
> > >Hi all,
> > >
> > >Since there is no response yet, I assume that my posting had a
> lack
> > of
> > >information :)
> > >
> > >Here is my scenario:
> > >1) I have serviceA.wsdl and serviceB.wsdl. 
> > >2) I generate skeletons and stubs with WSDL2Java
> > >3) I have serviceA.aar which has serviceB.wsdl's stub
> > >4) When I call serviceB's stub from a class found in serviceA.aar,
> > my
> > >soap message does not have addressing and security headers.
> > >5) When I explicitly pass a repository location to constructor of
> > >serviceB's stub, it fails saying double initialization of
> addressing
> > >and security modules.
> > >6) It cannot find the modules and gives me error when I try to
> > engage
> > >the addressing and security modules by following code: 
> > > stubB._getServiceClient().engageModule(new QName("addressing"));
> > > stubB._getServiceClient().engageModule(new QName("security"));
> > >
> > >Thanks again.
> > >
> > >Ali Sadik Kumlali
> > >
> > >
> > >--- Ali Sadik Kumlali wrote:
> > >
> > > 
> > >
> > >>Hi all,
> > >>
> > >>I need my service to call another service. But, it somehow cannot
> > see
> > >>modules and thus doesn't add security/addressing headers.
> > >>
> > >>I tried engaging the modules manually as in test client. But, it
> > >>couldn't find the modules.
> > >>
> > >>Any help would be appreciated.
> > >>
> > >>Thanks,
> > >>
> > >>Ali Sadik Kumlali
> > >>
> > >>__________________________________________________
> > >>Do You Yahoo!?
> > >>Tired of spam? Yahoo! Mail has the best spam protection around 
> > >>http://mail.yahoo.com 
> > >>
> > >> 
> > >>
> > >
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Tired of spam? Yahoo! Mail has the best spam protection around 
> > >http://mail.yahoo.com 
> > >
> > >
> > > 
> > >
> > 
> > -- 
> > Thanks,
> > Deepal
> > ................................................................
> > ~Future is Open~ 
> > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


		
---------------------------------
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.

Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5

Posted by Latha Venkat <ac...@yahoo.com>.
Hello 
  I have a service A that invokes service B  just by using call.invoke , after setting all the targetendpoint address , parameters and operation name .
  This works fine . 
   But If  I use another testclient to invoke Service A,  I'm getting an InstantiationException while trying to invoke Service A.
  By using the same Test client I'm able to invoke Service B all by itself , 
   
  Can anyone please help me with this , 
   
   
  Thankyou 
  Latha 

Latha Venkat <ac...@yahoo.com> wrote:
    Hello
  I'mtrying to do the same in axis1.3 ie my web service invoking another web service , does anyone have any code sample 
   
   
  Thankyou 
  Latha 

Ali Sadik Kumlali <as...@yahoo.com> wrote:
  Deepal,

I've just tried it with axis2 war distribution (RC5) and got NPE.

Here is my code snippet that uses ListenerManager:

---------------------------------------------------------
System.out.println("ListenerManager.defaultConfigurationContext: " +
ListenerManager.defaultConfigurationContext);
System.out.println("ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
" +
ListenerManager.defaultConfigurationContext.getServiceGroupContexts());
com.mycompany.service.test.account.AccountServicesStub stub = new
com.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,
targetEndpoint);
---------------------------------------------------------

Here is the output:

---------------------------------------------------------
ListenerManager.defaultConfigurationContext:
org.apache.axis2.context.ConfigurationContext@1453d72
ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
{}
java.lang.NullPointerException
at
org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)
at
org.apache.axis2.client.ServiceClient.(ServiceClient.java:101)
at
com.mycompany.service.test.account.AccountServicesStub.(AccountServicesStub.java:329)
at 
...
---------------------------------------------------------

What I've seen from the output is
ListenerManager.defaultConfigurationContext is successfully set as it's
not null. But I cannot think furthermore :-)

What should I do?

Thanks a lot.

Ali Sadik Kumlali


--- Ali Sadik Kumlali wrote:

> Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result.
> 
> Best regards,
> 
> Ali Sadik Kumlali
> 
> --- Deepal Jayasinghe wrote:
> 
> > You can have this with Axis2 RC or above :)
> > 
> > You have to follow the following procedure for doing this
> > - When you creating stub , it has a constructor which take
> > configuration context as argument.
> > - So pass that as "ListenerManager.defaultConfigurationContext"
> > - In this case client will be created using server configuration
> > context
> > - And this will work in axis2 war distribution out of the box
> > 
> > Note : In the case of AxisServlet , it will create a
> ListenerManager
> > and
> > will set defaultConfigurationContext as the server configuration
> > context.
> > 
> > If you are using some other thing say simpleHTTPServer then you
> have
> > to
> > do the following procedure.
> > - Create a ConfigurationConetx using some axis2.xml and that
> > axis2.xml can have all the transport listeners that you want
> > - Then create a ListenerManager
> > - and call startSystem
> > - and finally
> > ListenerManager.defaultConfigurationContext=
> > configurationcotext;
> > 
> > Ali Sadik Kumlali wrote:
> > 
> > >Hi all,
> > >
> > >Since there is no response yet, I assume that my posting had a
> lack
> > of
> > >information :)
> > >
> > >Here is my scenario:
> > >1) I have serviceA.wsdl and serviceB.wsdl. 
> > >2) I generate skeletons and stubs with WSDL2Java
> > >3) I have serviceA.aar which has serviceB.wsdl's stub
> > >4) When I call serviceB's stub from a class found in serviceA.aar,
> > my
> > >soap message does not have addressing and security headers.
> > >5) When I explicitly pass a repository location to constructor of
> > >serviceB's stub, it fails saying double initialization of
> addressing
> > >and security modules.
> > >6) It cannot find the modules and gives me error when I try to
> > engage
> > >the addressing and security modules by following code: 
> > > stubB._getServiceClient().engageModule(new QName("addressing"));
> > > stubB._getServiceClient().engageModule(new QName("security"));
> > >
> > >Thanks again.
> > >
> > >Ali Sadik Kumlali
> > >
> > >
> > >--- Ali Sadik Kumlali wrote:
> > >
> > > 
> > >
> > >>Hi all,
> > >>
> > >>I need my service to call another service. But, it somehow cannot
> > see
> > >>modules and thus doesn't add security/addressing headers.
> > >>
> > >>I tried engaging the modules manually as in test client. But, it
> > >>couldn't find the modules.
> > >>
> > >>Any help would be appreciated.
> > >>
> > >>Thanks,
> > >>
> > >>Ali Sadik Kumlali
> > >>
> > >>__________________________________________________
> > >>Do You Yahoo!?
> > >>Tired of spam? Yahoo! Mail has the best spam protection around 
> > >>http://mail.yahoo.com 
> > >>
> > >> 
> > >>
> > >
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Tired of spam? Yahoo! Mail has the best spam protection around 
> > >http://mail.yahoo.com 
> > >
> > >
> > > 
> > >
> > 
> > -- 
> > Thanks,
> > Deepal
> > ................................................................
> > ~Future is Open~ 
> > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

    
---------------------------------
  Get amazing travel prices for air and hotel in one click on Yahoo! FareChase 

		
---------------------------------
Get amazing travel prices for air and hotel in one click on Yahoo! FareChase 

Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5

Posted by Latha Venkat <ac...@yahoo.com>.
Hello
  I'mtrying to do the same in axis1.3 ie my web service invoking another web service , does anyone have any code sample 
   
   
  Thankyou 
  Latha 

Ali Sadik Kumlali <as...@yahoo.com> wrote:
  Deepal,

I've just tried it with axis2 war distribution (RC5) and got NPE.

Here is my code snippet that uses ListenerManager:

---------------------------------------------------------
System.out.println("ListenerManager.defaultConfigurationContext: " +
ListenerManager.defaultConfigurationContext);
System.out.println("ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
" +
ListenerManager.defaultConfigurationContext.getServiceGroupContexts());
com.mycompany.service.test.account.AccountServicesStub stub = new
com.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,
targetEndpoint);
---------------------------------------------------------

Here is the output:

---------------------------------------------------------
ListenerManager.defaultConfigurationContext:
org.apache.axis2.context.ConfigurationContext@1453d72
ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
{}
java.lang.NullPointerException
at
org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)
at
org.apache.axis2.client.ServiceClient.(ServiceClient.java:101)
at
com.mycompany.service.test.account.AccountServicesStub.(AccountServicesStub.java:329)
at 
...
---------------------------------------------------------

What I've seen from the output is
ListenerManager.defaultConfigurationContext is successfully set as it's
not null. But I cannot think furthermore :-)

What should I do?

Thanks a lot.

Ali Sadik Kumlali


--- Ali Sadik Kumlali wrote:

> Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result.
> 
> Best regards,
> 
> Ali Sadik Kumlali
> 
> --- Deepal Jayasinghe wrote:
> 
> > You can have this with Axis2 RC or above :)
> > 
> > You have to follow the following procedure for doing this
> > - When you creating stub , it has a constructor which take
> > configuration context as argument.
> > - So pass that as "ListenerManager.defaultConfigurationContext"
> > - In this case client will be created using server configuration
> > context
> > - And this will work in axis2 war distribution out of the box
> > 
> > Note : In the case of AxisServlet , it will create a
> ListenerManager
> > and
> > will set defaultConfigurationContext as the server configuration
> > context.
> > 
> > If you are using some other thing say simpleHTTPServer then you
> have
> > to
> > do the following procedure.
> > - Create a ConfigurationConetx using some axis2.xml and that
> > axis2.xml can have all the transport listeners that you want
> > - Then create a ListenerManager
> > - and call startSystem
> > - and finally
> > ListenerManager.defaultConfigurationContext=
> > configurationcotext;
> > 
> > Ali Sadik Kumlali wrote:
> > 
> > >Hi all,
> > >
> > >Since there is no response yet, I assume that my posting had a
> lack
> > of
> > >information :)
> > >
> > >Here is my scenario:
> > >1) I have serviceA.wsdl and serviceB.wsdl. 
> > >2) I generate skeletons and stubs with WSDL2Java
> > >3) I have serviceA.aar which has serviceB.wsdl's stub
> > >4) When I call serviceB's stub from a class found in serviceA.aar,
> > my
> > >soap message does not have addressing and security headers.
> > >5) When I explicitly pass a repository location to constructor of
> > >serviceB's stub, it fails saying double initialization of
> addressing
> > >and security modules.
> > >6) It cannot find the modules and gives me error when I try to
> > engage
> > >the addressing and security modules by following code: 
> > > stubB._getServiceClient().engageModule(new QName("addressing"));
> > > stubB._getServiceClient().engageModule(new QName("security"));
> > >
> > >Thanks again.
> > >
> > >Ali Sadik Kumlali
> > >
> > >
> > >--- Ali Sadik Kumlali wrote:
> > >
> > > 
> > >
> > >>Hi all,
> > >>
> > >>I need my service to call another service. But, it somehow cannot
> > see
> > >>modules and thus doesn't add security/addressing headers.
> > >>
> > >>I tried engaging the modules manually as in test client. But, it
> > >>couldn't find the modules.
> > >>
> > >>Any help would be appreciated.
> > >>
> > >>Thanks,
> > >>
> > >>Ali Sadik Kumlali
> > >>
> > >>__________________________________________________
> > >>Do You Yahoo!?
> > >>Tired of spam? Yahoo! Mail has the best spam protection around 
> > >>http://mail.yahoo.com 
> > >>
> > >> 
> > >>
> > >
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Tired of spam? Yahoo! Mail has the best spam protection around 
> > >http://mail.yahoo.com 
> > >
> > >
> > > 
> > >
> > 
> > -- 
> > Thanks,
> > Deepal
> > ................................................................
> > ~Future is Open~ 
> > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


		
---------------------------------
Get amazing travel prices for air and hotel in one click on Yahoo! FareChase 

Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5

Posted by Ali Sadik Kumlali <as...@yahoo.com>.
Hi again,

Sorry for this much postings :(

My messages was directed to the TCP/IP Monitor's port. I changed it to
the port of the actual service and there is no such error anymore. 

But, I turned back to my first situation :) I still does not have
addressing and security headers.

Thanks,

Ali Sadik Kumlali

--- Ali Sadik Kumlali <as...@yahoo.com> wrote:

> Hi Deepal,
> 
> I found that the cause of NPE is "unassinged parent". If the service
> is
> already registered in axisConfig it doesn't enter in the code that
> assings a parent to the service. Also, it doesn't uses the parent of
> the registered service.
> 
> The code causes NPE is here:
> ----------------------------------------------------------------
> // org.apache.axis2.client.ServiceClient
> public ServiceClient(ConfigurationContext configContext,
>                      AxisService axisService) throws AxisFault {
> 
>   ...
>   // If the service is already registered, it doesn't enter
>   // here so there will be no parent.
>   if (this.axisConfig.getService(this.axisService.getName()) == null)
> {
>     this.axisConfig.addService(this.axisService);
>   }
>   ServiceGroupContext sgc = new
> ServiceGroupContext(this.configContext,
>                 (AxisServiceGroup) this.axisService.getParent());
>   this.serviceContext = sgc.getServiceContext(this.axisService);
> }
> ----------------------------------------------------------------
> 
> 
> 
> Here is the my way of passing this problem:
> 
> ----------------------------------------------------------------
> // org.apache.axis2.client.ServiceClient
> public ServiceClient(ConfigurationContext configContext,
>                      AxisService axisService) throws AxisFault {
> 
>   ...
>   AxisService service = null;
>   AxisService registeredService = 
>     this.axisConfig.getService(this.axisService.getName());
>   if (registeredService != null) {
>     service = registeredService;
>   } else {
>     this.axisConfig.addService(this.axisService);
>     service = this.axisService;
>   }
>     
>   ServiceGroupContext sgc = new
> ServiceGroupContext(this.configContext,
>             (AxisServiceGroup) service.getParent());  
>   this.serviceContext = sgc.getServiceContext(service);
> }
> ----------------------------------------------------------------
> 
> 
> But I'm still having an exception that says:
> 
> ----------------------------------------------------------------
> ...
> 	at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> 	at java.lang.Thread.run(Thread.java:595)
> [ERROR]
>
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/axis2].[jsp]
> - Servlet.service() for servlet jsp threw exception
> java.lang.IllegalStateException: getOutputStream() has already been
> called for this response
> 	at
> org.apache.catalina.connector.Response.getWriter(Response.java:606)
> 	at
>
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)
> 	at
>
org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
> ----------------------------------------------------------------
> 
> Thanks,
> 
> Ali Sadik Kumlali
> 
> --- Ali Sadik Kumlali <as...@yahoo.com> wrote:
> 
> > Deepal,
> > 
> > I've just tried it with axis2 war distribution (RC5) and got NPE.
> > 
> > Here is my code snippet that uses ListenerManager:
> > 
> > ---------------------------------------------------------
> > System.out.println("ListenerManager.defaultConfigurationContext: "
> +
> > ListenerManager.defaultConfigurationContext);
> >
>
System.out.println("ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
> > " +
> >
>
ListenerManager.defaultConfigurationContext.getServiceGroupContexts());
> > com.mycompany.service.test.account.AccountServicesStub stub = new
> >
>
com.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,
> > targetEndpoint);
> > ---------------------------------------------------------
> > 
> > Here is the output:
> > 
> > ---------------------------------------------------------
> > ListenerManager.defaultConfigurationContext:
> > org.apache.axis2.context.ConfigurationContext@1453d72
> >
>
ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
> > {}
> > java.lang.NullPointerException
> > 	at
> >
>
org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)
> > 	at
> >
> org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:101)
> > 	at
> >
>
com.mycompany.service.test.account.AccountServicesStub.<init>(AccountServicesStub.java:329)
> > 	at 
> > ...
> > ---------------------------------------------------------
> > 
> > What I've seen from the output is
> > ListenerManager.defaultConfigurationContext is successfully set as
> > it's
> > not null. But I cannot think furthermore :-)
> > 
> > What should I do?
> > 
> > Thanks a lot.
> > 
> > Ali Sadik Kumlali
> > 
> > 
> > --- Ali Sadik Kumlali <as...@yahoo.com> wrote:
> > 
> > > Thanks Deepal. I'll try it with 1.0 RC3 and let you know the
> > result.
> > > 
> > > Best regards,
> > > 
> > > Ali Sadik Kumlali
> > > 
> > > --- Deepal Jayasinghe <de...@opensource.lk> wrote:
> > > 
> > > > You can have this with Axis2 RC or above :)
> > > > 
> > > > You have to follow the following procedure for doing this
> > > >   - When you creating stub , it has a constructor which take
> > > > configuration context as argument.
> > > >   - So pass that as
> "ListenerManager.defaultConfigurationContext"
> > > >   - In this case client will be created using server
> > configuration
> > > > context
> > > >   - And this will work in axis2 war distribution out of the box
> > > > 
> > > > Note : In the case of AxisServlet , it will create a
> > > ListenerManager
> > > > and
> > > > will set defaultConfigurationContext as the server
> configuration
> > > > context.
> > > > 
> > > > If you are using some other thing say simpleHTTPServer then you
> > > have
> > > > to
> > > > do the following procedure.
> > > >    - Create a ConfigurationConetx using some axis2.xml and that
> > > > axis2.xml can have all the transport listeners that you want
> > > >    - Then create a ListenerManager
> > > >    - and  call startSystem
> > > >    - and finally
> > > >       ListenerManager.defaultConfigurationContext=
> > > > configurationcotext;
> > > > 
> > > > Ali Sadik Kumlali wrote:
> > > > 
> > > > >Hi all,
> > > > >
> > > > >Since there is no response yet, I assume that my posting had a
> > > lack
> > > > of
> > > > >information :)
> > > > >
> > > > >Here is my scenario:
> > > > >1) I have serviceA.wsdl and serviceB.wsdl. 
> > > > >2) I generate skeletons and stubs with WSDL2Java
> > > > >3) I have serviceA.aar which has serviceB.wsdl's stub
> > > > >4) When I call serviceB's stub from a class found in
> > serviceA.aar,
> > > > my
> > > > >soap message does not have addressing and security headers.
> > > > >5) When I explicitly pass a repository location to constructor
> > of
> > > > >serviceB's stub, it fails saying double initialization of
> > > addressing
> > > > >and security modules.
> > > > >6) It cannot find the modules and gives me error when I try to
> > > > engage
> > > > >the addressing and security modules by following code: 
> > > > >  stubB._getServiceClient().engageModule(new
> > QName("addressing"));
> > > > >  stubB._getServiceClient().engageModule(new
> QName("security"));
> > > > >
> > > > >Thanks again.
> > > > >
> > > > >Ali Sadik Kumlali
> > > > >
> > > > >
> > > > >--- Ali Sadik Kumlali <as...@yahoo.com> wrote:
> > > > >
> > > > >  
> > > > >
> > > > >>Hi all,
> > > > >>
> > > > >>I need my service to call another service. But, it somehow
> > cannot
> > > > see
> > > > >>modules and thus doesn't add security/addressing headers.
> > > > >>
> > > > >>I tried engaging the modules manually as in test client. But,
> > it
> > > > >>couldn't find the modules.
> > > > >>
> > > > >>Any help would be appreciated.
> > > > >>
> > > > >>Thanks,
> > > > >>
> > > > >>Ali Sadik Kumlali
> > > > >>
> > > > >>__________________________________________________
> > > > >>Do You Yahoo!?
> > > > >>Tired of spam?  Yahoo! Mail has the best spam protection
> around
> > 
> > > > >>http://mail.yahoo.com 
> > > > >>
> > > > >>    
> > > > >>
> > > > >
> > > > >
> > > > >__________________________________________________
> > > > >Do You Yahoo!?
> > > > >Tired of spam?  Yahoo! Mail has the best spam protection
> around 
> > > > >http://mail.yahoo.com 
> > > > >
> > > > >
> > > > >  
> > > > >
> > > > 
> > > > -- 
> > > > Thanks,
> > > > Deepal
> > > >
> ................................................................
> > > > ~Future is Open~ 
> > > > 
> > > > 
> > > > 
> > > 
> > > 
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around 
> > > http://mail.yahoo.com 
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around 
> > http://mail.yahoo.com 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5

Posted by Ali Sadik Kumlali <as...@yahoo.com>.
Hi Deepal,

I found that the cause of NPE is "unassinged parent". If the service is
already registered in axisConfig it doesn't enter in the code that
assings a parent to the service. Also, it doesn't uses the parent of
the registered service.

The code causes NPE is here:
----------------------------------------------------------------
// org.apache.axis2.client.ServiceClient
public ServiceClient(ConfigurationContext configContext,
                     AxisService axisService) throws AxisFault {

  ...
  // If the service is already registered, it doesn't enter
  // here so there will be no parent.
  if (this.axisConfig.getService(this.axisService.getName()) == null) {
    this.axisConfig.addService(this.axisService);
  }
  ServiceGroupContext sgc = new ServiceGroupContext(this.configContext,
                (AxisServiceGroup) this.axisService.getParent());
  this.serviceContext = sgc.getServiceContext(this.axisService);
}
----------------------------------------------------------------



Here is the my way of passing this problem:

----------------------------------------------------------------
// org.apache.axis2.client.ServiceClient
public ServiceClient(ConfigurationContext configContext,
                     AxisService axisService) throws AxisFault {

  ...
  AxisService service = null;
  AxisService registeredService = 
    this.axisConfig.getService(this.axisService.getName());
  if (registeredService != null) {
    service = registeredService;
  } else {
    this.axisConfig.addService(this.axisService);
    service = this.axisService;
  }
    
  ServiceGroupContext sgc = new ServiceGroupContext(this.configContext,
            (AxisServiceGroup) service.getParent());  
  this.serviceContext = sgc.getServiceContext(service);
}
----------------------------------------------------------------


But I'm still having an exception that says:

----------------------------------------------------------------
...
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Thread.java:595)
[ERROR]
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/axis2].[jsp]
- Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been
called for this response
	at org.apache.catalina.connector.Response.getWriter(Response.java:606)
	at
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)
	at
org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
----------------------------------------------------------------

Thanks,

Ali Sadik Kumlali

--- Ali Sadik Kumlali <as...@yahoo.com> wrote:

> Deepal,
> 
> I've just tried it with axis2 war distribution (RC5) and got NPE.
> 
> Here is my code snippet that uses ListenerManager:
> 
> ---------------------------------------------------------
> System.out.println("ListenerManager.defaultConfigurationContext: " +
> ListenerManager.defaultConfigurationContext);
>
System.out.println("ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
> " +
>
ListenerManager.defaultConfigurationContext.getServiceGroupContexts());
> com.mycompany.service.test.account.AccountServicesStub stub = new
>
com.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,
> targetEndpoint);
> ---------------------------------------------------------
> 
> Here is the output:
> 
> ---------------------------------------------------------
> ListenerManager.defaultConfigurationContext:
> org.apache.axis2.context.ConfigurationContext@1453d72
>
ListenerManager.defaultConfigurationContext.getServiceGroupContexts():
> {}
> java.lang.NullPointerException
> 	at
>
org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)
> 	at
> org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:101)
> 	at
>
com.mycompany.service.test.account.AccountServicesStub.<init>(AccountServicesStub.java:329)
> 	at 
> ...
> ---------------------------------------------------------
> 
> What I've seen from the output is
> ListenerManager.defaultConfigurationContext is successfully set as
> it's
> not null. But I cannot think furthermore :-)
> 
> What should I do?
> 
> Thanks a lot.
> 
> Ali Sadik Kumlali
> 
> 
> --- Ali Sadik Kumlali <as...@yahoo.com> wrote:
> 
> > Thanks Deepal. I'll try it with 1.0 RC3 and let you know the
> result.
> > 
> > Best regards,
> > 
> > Ali Sadik Kumlali
> > 
> > --- Deepal Jayasinghe <de...@opensource.lk> wrote:
> > 
> > > You can have this with Axis2 RC or above :)
> > > 
> > > You have to follow the following procedure for doing this
> > >   - When you creating stub , it has a constructor which take
> > > configuration context as argument.
> > >   - So pass that as "ListenerManager.defaultConfigurationContext"
> > >   - In this case client will be created using server
> configuration
> > > context
> > >   - And this will work in axis2 war distribution out of the box
> > > 
> > > Note : In the case of AxisServlet , it will create a
> > ListenerManager
> > > and
> > > will set defaultConfigurationContext as the server configuration
> > > context.
> > > 
> > > If you are using some other thing say simpleHTTPServer then you
> > have
> > > to
> > > do the following procedure.
> > >    - Create a ConfigurationConetx using some axis2.xml and that
> > > axis2.xml can have all the transport listeners that you want
> > >    - Then create a ListenerManager
> > >    - and  call startSystem
> > >    - and finally
> > >       ListenerManager.defaultConfigurationContext=
> > > configurationcotext;
> > > 
> > > Ali Sadik Kumlali wrote:
> > > 
> > > >Hi all,
> > > >
> > > >Since there is no response yet, I assume that my posting had a
> > lack
> > > of
> > > >information :)
> > > >
> > > >Here is my scenario:
> > > >1) I have serviceA.wsdl and serviceB.wsdl. 
> > > >2) I generate skeletons and stubs with WSDL2Java
> > > >3) I have serviceA.aar which has serviceB.wsdl's stub
> > > >4) When I call serviceB's stub from a class found in
> serviceA.aar,
> > > my
> > > >soap message does not have addressing and security headers.
> > > >5) When I explicitly pass a repository location to constructor
> of
> > > >serviceB's stub, it fails saying double initialization of
> > addressing
> > > >and security modules.
> > > >6) It cannot find the modules and gives me error when I try to
> > > engage
> > > >the addressing and security modules by following code: 
> > > >  stubB._getServiceClient().engageModule(new
> QName("addressing"));
> > > >  stubB._getServiceClient().engageModule(new QName("security"));
> > > >
> > > >Thanks again.
> > > >
> > > >Ali Sadik Kumlali
> > > >
> > > >
> > > >--- Ali Sadik Kumlali <as...@yahoo.com> wrote:
> > > >
> > > >  
> > > >
> > > >>Hi all,
> > > >>
> > > >>I need my service to call another service. But, it somehow
> cannot
> > > see
> > > >>modules and thus doesn't add security/addressing headers.
> > > >>
> > > >>I tried engaging the modules manually as in test client. But,
> it
> > > >>couldn't find the modules.
> > > >>
> > > >>Any help would be appreciated.
> > > >>
> > > >>Thanks,
> > > >>
> > > >>Ali Sadik Kumlali
> > > >>
> > > >>__________________________________________________
> > > >>Do You Yahoo!?
> > > >>Tired of spam?  Yahoo! Mail has the best spam protection around
> 
> > > >>http://mail.yahoo.com 
> > > >>
> > > >>    
> > > >>
> > > >
> > > >
> > > >__________________________________________________
> > > >Do You Yahoo!?
> > > >Tired of spam?  Yahoo! Mail has the best spam protection around 
> > > >http://mail.yahoo.com 
> > > >
> > > >
> > > >  
> > > >
> > > 
> > > -- 
> > > Thanks,
> > > Deepal
> > > ................................................................
> > > ~Future is Open~ 
> > > 
> > > 
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around 
> > http://mail.yahoo.com 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com