Thank you guys.
Hi Danushke: When I check out the source from your SVN URL, then I went to the “4.2.0” directory to do “mvn clean install”. I got the error on parent relative path. It seems that the pom.xml file from parent directory could not be found. The following I quoted from pom.xml file: <parent> <groupId>org.wso2.carbon</groupId> <artifactId>carbon-service-stubs</artifactId> <version>4.2.0</version> <relativePath>../../pom.xml</relativePath> </parent> What is the easiest way to resolve it? If I trace up all the parent pom files, it will up to https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/ . Should I check out all source from https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/? But if I do, I will check out a lot of redundant sources which I probably do not need. Please advice the most simple way to do it. Thank you! Bill From: Aruna Karunarathna [mailto:[email protected]] Sent: Wednesday, June 10, 2015 8:30 PM To: Danushka Fernando Cc: Bill Liu; WSO2 Developers' List Subject: Re: [Dev] how to add new tenant in java code HI Bill, As Danushka mentioned you can use the tenant.mgt.stub I've added some sample code[1] I wrote for adding tenants. Make sure you set classpath to /server_home/repository/components/plugins folder when running the sample. [1]. https://github.com/arunasujith/tenant-sample On Wed, Jun 10, 2015 at 7:51 PM, Danushka Fernando <[email protected]> wrote: There is an already created stub for tenant management service. Try adding [1] as a dependency. [1] https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/service-stubs/org.wso2.carbon.tenant.mgt.stub/4.2.0/ Thanks & Regards Danushka Fernando Senior Software Engineer WSO2 inc. http://wso2.com/ Mobile : +94716332729 <tel:%2B94716332729> On Jun 11, 2015 7:13 AM, "Bill Liu" <[email protected]> wrote: Hi Isura: Thanks for your advice! Could you please explain how to do that? I’m learning soap APIs nowJ For my understanding, there are two steps I need to do: 1. Generate client side source from WSDL2Java tool 2. Invoke the operation using something like: YourService service = new YourServiceLocator(); Stub stub = service.getYourStub(); stub.operation(); For step 1, I try to generate the java source code from WSO2 application server(AS) 5.2.1. After I login in as admin in the AS UI login page, I went to Tools/WSDL Validator to validate the API, <https://localhost:9443/services/TenantMgtAdminService?wsdl> https://localhost:9443/services/TenantMgtAdminService?wsdl . The validation was successful. Then I went to Tools/WSDL2Java, I use the same soap API for uri to generate java code. But it failed. I have the following error message on the console of my WSO2 AS host: [2015-06-10 18:09:11,114] ERROR {org.apache.catalina.core.StandardWrapperValve} - Servlet.service() for servlet [bridgeservlet] in context with path [/] threw exception java.io.IOException: Stream closed at org.apache.jasper.runtime.BodyContentImpl.ensureOpen(BodyContentImpl.java:626) at org.apache.jasper.runtime.BodyContentImpl.write(BodyContentImpl.java:114) at org.apache.jsp.wsdl2code.codegen_005fajaxprocessor_jsp._jspService(org.apache.jsp.wsdl2code.codegen_005fajaxprocessor_jsp:110) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:155) at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.wso2.carbon.statistics.webapp.RequestIntercepterValve.invoke(RequestIntercepterValve.java:43) at org.wso2.carbon.bam.webapp.stat.publisher.WebAppStatisticPublisherValve.invoke(WebAppStatisticPublisherValve.java:104) at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178) at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47) at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56) at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47) at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141) at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:701) After all, I have the following questions: 1. How to fix the WSDL2Java error above? 2. Please explain the steps how to use soap API to add new tenants. Specific instructions will be highly appreciated. Sorry, I’m kind of new to soap API. Thanks in advance! Best, Bill From: Isura Karunaratne [mailto:[email protected]] Sent: Monday, June 08, 2015 6:34 PM To: Bill Liu Cc: WSO2 Developers' List Subject: Re: [Dev] how to add new tenant in java code HI Bill, You can use TenantMgtAdminService [1] soap APIs to add new tenants. [1] https://localhost:9443/services/TenantMgtAdminService?wsdl Thanks Isura On Tue, Jun 9, 2015 at 5:13 AM, Bill Liu <[email protected]> wrote: Greetings all: In URL https://docs.wso2.com/display/AS521/Managing+Tenants , there is an instruction how to add new tenant in management console. But I want to know how to add new tenant in java code, after starting application server. The point here is that I want to write a front end page with a servlet, which adding new tenant from a form in JSP file. The servlet is written in Java. So is there any sample code for adding new tenant in Java? Thanks in advance! Bill _______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev -- Isura Dilhara Karunaratne Senior Software Engineer Mob +94 772 254 810 <tel:%2B94%20772%20254%20810> _______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev _______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev -- Aruna Sujith Karunarathna | Software Engineer WSO2, Inc | lean. enterprise. middleware. #20, Palm Grove, Colombo 03, Sri Lanka Mobile: +94 71 9040362 | Work: +94 112145345 Email: [email protected] | Web: <http://www.wso2.com/> www.wso2.com
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
