Hi Ivy
Thanks for the response. You'r right I should have posted the generated code, but the invocation, and response was so simple I didn't think of it.
Simplified the calls are
System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");
GetUserCollectionFromGroupResult usersCollection = null;
Object o = null;
UserGroup service = new UserGroup();
UserGroupSoap port = service.getUserGroupSoap();
usersCollection = port.getUserCollectionFromGroup(Settings.usersGroup);
The returned usersCollection only contains one element, which is "groupName" with value "null".
Unfortunately Microsoft seem to love to use the ANY element in almost all their WSDL definitions. I have several working, including Authentication, Webs, Lists, Versions, but this one just won't go.
I think it's possible to overwrite the default receiver code, but earlier today I decided it probably would be easier to just write my own simple SOAP client, rather to try and figure out to fix the JAX-WS receiver. So even though it's probably not the most correct approach, it got the work done.
Here's the code in all it horror.
I'm new to Java, so go easy on me ;-)
HashMap<String, String> users = null;
String SOAPUrl = Settings.userListWebServiceURL;
String SOAPAction = "http://schemas.microsoft.com/sharepoint/soap/directory/GetUserCollectionFromGroup";
// Create the connection.
URL url = new URL(SOAPUrl);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
StringBuilder sb = new StringBuilder();
sb.append("<?xml version=\"1.0\" ?><S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body><GetUserCollectionFromGroup xmlns=\"http://schemas.microsoft.com/sharepoint/soap/directory/\"><groupName>");
sb.append(Settings.usersGroup);
sb.append("</groupName></GetUserCollectionFromGroup></S:Body></S:Envelope>");
byte[] b = sb.toString().getBytes("UTF-8");
// Set the appropriate HTTP parameters.
httpConn.setRequestProperty("Content-Length", String.valueOf( b.length ) );
httpConn.setRequestProperty("Content-Type","text/xml; charset=utf-8");
httpConn.setRequestProperty("SOAPAction",SOAPAction);
httpConn.setRequestMethod( "POST" );
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
// Everything's set up; send the XML that was read in to b.
OutputStream out = httpConn.getOutputStream();
out.write( b );
out.flush();
out.close();
// Setup to receive the result and convert stream to DOM Document
DOMParser parser = new DOMParser();
InputStreamReader in = new InputStreamReader(httpConn.getInputStream());
InputSource source = new InputSource(in);
parser.parse(source);
org.w3c.dom.Document d = parser.getDocument();
in.close();
httpConn.disconnect();
// Read the DOM and contruct a Hashmap with username to e-mail mapping.
NodeList nl = d.getElementsByTagName("User");
users = new HashMap<String, String>();
for (int i = 0; i < nl.getLength(); i++) {
NamedNodeMap attr = nl.item(i).getAttributes();
users.put(attr.getNamedItem("LoginName").getNodeValue(), attr.getNamedItem("Email").getNodeValue());
}