Here is a client which does the default operation:

http://www.internet2.edu/grouper/release/trunk/authzStandardApi.client-1.0.tar.gz

C:\temp\asac>dir
 Volume in drive C is Windows8_OS
 Volume Serial Number is BADA-F0D1

 Directory of C:\temp\asac

11/14/2012  01:16 AM    <DIR>          .
11/14/2012  01:16 AM    <DIR>          ..
11/14/2012  12:28 AM             3,725 authzStandardApi.client.base.properties
11/14/2012  01:18 AM               748 authzStandardApi.client.properties
11/14/2012  01:20 AM         5,483,453 authzStandardApiClient.jar
               3 File(s)      5,487,926 bytes
               2 Dir(s)  445,290,545,152 bytes free




C:\temp\asac>more authzStandardApi.client.properties
########################################
## Web service Connection settings
########################################

# url of web service, should include everything up to the first resource to access
# e.g. http://authz.school.edu:8090/authzStandardApi/authzStandardApi
# e.g. https://authz.school.edu/authzStandardApi/authzStandardApi
authzStandardApiClient.webService.url = https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi

# kerberos principal used to connect to web service
authzStandardApiClient.webService.login = temporaryTest

# password for shared secret authentication to web service
# or you can put a filename with an encrypted password
authzStandardApiClient.webService.password = ***************







C:\temp\asac>java -jar authzStandardApiClient.jar
log4j:WARN No appenders could be found for logger (edu.internet2.middleware.authzStandardApiClient.config.AsacConfigPropertiesCascadeBase).
log4j:WARN Please initialize the log4j system properly.
Authz Standard API Client USAGE:

This program runs queries against an Authz Standard API Service
The system exit code will be 0 for success, and not 0 for failure
Output data is printed to stdout, error messages are printed to stderr or logs (configured in authzStandardApi.client.properties)
Authz Standards API Client webpage: https://wiki.internet2.edu/confluence/display/cifer/Authz+Standard+API+client

Arguments are in the format: --argName=argValue
Example argument: --operation=encryptPassword
Example argument(OS dependent): --operation="value with whitespace"

Optional arguments below are in [brackets]

###############################################
## Web Service operations

defaultResourceWs web service usage:
  java -jar authzStandardApiClient.jar --operation=defaultResourceWs [--outputTemplate=somePattern] [--format=xml|json] [--debug=true]
  e.g.: java -jar authzStandardApiClient.jar --operation=defaultResourceWs
  output:
    success: true
    xml: https://authz.school.edu/authzStandardApi/authzStandardApi.xml
    json: https://authz.school.edu/authzStandardApi/authzStandardApi.json
  

testSuite usage:
  java -jar authzStandardApiClient.jar --operation=testSuite --verbose=low|medium|high
  e.g.: java -jar authzStandardApiClient.jar --operation=testSuite --verbose=high


###############################################
Common options:
  --outputTemplate=${index}: ${someObject.propertyName}
    the output template allow the caller to customize what is displayed in the output from the XML/JSON
    anything in ${} will be evaluated, and there are different variables available for various operations.
    if you pass in --debug=true, it will tell you the xml and the variables you can use.  You can drill down
    in the variables, e.g. ${someContainer.someObject.descriptino}, you can do operations, e.g. ${index+1},
    you can do simple string utilities from StandardApiClientUtils or StandardApiClientCommonUtils, e.g.
    ${standardApiClientUtils.trimToEmpty(someGroup.name)}

  --debug=true
    this will display debug information including the request and response to stderr

  --saveResultsToFile=/tmp/somefile.txt
    you can save the stdout to a file if you like

  --actAsSubjectUri=a:subjId
    if you want to run the operation as a different user than the user who is authenticating
    to the web service, then specify the actAsSubjectUri.  You would do this e.g. to run a command 
    as admin, or as a user who is using the end layer application.  Note you need permissions 
    to do this in the Authz Standard API server.

  --clientVersion=v1
    generally this does not need to be changed.  This is the version label sent to the web service
    which might affect the output from the web service.  It might also affect the request to the web 
    service








C:\temp\asac>java -jar authzStandardApiClient.jar --operation=defaultResourceWs
success: true
xml: https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi.xml
json: https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi.json




C:\temp\asac>java -jar authzStandardApiClient.jar --operation=defaultResourceWs --debug=true
DEBUG: Reading resource: authzStandardApi.client.properties, from: C:\temp\asac\authzStandardApi.client.properties
DEBUG: WebService: connecting as user: 'temporaryTest'
DEBUG: WebService: connecting to URL: 'https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi'

################ REQUEST START ###############

GET /grouper-ws_v2_0_0/authzStandardApi HTTP/1.1
Connection: close
Authorization: Basic xxxxxxxxxxxxxxxx
User-Agent: Jakarta Commons-HttpClient/3.1
Host: grouperdemo.internet2.edu:-1



################ REQUEST END ###############



################ RESPONSE START (indented) ###############

HTTP/1.1 200 OK
Date: Tue, 13 Nov 2012 06:22:08 GMT
Content-Type: text/x-json;charset=UTF-8
Content-Length: 597
Connection: close

{
  "asasDefaultResource":{
    "jsonDefaultUri":"https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi.json",
    "xmlDefaultUri":"https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi.xml"
  },
  "meta":{
    "lastModified":"2012-11-04T09:57:03.541Z",
    "selfUri":"https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi",
    "statusCode":"SUCCESS",
    "structureName":"defaultResourceContainer",
    "success":true
  },
  "responseMeta":{
    "httpStatusCode":200,
    "millis":2
  },
  "serviceMeta":{
    "serverVersion":"1.0",
    "serviceRootUri":"https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi"
  }
}

################ RESPONSE END ###############


DEBUG: Output template: success: ${meta.success}
xml: ${asacDefaultResource.xmlDefaultUri}
json: ${asacDefaultResource.jsonDefaultUri}, available variables: asacDefaultResourceContainer, asacDefaultResource, meta, responseMeta, serviceMeta
DEBUG: Subsituting EL: 'success: ${meta.success}
xml: ${asacDefaultResource.xmlDefaultUri}
json: ${asacDefaultResource.jsonDefaultUri}
', and with env vars: asacDefaultResourceContainer, asacDefaultResource, meta, responseMeta, serviceMeta, elUtils with result: 'success: true
xml: https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi.xml
json: https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi.json
'
success: true
xml: https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi.xml
json: https://grouperdemo.internet2.edu/grouper-ws_v2_0_0/authzStandardApi.json
DEBUG: Elapsed time: 984ms

C:\temp\asac>
  • No labels