Skip to Content.
Sympa Menu

grouper-users - [grouper-users] RE: Server not responding while using Delete member lite service

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] RE: Server not responding while using Delete member lite service

Chronological Thread 
  • From: Chris Hyzer <>
  • To: "Doppala, Karthik" <>, "" <>
  • Subject: [grouper-users] RE: Server not responding while using Delete member lite service
  • Date: Wed, 18 Dec 2013 13:34:49 +0000
  • Accept-language: en-US

Btw, its also a good idea to urlencode things you put in the path, in this case the group name and subjectId…    I didn’t do it in my example here to be consistent with your example, but you will see it is done in the sample in svn…  note: this is not your problem, but thought I would mention J





From: [mailto:] On Behalf Of Chris Hyzer
Sent: Wednesday, December 18, 2013 8:32 AM
To: Doppala, Karthik;
Subject: [grouper-users] RE: Server not responding while using Delete member lite service


It works for me.  Are you sure you have the right URL and everything else?


This is based on this example:


From this page:    (click samples)


This is my request:


DELETE /grouperWs/servicesRest/xml/v2_0_0/groups/test:testGroup/members/test.subject.1 HTTP/1.1

Connection: close

Authorization: Basic R3JvdXBlclN5cXXXXXXXXXXXXXXXXXXX==

User-Agent: Jakarta Commons-HttpClient/3.0

Host: localhost:8088


This is my response:


HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

Pragma: No-cache

Cache-Control: no-cache

Expires: Wed, 31 Dec 1969 19:00:00 EST

Set-Cookie: JSESSIONID=AF7B6426D438E2557F59AB77D8F5CB89; Path=/grouperWs

X-Grouper-resultCode: SUCCESS

X-Grouper-success: T

X-Grouper-resultCode2: NONE

Content-Type: text/xml;charset=UTF-8

Date: Wed, 18 Dec 2013 13:26:45 GMT

Connection: close





    <resultMessage>Success for: clientVersion: 2.0.0, wsGroupLookup:

      WsGroupLookup[pitGroups=[],groupName=test:testGroup], subjectLookups: Array size: 1:

      [0]: WsSubjectLookup[subjectId=test.subject.1]


      , actAsSubject: null, fieldName: null, txType: NONE

      , params: null</resultMessage>







    <name>my name is test.subject.1</name>


















This is my java code:



* @author mchyzer

* $Id$




import org.apache.commons.httpclient.Credentials;

import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;

import org.apache.commons.httpclient.Header;

import org.apache.commons.httpclient.HttpClient;

import org.apache.commons.httpclient.UsernamePasswordCredentials;

import org.apache.commons.httpclient.auth.AuthScope;

import org.apache.commons.httpclient.methods.DeleteMethod;

import org.apache.commons.httpclient.params.DefaultHttpParams;

import org.apache.commons.httpclient.params.HttpMethodParams;

import org.apache.commons.lang.StringUtils;










public class SampleDeletePut {



   * @param args


  public static void main(String[] args) {


    try {

      HttpClient httpClient = new HttpClient();



          HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(0, false));


      //URL e.g. http://localhost:8093/grouper-ws/servicesRest/v1_3_000/...

      //NOTE: aStem:aGroup urlencoded substitutes %3A for a colon

      DeleteMethod method = new DeleteMethod(

          "http://localhost:8089/grouperWs" + "/servicesRest/" + WsSampleRestType.xml.getWsLiteResponseContentType().name()

            + "/v2_0_0"

            + "/groups/test:testGroup/members/test.subject.1");



      Credentials defaultcreds = new UsernamePasswordCredentials("GrouperSystem", "xxxxxxxxxxxxxxx");


      //no keep alive so response if easier to indent for tests

      method.setRequestHeader("Connection", "close");


      //e.g. localhost and 8093


          .setCredentials(new AuthScope("localhost", 8089), defaultcreds);




      //make sure a request came back

      Header successHeader = method.getResponseHeader("X-Grouper-success");

      String successString = successHeader == null ? null : successHeader.getValue();

      if (StringUtils.isBlank(successString)) {

        throw new RuntimeException("Web service did not even respond!");


      boolean success = "T".equals(successString);

      String resultCode = method.getResponseHeader("X-Grouper-resultCode").getValue();


      String response = RestClientSettings.responseBodyAsString(method);


      //convert to object (from xhtml, xml, json, etc)

      WsDeleteMemberLiteResult wsDeleteMemberLiteResult = (WsDeleteMemberLiteResult)WsSampleRestType.xml



      String resultMessage = wsDeleteMemberLiteResult.getResultMetadata().getResultMessage();


      // see if request worked or not

      if (!success) {

        throw new RuntimeException("Bad response from web service: resultCode: " + resultCode

            + ", " + resultMessage);



      System.out.println("Server version: " + wsDeleteMemberLiteResult.getResponseMetadata().getServerVersion()

          + ", result code: " + resultCode

          + ", result message: " + resultMessage );


    } catch (Exception e) {

      throw new RuntimeException(e);













From: [] On Behalf Of Doppala, Karthik
Sent: Tuesday, December 17, 2013 2:20 PM
Subject: [grouper-users] Server not responding while using Delete member lite service



I have been having trouble using this service; I am able to add using the same uri  (HTTP PUT), but am unable to get the deleteMemberLite (HTTP  DELETE) working.

Following is the path I am using




I get a NoHttpResponseException (Target server failed to respond).

Can anyone share their thoughts on this?




Archive powered by MHonArc 2.6.16.

Top of Page