Skip to Content.
Sympa Menu

grouper-users - RE: RE: RE: [grouper-users] remote grouper java client

Subject: Grouper Users - Open Discussion List

List archive

RE: RE: RE: [grouper-users] remote grouper java client


Chronological Thread 
  • From: Chris Hyzer <>
  • To: mohan shamachar <>, "" <>
  • Subject: RE: RE: RE: [grouper-users] remote grouper java client
  • Date: Wed, 13 Feb 2013 21:49:31 +0000
  • Accept-language: en-US
  • Authentication-results: sfpop-ironport02.merit.edu; dkim=neutral (message not signed) header.i=none

The client code would have to depend on what library you used to generate
from WSDL...

On jaxws, you would do something like this, though I don't know the specifics
about authn with jaxws... I never really got this to work with basic auth...
and you would be doing grouper v2_1, not v2_0...

Thanks,
Chris


/**
* @author mchyzer
* $Id$
*/
package edu.internet2.middleware.grouper.ws.soap_v2_0;

import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;

import javax.xml.ws.BindingProvider;

import
edu.internet2.middleware.grouper.ws.soap_v2_0.xsd.WsGetMembersLiteResult;
import edu.internet2.middleware.grouper.ws.soap_v2_0.xsd.WsSubject;


/**
*
*/
public class GrouperJaxwsExample {

/**
* @param args
*/
public static void main(String[] args) throws Exception {
GrouperServiceV20 grouperServiceV20 = new GrouperServiceV20(new
URL("http://localhost:8089/grouperWs/services/GrouperService_v2_0?wsdl";));

Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new
PasswordAuthentication("GrouperSystem","xxxx".toCharArray());
}
});

GrouperServiceV20PortType grouperServiceV20PortType =
grouperServiceV20.getPort(GrouperServiceV20PortType.class);
BindingProvider bp = (BindingProvider)grouperServiceV20PortType;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:8089/grouperWs/services/GrouperService_v2_0";);
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
"GrouperSystem");
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "xxxx");


WsGetMembersLiteResult wsGetMembersLiteResult =
grouperServiceV20PortType.getMembersLite(
null, "test:testGroup", null,
null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null );

for (WsSubject wsSubject : wsGetMembersLiteResult.getWsSubjects()) {
System.out.println(wsSubject.getId());
}

}

}

-----Original Message-----
From:


[mailto:]
On Behalf Of mohan shamachar
Sent: Wednesday, February 13, 2013 1:59 PM
To:

Subject: Re: RE: RE: [grouper-users] remote grouper java client

Hi Chris,

Is there a simple SOAP grouper client example, that does not use Axis2?
I have generated the required sources/classes using wsimport. I was looking
into the generated client code, however the sample code appears to rely on
Axis2.

thanks,
mohan



Archive powered by MHonArc 2.6.16.

Top of Page