Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3343340
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:56:36+00:00 2026-05-18T00:56:36+00:00

I have a small app which query our SharePoint server’ Web Service interface for

  • 0

I have a small app which query our SharePoint server’ Web Service interface for a list of all users for a group.
I can see the raw HTTP response is coming back with all the users listed, but JAX-WS response object (as created under NetBeans 6.9) contains only a blank Group Name String value. There is no trace of all the user names from the HTTP response.

Anyone know why JAX-WS is not reading in the SOAP response correctly?

The WSDL is to long to post, but is widely accessable from various locations, including this site:
http://www.hezser.de/_vti_bin/UserGroup.asmx?wsdl

Here’s the start of raw HTTP response:

---[HTTP response - http://{server}/_vti_bin/usergroup.asmx - 200]---
null: HTTP/1.1 200 OK
Cache-control: private, max-age=0
Content-type: text/xml; charset=utf-8
Content-length: 136738
X-powered-by: ASP.NET
Server: Microsoft-IIS/6.0
Date: Wed, 22 Sep 2010 20:53:12 GMT
X-aspnet-version: 2.0.50727
Set-cookie: WSS_KeepSessionAuthenticated=80; path=/
Microsoftsharepointteamservices: 12.0.0.6303
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetUserCollectionFromGroupResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/"><GetUserCollectionFromGroupResult><GetUserCollectionFromGroup><Users><User ID="201" Sid="S-1-5-21-1545385408-2720673749-3828181483-1245" ....
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:56:37+00:00Added an answer on May 18, 2026 at 12:56 am

    You’ll need to edit the UserGroup.wsdl manually before generating the stubs. You need to add processContents='skip' to the <s:any> tag where the response is defined.

    <s:element name="GetUserCollectionFromGroupResponse">
     <s:complexType>
      <s:sequence>
        <s:element minOccurs="0" maxOccurs="1" name="GetUserCollectionFromGroupResult">
          <s:complexType mixed="true">
            <s:sequence>
              <!-- Added the "processContents" attribute below -->
              <s:any processContents='skip' />    
            </s:sequence>
          </s:complexType>
        </s:element>
      </s:sequence>
     </s:complexType>
    </s:element>
    

    Then, when processing the response, JAXB will return the children as DOM Elements:

    UserGroup service = new UserGroup();
    UserGroupSoap port = service.getUserGroupSoap();
    
    GetUserCollectionFromGroupResult usersCollection = port.getUserCollectionFromGroup(Settings.usersGroup);
    List<Object> content = usersCollection.getContent();
    org.w3c.dom.Element usersElement = (org.w3c.dom.Element) content.get(0);
    

    Why this works

    The problem is caused by a combination of conditions:

    A. The response returned by the web service contains a <GetUserCollectionFromGroup> tag:

    <GetUserCollectionFromGroupResult>
        <GetUserCollectionFromGroup>
           <Users>
              <User ID="4" Name="User1_Display_Name" />
              <User ID="5" Name="User2_Display_Name" />
           </Users>
        </GetUserCollectionFromGroup>
    </GetUserCollectionFromGroupResult>
    

    B. The schema embedded in the WSDL defines the <GetUserCollectionFromGroup> as containing one child, <groupName> (this is the element used to make the request):

    <s:element name="GetUserCollectionFromGroup">
      <s:complexType>
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="groupName" type="s:string"/>
        </s:sequence>
      </s:complexType>
    </s:element>
    

    C. JAXB honors the processContents attribute of <xs:any> (see Mapping of <xs:any />). When processContents='strict', JAXB tries to match (and marshall) the child elements based on the namespace they belong to.

    D. The WSDL schema definition for the <GetUserCollectionFromGroupResult> includes <xs:any>:

    <s:element name="GetUserCollectionFromGroupResponse">
     <s:complexType>
      <s:sequence>
        <s:element minOccurs="0" maxOccurs="1" name="GetUserCollectionFromGroupResult">
          <s:complexType mixed="true">
            <s:sequence>
              <s:any/>
            </s:sequence>
          </s:complexType>
        </s:element>
      </s:sequence>
     </s:complexType>
    </s:element>
    

    E. When processContents is omitted, the default is strict.

    Thus, when JAX-WS/JAXB processes the results from the web service, it tries to marshall the children of <GetUserCollectionFromGroupResult> using the schema. The children appear in the response as belonging to the same namespace as the request. When the <GetUserCollectionFromGroup> element is processed, it is marshalled to an instance of the same class used in the request for the <GetUserCollectionFromGroup> element. Thus, you are effectively blocked from getting at the <Users> elements.

    I’ve searched high and low, and the only solution(s) that I can find is to ether (a) edit the WSDL as described at the start of this answer, or (b) edit the generated stubs. Not ideal, but unavoidable in this case.

    More information about the <xs:any> schema element (and the processContents attribute) can be found on MSDN here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small app which references the Microsoft.SqlServer.Smo assembly (so I can display
I have created a small application which opens,reads and creates Excel files. The app
I have a small app that has a Render thread. All this thread does
I have a small app/site on a dev server with a data table in
I am a broke college student. I have built a small web app in
I have to develop a small app for which I have to create a
I have some usage queries for my web app's database, the results of which
I have created a small iPhone app using MonoTouch - got all provisioning files
I have made small web-app in jsp with a start page with login and
So I have a small C# app that needs to periodically check the contents

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.