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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:47:24+00:00 2026-06-01T17:47:24+00:00

I have the following endpoint interface: @WebService public interface SEIWebService { @WebMethod @WebResult(name=CreateWorkOrderItemResponse) CreateWorkOrderItemResponse

  • 0

I have the following endpoint interface:

@WebService
public interface SEIWebService {

    @WebMethod
    @WebResult(name="CreateWorkOrderItemResponse")
    CreateWorkOrderItemResponse createWorkItem(@WebParam(name = "CreateWorkOrderItemRequest")CreateWorkOrderItemRequest request);
}

The implementation:

@WebService(endpointInterface = "com.someCompany.SEIWebService", portName = "SEIWebServices")
public class SEIWebServiceImpl implements SEIWebService{

    @Override
    public CreateWorkOrderItemResponse createWorkItem(CreateWorkOrderItemRequest request) {
        CreateWorkOrderItemResponse response = new CreateWorkOrderItemResponse();
        response.setResponseCode("Testing Create 2222");
        response.addError("Error 1");
        response.addError("Error 2");

        return response;
    }

And lastly, the code for the response object

public class CreateWorkOrderItemResponse {
    private String responseCode = null;
    private ArrayList<String> errorList = new ArrayList<String>();

    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }

    public String getResponseCode() {
        return responseCode;
    }

    public void addError(String error) {
        errorList.add(error);
    }

    public void setErrorList(ArrayList<String> errorList) {
        this.errorList = errorList;
    }

    public ArrayList<String> getErrorList() {
        return errorList;
    }
}

When I run this code, the response back in SoapUI comes out like this:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:createWorkItemResponse xmlns:ns2="http://someCompany.com/">
         <CreateWorkOrderItemResponse>
            <errorList>Error 1</errorList>
            <errorList>Error 2</errorList>
            <responseCode>Testing Create 2222</responseCode>
            <testList/>
         </CreateWorkOrderItemResponse>
      </ns2:createWorkItemResponse>
   </S:Body>
</S:Envelope>

Finally, the question… With the code above, is there a way to change it so I can add a “wrapper” around the errorList responses? I am looking to have the SOAP message response look like this:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:createWorkItemResponse xmlns:ns2="http://someCompany.com/">
         <CreateWorkOrderItemResponse>
            <Errors>
                <errorList>Error 1</errorList>
                <errorList>Error 2</errorList>
            </Errors>
            <responseCode>Testing Create 2222</responseCode>
            <testList/>
         </CreateWorkOrderItemResponse>
      </ns2:createWorkItemResponse>
   </S:Body>
</S:Envelope>

Thank you all for the help!

  • 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-06-01T17:47:26+00:00Added an answer on June 1, 2026 at 5:47 pm

    I figured out the answer. I had to use the XmlElementWrapper annotation for this. So the code is now:

    public class CreateWorkOrderItemResponse {
        private String responseCode = null;
        private ArrayList<String> errorList = new ArrayList<String>();
    
        public void setResponseCode(String responseCode) {
            this.responseCode = responseCode;
        }
    
        public String getResponseCode() {
            return responseCode;
        }
    
        public void addError(String error) {
            errorList.add(error);
        }
    
        public void setErrorList(ArrayList<String> errorList) {
            this.errorList = errorList;
        }
    
        @XmlElementWrapper(name="error_list") 
        @XmlElement(name="error")
        public ArrayList<String> getErrorList() {
            return errorList;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have the following service contract and two concrete implementations: [OperationContract] public interface
I have following method in wcf webenabled service Public Person AddPerson(Person p); As of
I have following class public class ButtonChange { private int _buttonState; public void SetButtonState(int
I have following simple class: @interface Article: NSObject { NSString *title; } @property (copy,
I have following databases: test table1 fields: id, password, name, lastname test2 table2 fields:
I am using an MSMQ endpoint. I have set the following attributes on my
I have the following project structure: base project (service layer, model) web project webservice
I have the following use case in Mule ESB - Expose a SOAP endpoint
As per the following article, I have defined my service contract as http://blogs.msdn.com/b/endpoint/archive/2010/11/13/simplified-asynchronous-programming-model-in-wcf-with-async-await.aspx [ServiceContract]
I have the following code var factory = new ChannelFactory<INewsClient>(); factory.Credentials.ClientCertificate.Certificate = GetCertificate(); factory.Endpoint.Address

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.