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 4107240
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:28:54+00:00 2026-05-20T21:28:54+00:00

I have generated a Metro/JAXB client from a WSDL before and the marshalling/unmarshalling of

  • 0

I have generated a Metro/JAXB client from a WSDL before and the marshalling/unmarshalling of the Java classes to/from SOAP/XML worked without any issues. I have generated a new client and there seems to be unmarshalling issues and I’m not sure why. The WSDL is very large (> 27,000 lines) and I had to use -B-XautoNameResolution because of some element names being the same except for case.

I am trying to execute this method/operation:

@WebService(name = "servicePortType", targetNamespace = "urn:service")
@XmlSeeAlso({
    ObjectFactory.class
})
public interface ServicePortType {


    /**
     * Service definition of function unsp__GetSubscriberList
     * 
     * @param result
     * @param totalSubsFound
     * @param getSubListReq
     * @param paginatedInfo
     * @param getSubscriberListData
     */
    @WebMethod(operationName = "GetSubscriberList")
    @RequestWrapper(localName = "GetSubscriberList", targetNamespace = "urn:service", className = "service.GetSubscriberList")
    @ResponseWrapper(localName = "GetSubscriberListResult", targetNamespace = "urn:service", className = "service.GetSubscriberListResult")
    public void getSubscriberList(
        @WebParam(name = "GetSubListReq", targetNamespace = "")
        GetSubscriberListRequest getSubListReq,
        @WebParam(name = "Result", targetNamespace = "", mode = WebParam.Mode.OUT)
        Holder<ResultCodeStruct> result,
        @WebParam(name = "PaginatedInfo", targetNamespace = "", mode = WebParam.Mode.OUT)
        Holder<PaginatedInfo> paginatedInfo,
        @WebParam(name = "TotalSubsFound", targetNamespace = "", mode = WebParam.Mode.OUT)
        Holder<Integer> totalSubsFound,
        @WebParam(name = "GetSubscriberListData", targetNamespace = "", mode = WebParam.Mode.OUT)
        Holder<GetSubscriberListData> getSubscriberListData);

}

This method will return the subscriber data and also the total number of subscribers. My call looks like this:

public int getTotalSubscriptions()
        throws Exception
{
    GetSubscriberListRequest subscriberListRequest = factory.createGetSubscriberListRequest();
    Holder<ResultCodeStruct> result = null;
    Holder<PaginatedInfo> paginatedInfo = null;
    Holder<Integer> totalSubsFound = null;
    Holder<GetSubscriberListData> subscriberListData = null;

    subscriberListRequest.setMaxSubscribers(factory.createGetSubscriberListRequestMaxSubscribers(1));

    port.getSubscriberList(subscriberListRequest,
            result,
            paginatedInfo,
            totalSubsFound,
            subscriberListData);

    if (result.value.getResultCode() != CODE_SUCCESS)
    {
        throw new Exception("Failed call");
    }

    return totalSubsFound.value.intValue();
}

I get a NullPointerException on the result object. I have traced the SOAP call and the XML being returned is as expected including a Result element.

I have never encountered WebParam.Mode.OUT before. Should the Holder<> instances be initialized before I make the call? To what?

Those elements are wrapped in a GetSubscriberListResult element in the SOAP, but since the interface method has that defined in the @ResponseWrapper, I was expecting them to be unmarshalled into the objects passed in. Maybe I need to do something else?

Any advice/help is greatly appreciated!

  • 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-20T21:28:55+00:00Added an answer on May 20, 2026 at 9:28 pm

    Spent quite a bit of time searching on the internet and found an older reference stating that the Holder objects do need to be initialized. So, the corrected method calls looks like this:

    public int getTotalSubscriptions()
            throws Exception
    {
            GetSubscriberListRequest subscriberListRequest = factory.createGetSubscriberListRequest();
            Holder<ResultCodeStruct> result = new Holder<ResultCodeStruct>(factory.createResultCodeStruct());
            Holder<PaginatedInfo> paginatedInfo = new Holder<PaginatedInfo>(factory.createPaginatedInfo());
            Holder<Integer> totalSubsFound = new Holder<Integer>(new Integer(0));
            Holder<GetSubscriberListData> subscriberListData = new Holder<GetSubscriberListData>(factory.createGetSubscriberListData());
    
        subscriberListRequest.setMaxSubscribers(factory.createGetSubscriberListRequestMaxSubscribers(1));
    
        port.getSubscriberList(subscriberListRequest,
                result,
                paginatedInfo,
                totalSubsFound,
                subscriberListData);
    
        if (result.value.getResultCode() != CODE_SUCCESS)
        {
            throw new Exception("Failed call");
        }
    
        return totalSubsFound.value.intValue();
    }
    

    Hope this helps others who may have encountered the same issue.

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

Sidebar

Related Questions

i have generated a cs-classes with the xsd-tool from some xml scheme. The scheme
I have generated a java code from matlab and while executing the java code
I have generated classes from xsd and want to serialize the DateTime . My
I have generated a set of classes using xsd.exe and created an XML document
I have generated entity model from my database which created entity classes. 1) Is
I have an automatically generated XML file for the game that I run. It
I have a situation where I have to write a client in Java against
I'm trying to develop a standalone Java web service client with JAX-WS (Metro) that
I have generated an XSD file for an XML file and it's working when
I have generated a strongly-type view from a model class that I have created

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.