1 Reply Latest reply on Nov 20, 2009 1:14 AM by wyvern_zhang@hotmail.com

    access a SOAP webservice from Clearspace

      Hi All,


      I am new to this webservice idea- however we have something implemented as a webservice and we can make available a wsdl -

      I would like to access that from clearspace as clearspace will be the login point. Is that possible and if yes how would I start in doing so?


      Any examples? I mean I saw quite a lot of documentation on how to access clearspace from a webservice but not the other way around.


      Hints and tips are highly appreciated!!!!


      Thank you so much.


        • Re: access a SOAP webservice from Clearspace

          REST WebService


              public Community createCommunity(Community community) {
                      HttpClient client = new HttpClient();
                      Credentials defaultcreds = new UsernamePasswordCredentials("admin","pw");
                      client.getState().setCredentials(AuthScope.ANY, defaultcreds);
                      PostMethod method = new PostMethod("http://localhost:8080/2512/rpc/rest/communityService/communities");
                      StringRequestEntity xml = new StringRequestEntity(
                          "<createCommunity>" + 
                              "<name><![CDATA[" +  community.getName() + "]]></name>" +
                              "<displayName><![CDATA[" + GURU_COMMUNITY_PREFIX + community.getName() + "]]></displayName>" +
                              "<description><![CDATA[" + community.getName() + "]]></description>" +
                              "<communityID><![CDATA[" + community.getParentCommunityID() + "]]></communityID>" +
                          method.setRequestHeader("Content-Type", "text/xml");
                          InputStream in = method.getResponseBodyAsStream();
                          SAXReader reader = new SAXReader();
                          Document document = reader.read(in);
          //                XMLWriter writer = new XMLWriter(System.out, OutputFormat.createPrettyPrint());
          //                writer.write(document);
                          Node node = document.selectSingleNode("/createCommunityResponse/return/ID");    
                          log.info(community.getName() + " creation  succeedeed.");
                      } catch(Exception e){
                          log.error(community.getName() + " creation  failed.");
                          log.debug(e, e);
                      return community;


          Hope it is helpful to you.