My requirement is that I have to create an inbound SOAP web service which will return a list of data based on the input parameters. I am using wrapper classes to build the output.

global class Account{
        webservice string Id;
        webservice string Name;
        webservice list<SystemWrapper> Systems;

global class SystemWrapper{
        webservice string Id;
        webservice string Name;
        webservice string ProductLine;
        webservice string SystemRoleId;

Now i have the following questions in the response which is generated

  1. How do i specify the sequence, because the client system wants the elements in the soap reponse xml in a particular sequence. Are the nodes ordered in alphabetical order automatically?

  2. How do i remove the result node which is added automatically to the response for ex :

  3. And each node name should be pre-pended with a namespace that is defined in the soap:Body.

Any help is much appreciated. Thanks!

Hi Daniel Thanks for your reply.

However i have one more question

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://soap.sforce.com/schemas/class/CustomerPortalIntegrationService">


There are namespaces added to the request xml -- "cus" but whereas the response xml does not have any namespace.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/schemas/class/CustomerPortalIntegrationService" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

Can we modify the WSDL such that the response has namespaces.

  • Hi Team, Can someone please give some directions/inputs for my above questions. Thanks in advance! Commented Jul 3, 2015 at 0:10

1 Answer 1


The order of the xsd:sequence elements for a complexType that you define does appear to be alphabetical. At the very least, you have no other way to control the order of the elements within the sequence.

I don't think you can remove the 'result' element from the generated *Response elements. It's part of the mechanism that if used for handling collection parameters.

There should be no need to prefix the namespace to the nodes when the targetNamespace is defined. That said, as long as the inbound SOAP request matches the WSDL schema it should be fine to specify the namespace on each element.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .