RE: [Axis2][0.95] How can my service make call to another service? (More details) - RC5
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:[EMAIL PROTECTED]Sent: Thursday, May 04, 2006 7:11 AMTo: axis-user@ws.apache.orgSubject: 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 <[EMAIL PROTECTED]> 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 = newcom.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,targetEndpoint);-Here is the output:-ListenerManager.defaultConfigurationContext:[EMAIL PROTECTED]ListenerManager.defaultConfigurationContext.getServiceGroupContexts():{}java.lang.NullPointerExceptionatorg.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)atorg.apache.axis2.client.ServiceClient.(ServiceClient.java:101)atcom.mycompany.service.test.account.AccountServicesStub.(AccountServicesStub.java:329)at ...-What I've seen from the output isListenerManager.defaultConfigurationContext is successfully set as it'snot null. But I cannot think furthermore :-)What should I do?Thanks a lot.Ali Sadik Kumlali--- Ali Sadik Kumlali <[EMAIL PROTECTED]>wrote:> Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result.> > Best regards,> > Ali Sadik Kumlali> > --- Deepal Jayasinghe <[EMAIL PROTECTED]>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.> >
Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5
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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 = newcom.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,targetEndpoint);-Here is the output:-ListenerManager.defaultConfigurationContext:[EMAIL PROTECTED]ListenerManager.defaultConfigurationContext.getServiceGroupContexts():{}java.lang.NullPointerExceptionatorg.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)atorg.apache.axis2.client.ServiceClient.(ServiceClient.java:101)atcom.mycompany.service.test.account.AccountServicesStub.(AccountServicesStub.java:329)at ...-What I've seen from the output isListenerManager.defaultConfigurationContext is successfully set as it'snot null. But I cannot think furthermore :-)What should I do?Thanks a lot.Ali Sadik Kumlali--- Ali Sadik Kumlali <[EMAIL PROTECTED]>wrote:> Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result.> > Best regards,> > Ali Sadik Kumlali> > --- Deepal Jayasinghe <[EMAIL PROTECTED]>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 <[EMAIL PROTECTED]>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 > > >>> > >> > > >>> > >> > >> > >__> > >D
Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5
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 <[EMAIL PROTECTED]> 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 = newcom.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,targetEndpoint);-Here is the output:-ListenerManager.defaultConfigurationContext:[EMAIL PROTECTED]ListenerManager.defaultConfigurationContext.getServiceGroupContexts():{}java.lang.NullPointerExceptionatorg.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)atorg.apache.axis2.client.ServiceClient.(ServiceClient.java:101)atcom.mycompany.service.test.account.AccountServicesStub.(AccountServicesStub.java:329)at ...-What I've seen from the output isListenerManager.defaultConfigurationContext is successfully set as it'snot null. But I cannot think furthermore :-)What should I do?Thanks a lot.Ali Sadik Kumlali--- Ali Sadik Kumlali <[EMAIL PROTECTED]>wrote:> Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result.> > Best regards,> > Ali Sadik Kumlali> > --- Deepal Jayasinghe <[EMAIL PROTECTED]>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 <[EMAIL PROTECTED]>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
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 <[EMAIL PROTECTED]> 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 = newcom.mycompany.service.test.account.AccountServicesStub(ListenerManager.defaultConfigurationContext,targetEndpoint);-Here is the output:-ListenerManager.defaultConfigurationContext:[EMAIL PROTECTED]ListenerManager.defaultConfigurationContext.getServiceGroupContexts():{}java.lang.NullPointerExceptionatorg.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)atorg.apache.axis2.client.ServiceClient.(ServiceClient.java:101)atcom.mycompany.service.test.account.AccountServicesStub.(AccountServicesStub.java:329)at ...-What I've seen from the output isListenerManager.defaultConfigurationContext is successfully set as it'snot null. But I cannot think furthermore :-)What should I do?Thanks a lot.Ali Sadik Kumlali--- Ali Sadik Kumlali <[EMAIL PROTECTED]>wrote:> Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result.> > Best regards,> > Ali Sadik Kumlali> > --- Deepal Jayasinghe <[EMAIL PROTECTED]>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 <[EMAIL PROTECTED]>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 > __
Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5
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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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: > > [EMAIL PROTECTED] > > > 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 <[EMAIL PROTECTED]> wrote: > > > > > T
Re: [Axis2][0.95] How can my service make call to another service? (More details) - RC5
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 <[EMAIL PROTECTED]> 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: > [EMAIL PROTECTED] > 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 <[EMAIL PROTECTED]> wrote: > > > Thanks Deepal. I'll try it with 1.0 RC3 and let you know the > result. > > > > Best regards, > > > > Ali Sadik Kumlali > > > > --- Deepal Jayasinghe <[EMAIL PROTECTED]> 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 distribut
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: [EMAIL PROTECTED] 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 <[EMAIL PROTECTED]> wrote: > Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result. > > Best regards, > > Ali Sadik Kumlali > > --- Deepal Jayasinghe <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 > ___
Re: [Axis2][0.95] How can my service make call to another service? (More details)
Thanks Deepal. I'll try it with 1.0 RC3 and let you know the result. Best regards, Ali Sadik Kumlali --- Deepal Jayasinghe <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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
Re: [Axis2][0.95] How can my service make call to another service? (More details)
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 <[EMAIL PROTECTED]> 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~
Re: [Axis2][0.95] How can my service make call to another service? (More details)
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 <[EMAIL PROTECTED]> 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
[Axis2][0.95] How can my service make call to another service?
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