Repository: vpulim/node-soap

Issue:
Possible regression in 1.3.0 from 1.2.1
We have a WSDL file that starting returning no data starting from upgrading from 1.2.1 to 1.3.0

After comparing the changes https://github.com/vpulim/node-soap/compare/v1.2.1...v1.3.0#files_bucket and checking with gpt5

The response was:

> Short answer: because a namespace / WSDL-parsing change in v1.3.0 broke how element names are matched — the refactor that landed in the v1.3.0 changeset (handling redefined namespace aliases and deeply-nested messages) changed the order/logic of how src/wsdl/index.ts discovers element names, xsi:type / xmlns mappings and id/href refs. That can make the parser fail to match the WSDL message/element names your WSDL uses (so the client ends up with no parsed response data). See the commits that introduced this behavior. 
> 
> Why that breaks your WSDL (short technical explanation)
> 
> The v1.3.0 changes moved and rewrote the code that: (a) collects xmlns declarations on an element, (b) handles id/href multiRef refs, and (c) decides when an element inside the SOAP Body should be treated as the response object name.
> 
> If the parser no longer resolves the exact local name/namespace the WSDL used to register in definitions.messages[...], the code that maps an incoming XML element to its WSDL type/response drops through and you get no parsed data (or empty client.describe() / empty result object).
> 
> The commit specifically mentions supporting “redefining of a namespace alias” — that change can change the computed name/objectName used for lookups. If your WSDL uses redefined/embedded namespace aliases (many SAP WSDLs do), this is the likely root cause. 
> [GitHub](https://github.com/vpulim/node-soap/commit/4343a09130644704c950f5f6d131e195cdfa7ab1)
> 
> How you can verify / debug quickly
> 
> Create a client and dump the WSDL messages to see whether operations/messages were parsed:
> 
> const soap = require('soap');
> soap.createClient(wsdlUrl, {}, (err, client) => {
>   if (err) return console.error(err);
>   console.log('describe():', client.describe());
>   // low-level: inspect parsed WSDL
>   console.log('wsdl messages keys:', Object.keys(client.wsdl.definitions.messages));
> });
> 
> 
> If client.describe() is empty or messages don’t look right, the WSDL parsing failed to create the mapping.
> 
> Capture raw response and compare lastResponse/lastRequest to see whether the XML body element name is different from keys under client.wsdl.definitions.messages.
> 
> What you can do right now (workarounds / fixes)
> 
> Pin / downgrade to the last known-good version: npm install soap@1.2.1. If that restores behaviour, it confirms the regression is in the 1.3.0 changes. (fastest mitigation)
> 
> Reproduce and open an issue on the repo with a minimal WSDL + sample request/response that demonstrates the failure — the maintainers already touched this area so they’ll likely accept a regression report. Link to the commits above when you file it. 
> 
> Temporary local patch: if you can edit node_modules/soap/src/wsdl/index.ts, revert the specific parsing logic change around element xmlns and the early objectName decision back to the old behavior (the diff is in the v1.3.0 commit). I can draft a small patch for you if you want — tell me whether you prefer a patch file or a one-off monkey patch for runtime.


Discussion:
@w666: Hi @MDSLKTR 

The link mentioned above is pointing to a commit with a test, no actual code changes.
The chat GPT response you posted above does not make much sense to me, sorry. While I can believe that we might broke something I will need more info about your problem.

Could you please:
1) Describe the problem, what does not work, provide any error messages, stack traces
1) Provide step to replicate the problem
2) Attach WSDL files that you used to replicate the problem

Thanks.@MDSLKTR: Thank you for the response @w666, i will add more information here, sorry i am not an export in any SOAP matters so i am trying to describe it as good as possible.

So i am potentially speaking one of these PRs included in the latest 1.3.0 release which are not only changing tests:
https://github.com/vpulim/node-soap/pull/1313
https://github.com/vpulim/node-soap/pull/1315

We are using attached WSDL

[stores_obfuscated.wsdl.txt](https://github.com/user-attachments/files/22168630/stores_obfuscated.wsdl.txt)

If you now call GET_ALL_STORE_NUMBERS and then GET_DATA for each returned store number, it previously in 1.2.1 returned all store information. In 1.3.0 it returns nothing
@smokhov: @MDSLKTR -- that's a quite an extensive WSLD you have... To help debugging and creating a test case to cover it, would you:

1. mind us including that WSDL into our future tests
2. have some expected requet/response samples? Ideally in the format described here: https://github.com/vpulim/node-soap/tree/master/test/request-response-samples@w666: @MDSLKTR 

Could you define `returns nothing`? 
Does it return empty string? Empty array? Undefined? 

While your WSDL looks correct I can't query your service, because you haven't provided any details, like URL, or maybe test credentials if this service requires authentification. Are you sure service is not broken and does return data?

here is the code snipped I used to validate your WSDL, it works with both `1.2.1` and `1.3.0`, but I can test any further

```typescript
import * as soap from "soap";

soap.createClient(`./stores_obfuscated.wsdl`, {}, (err, client) => {
  if (err) return console.error(err);
  console.log('describe:', client.describe());
  console.log('definition keys:', Object.keys(client.wsdl.definitions.messages));

  client.GET_ALL_STORE_NUMBERS(
    {}, function (err, result) {
      if (err) {
        console.error(`request error`, err);

      }
      console.log(`result`, result);
    })
});
```

<img width="745" height="429" alt="Image" src="https://github.com/user-attachments/assets/46f8095f-6710-43c0-8a76-b8360d66b3a7" />

@smokhov: @MDSLKTR -- following @w666 analysis I've also taken your WSDL and generated two tests, using various options. They are in the PR #1347 -- please have a look. I hope it's OK to use your WSDL in the repo as a part of the test suite. I've created two tests: one for `GET_ALL_STORE_NUMBERS` and another for `GET_DATA`. I've played with and without security and different `wsdl_options`. The sample request and response data I generated are also provided. The tests pass in our suite... means the response data are returned. Could you check if the request/response examples in the PR are representative of what you typically get? If so, then there is no regression it seems according to the tests. The tests are based off the current tip of the repo so slightly past 1.3.0

```
    ✔ should work with more deeply nested XML messages and without security
    ✔ should work with more deeply nested XML messages and without security (promisified)
    ✔ should work with more deeply nested XML messages and security
    ✔ should work with more deeply nested XML messages and security (promisified)
```@MDSLKTR: > [@MDSLKTR](https://github.com/MDSLKTR)
> 
> Could you define `returns nothing`? Does it return empty string? Empty array? Undefined?
> 
> While your WSDL looks correct I can't query your service, because you haven't provided any details, like URL, or maybe test credentials if this service requires authentification. Are you sure service is not broken and does return data?
> 
> here is the code snipped I used to validate your WSDL, it works with both `1.2.1` and `1.3.0`, but I can test any further
> 
> import * as soap from "soap";
> 
> soap.createClient(`./stores_obfuscated.wsdl`, {}, (err, client) => {
>   if (err) return console.error(err);
>   console.log('describe:', client.describe());
>   console.log('definition keys:', Object.keys(client.wsdl.definitions.messages));
> 
>   client.GET_ALL_STORE_NUMBERS(
>     {}, function (err, result) {
>       if (err) {
>         console.error(`request error`, err);
> 
>       }
>       console.log(`result`, result);
>     })
> });
> <img alt="Image" width="745" height="429" src="https://private-user-images.githubusercontent.com/2047943/486348961-46f8095f-6710-43c0-8a76-b8360d66b3a7.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTczMTQ1NTAsIm5iZiI6MTc1NzMxNDI1MCwicGF0aCI6Ii8yMDQ3OTQzLzQ4NjM0ODk2MS00NmY4MDk1Zi02NzEwLTQzYzAtOGE3Ni1iODM2MGQ2NmIzYTcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDkwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA5MDhUMDY1MDUwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MWM0NDM1OGRjNDY1ZmRkODdkYjc5MWJkNjlkODEyMzU4ZmViZDc3ZjM2MTE1ZjQzYzA3ZGU5OWEzN2Y5ZjU2YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.IO49nRBTNFYait4vKtqMbh4H_riqWjk2i1qhWYfq8zs">

It  returns  ~~undefined~~ a different return structure. I cant share anything more unfortunately since its internals and i had to obfuscate field names and endpoints. The structure is probably very legacy however downgrading from 1.3.0 to 1.2.1 imediately resolves the issue and it returns the data in the correct structure again@MDSLKTR: > [@MDSLKTR](https://github.com/MDSLKTR) -- following [@w666](https://github.com/w666) analysis I've also taken your WSDL and generated two tests, using various options. They are in the PR [#1347](https://github.com/vpulim/node-soap/pull/1347) -- please have a look. I hope it's OK to use your WSDL in the repo as a part of the test suite. I've created two tests: one for `GET_ALL_STORE_NUMBERS` and another for `GET_DATA`. I've played with and without security and different `wsdl_options`. The sample request and response data I generated are also provided. The tests pass in our suite... means the response data are returned. Could you check if the request/response examples in the PR are representative of what you typically get? If so, then there is no regression it seems according to the tests. The tests are based off the current tip of the repo so slightly past 1.3.0
> 
> ```
>     ✔ should work with more deeply nested XML messages and without security
>     ✔ should work with more deeply nested XML messages and without security (promisified)
>     ✔ should work with more deeply nested XML messages and security
>     ✔ should work with more deeply nested XML messages and security (promisified)
> ```

Thank you for adding these. I think it should be fine to use this obfuscated one. I will take a closer look and get back to you@MDSLKTR: @smokhov, @w666  i think the main reason for the failing data are response differences, not sure what the cause of it is though but if you look at the return from this function we implement:

```
public async getStore(companyId: string): Promise<StoreType | undefined> {
        const args = {
            IT_STORE_NUMBERS: {
                item: [{ STORE_NUMBER: id }],
            },
        };

        const { ET_STORE_DATA } = await this.soapRequest<{ ET_STORE_DATA?: { item: StoreSourceType[] } }>(
            this.storeClient!,
            'GET_DATA',
            args,
        );

        return ET_PLANT_DATA?.item[0];
    }
```

Return structure of GET_DATA in 1.3.0

```
{
    item: {
        STORE_NUMBER: '1',
        ...
    }
 }
```

Return structure of GET_DATA in 1.2.1

```
{
    item: [
        {
            STORE_NUMBER: '1',
            ...
        }
    ]
}
```

So the structure slightly changed. We are expecting an array containing an object, however it returned an object. Is this something to be expected?@smokhov: > So the structure slightly changed. We are expecting an array containing an object, however it returned an object. Is this something to be expected?

Not something I'd call "expected"; clearly there is a change in behaviour that the tests don't catch. Not clear where it is yet though. In my mock tests PR it returns an array of items. If there is a bug, it's probably manifesting itself in and/or around your `StoreSourceType`... but we need to first find a way to reproduce it.@w666: Interesting, the tests that @smokhov created look correct. And even more interesting they work same way in both versions.

@MDSLKTR could you please do more debugging? It would be helpful to see the raw xml response from the service that you receive over network, before clint converts it to json. @MDSLKTR: @w666 @smokhov 

I checked the SOAP response which seems to be identical for both versions (logging handleResponse in http.js)

```
<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>
    <SOAP:Header />
    <SOAP:Body xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
        xmlns:ns0='urn:sap-com:document:sap:rfc:functions'
        xmlns:p1='urn:puc:XXX'
        xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'>
        <nm:Z_GET_DATA.Response xmlns:nm='urn:sap-com:document:sap:rfc:functions'
            xmlns:prx='urn:sap.com:proxy:XXX:/XXXX/XXXXXXXXX'>
            <ET_STORE_DATA>
                <item>
                    <STORE_ID>0001</STORE_ID>
                </item>
            </ET_STORE_DATA>
            <ET_RETURN>
                <item>
                    <TYPE>S</TYPE>
                    <ID>ZSTA</ID>
                    <NUMBER>401</NUMBER>
                    <MESSAGE>Data read successfully</MESSAGE>
                </item>
            </ET_RETURN>
        </nm:Z_GET_DATA.Response>
    </SOAP:Body>
</SOAP:Envelope>
```

after parsing in 1.2.1
```
{
    "ET_STORE_DATA": {
        "item": [
            {
                "STORE_ID": "0001"
            }
        ]
    },
    "ET_RETURN": {
        "item": [
            {
                "TYPE": "S",
                "ID": "ZSTA",
                "NUMBER": "401",
                "MESSAGE": "Data read successfully"
            }
        ]
    }
}

```

after parsing in 1.3.0
```
{
    "ET_STORE_DATA": {
        "item": {
            "STORE_ID": "0001"
        }
    },
    "ET_RETURN": {
        "item": {
            "TYPE": "S",
            "ID": "ZSTA",
            "NUMBER": "401",
            "MESSAGE": "Data read successfully"
        }
    }
}

```

I havent had the time to go more into where and how the response is parsed but it seems to me that this somewhat changed@w666: @MDSLKTR 

Are you sure that you are using WSDL you attached above? I mean `stores_obfuscated.wsdl` one.
I can replicate the behavior you mentioned on version 1.3.0 but only if I intentionally remove `minOccurs` and `maxOccurs`.

For example, with this bit in WSDL (your original file)
```xml
                        <xsd:element name="ET_STORE_DATA" minOccurs="0">
                            <xsd:complexType>
                                <xsd:sequence>
                                    <xsd:element name="item" type="ZSTORE_S_STORE_DATA"
                                        minOccurs="0"
                                        maxOccurs="unbounded" />
                                </xsd:sequence>
                            </xsd:complexType>
``` 

client always translates xml response to a list (array in JSON), even if there is only one element returned, like in this example xml response
```xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:urn="urn:company-com:document:company:rfc:functions">
   <soapenv:Header />
   <soapenv:Body>
      <urn:Z_STORE_TEMPLATE_GET_DATA.Response>
         <ET_STORE_DATA>
            <item>
               <STORE_ID>1001</STORE_ID>
            </item>
         </ET_STORE_DATA>
         <ET_RETURN>
            <item>
               <TYPE>S</TYPE>
               <ID>ZSTA</ID>
               <NUMBER>401</NUMBER>
               <MESSAGE>Data read successfully</MESSAGE>
            </item>
         </ET_RETURN>
      </urn:Z_STORE_TEMPLATE_GET_DATA.Response>
   </soapenv:Body>
</soapenv:Envelope>
```
but, if I remove `minOccurs` and `maxOccurs` like below 

```xml
                        <xsd:element name="ET_STORE_DATA" minOccurs="0">
                            <xsd:complexType>
                                <xsd:sequence>
                                    <xsd:element name="item" type="ZSTORE_S_STORE_DATA" />
                                </xsd:sequence>
                            </xsd:complexType>
``` 

then behavior changes, in case of just one item in the response it will be translated to just an object
```json
  "ET_STORE_DATA": {
    "item": {
      "STORE_ID": "1001"
    }
  }
```

in case of more than one it will be an array
```json
{
  "ET_STORE_DATA": {
    "item": [
      {
        "STORE_ID": "1001"
      },
      {
        "STORE_ID": "1002"
      }
    ]
  }
}
```

but this is expected, because `minOccurs` and `maxOccurs` are instructions what kind of data it is. Without them it is not a list by default.

Could you double check this?@MDSLKTR: @w666 

Hmm, I just double checked the used wsdl, it has:

```
minOccurs="0"
maxOccurs="unbounded
```
The one i posted is just obfuscated in field key names but did not modify any types

And essentially the only change we do is bumping up the versions to reproduce it
@w666: @MDSLKTR 

There is something in your environment that I can't replicate locally. I do believe that we may introduce a bug, and I am happy to help with this.

I understand that you can't share the full WSDL and other details, but I don't think I can help without it.

Maybe you can try to replicate the problem locally with the examples you provided above? I guess we may miss something, but I need help from your side.

Alternatively, you can revert some commits one by one, build your local version and test against it. If you manage to find the commit that broke things this would help too.@MDSLKTR: Makes sense 👍🏼 I created an internal investigation ticket to try to get more to the bottom of this. Maybe we can pinpoint the exact line and get back to you. Until then we will stay at 1.2.1. Thanks for far for the help for sure@lesteakley-cb: > I checked the SOAP response which seems to be identical for both versions (logging handleResponse in http.js)
> 
> ```
> <SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>
>     <SOAP:Header />
>     <SOAP:Body xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
>         xmlns:ns0='urn:sap-com:document:sap:rfc:functions'
>         xmlns:p1='urn:puc:XXX'
>         xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'>
>         <nm:Z_GET_DATA.Response xmlns:nm='urn:sap-com:document:sap:rfc:functions'
>             xmlns:prx='urn:sap.com:proxy:PV1:/1SAI/TASC0F0AD1325E06E74647F:731'>
>             <ET_STORE_DATA>
>                 <item>
>                     <STORE_ID>0001</STORE_ID>
>                 </item>
>             </ET_STORE_DATA>
>             <ET_RETURN>
>                 <item>
>                     <TYPE>S</TYPE>
>                     <ID>ZSTA</ID>
>                     <NUMBER>401</NUMBER>
>                     <MESSAGE>Data read successfully</MESSAGE>
>                 </item>
>             </ET_RETURN>
>         </nm:Z_GET_DATA.Response>
>     </SOAP:Body>
> </SOAP:Envelope>
> ```
> 

@MDSLKTR 
I looks to me that this particular issue can be traced to the changes in #1313, specifically at https://github.com/vpulim/node-soap/pull/1313/files#diff-2c1300f4732a4bdd2d6f0234d611bb7ac264b39f5a173b4f86412a26102b0258R272.

<img width="905" height="122" alt="Image" src="https://github.com/user-attachments/assets/90ced4b7-12c8-428c-bc70-09c64441b5df" />


The code is checking for a namespace prefix of “soap” or “soapenv” or “S” before trying to locate the schema for the response message for parsing. Unfortunately, your example uses the prefix “SOAP” so the code doesn’t ever bother to use the schema in the WSDL. My team is running into the same issue with this version of the package.

Is it wise to depend on hard-coded prefixes to trigger the schema resolution logic? The choice of prefix is arbitrary, and different applications may use different prefixes. I would think that a better approach would be to check that the actual namespace mapping for the Body tag prefix is the appropriate SOAP namespace URI. So for example if the XML has `xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/"` than the `<senv:Body>` tag will still trigger schema discovery.

Any thoughts?

@MDSLKTR: @lesteakley-cb 

Thank you, this is it

@w666 @smokhov 

I can confirm changing this line in wsdl/index to:

```
if (!objectName && (xmlns.soap || xmlns.soapenv || xmlns.S || xmlns.SOAP) && top.name === 'Body' && name !== 'Fault') {
```

would fix the issue, so the question fron @lesteakley-cb is very valid i think@smokhov: Good find, @lesteakley-cb , thank you. That change #1313 was inherited and extended from #1205 to cover the tests. It's weird it manifests itself like that when parsing single element sequences. I agree that shouldn't be hardcoded and we should handle it in a general manner.

@w666 -- what would your decision be? Given #1349 Axios will need to be patched; can release 1.3.1 with Axios and hardcoded `| xmlns.SOAP` to resolve @MDSLKTR 's immediate issue, and then start another issue to address hardcoding of the namespace prefixes and a separate PR for it?
@smokhov: > ... I agree that shouldn't be hardcoded and we should handle it in a general manner.
> 
> [@w666](https://github.com/w666) -- what would your decision be? Given [#1349](https://github.com/vpulim/node-soap/issues/1349) Axios will need to be patched; can release 1.3.1 with Axios and hardcoded `| xmlns.SOAP` to resolve [@MDSLKTR](https://github.com/MDSLKTR) 's immediate issue, and then start another issue to address hardcoding of the namespace prefixes and a separate PR for it?

I've updated PR #1347 to actually have a more general implementation, so no need to hardcode yet another namespace prefix.@w666: Thanks all for help. 

@smokhov the fix looks good to me. I will release it asap.@w666: 1.4.0 has been released, axios update is not included, will try to release that later today.

@MDSLKTR could you please check that your issue is resolved?@smokhov: ... and thanks @MDSLKTR for bringing it up and helping to test and @lesteakley-cb for spotting the issue. Sorry for the trouble....@MDSLKTR: @w666 @smokhov @lesteakley-cb I can confirm this version working 👍🏼 Thank you all for the support and quick help. And also no worries, glad we could resolve the issue

Solution patch:
diff --git a/src/wsdl/index.ts b/src/wsdl/index.ts
index c43f023..5565d41 100644
--- a/src/wsdl/index.ts
+++ b/src/wsdl/index.ts
@@ -22,6 +22,7 @@ import * as elements from './elements';
 const debug = debugBuilder('node-soap');
 
 const XSI_URI = 'http://www.w3.org/2001/XMLSchema-instance';
+const ENV_URI = 'http://schemas.xmlsoap.org/soap/envelope/';
 
 export function trim(text) {
   return text.trim();
@@ -215,6 +216,7 @@ export class WSDL {
     };
     const stack: any[] = [{ name: null, object: root, schema: schema }];
     const xsiPrefixes: Map<any, any> = new Map();
+    let envPrefix: string = 'soap';
     const xmlns: any = {};
 
     const refs = {};
@@ -255,6 +257,9 @@ export class WSDL {
           if (value === XSI_URI) {
               xsiPrefixes.set(name, value);
           }
+          if (value === ENV_URI) {
+              envPrefix = name;
+          }
           continue;
         }
         hasNonXmlnsAttribute = true;
@@ -275,7 +280,7 @@ export class WSDL {
         obj[this.options.attributesKey] = elementAttributes;
       }
 
-      if (!objectName && (xmlns.soap || xmlns.soapenv || xmlns.S) && top.name === 'Body' && name !== 'Fault') {
+      if (!objectName && xmlns[envPrefix] && top.name === 'Body' && name !== 'Fault') {
         let message = this.definitions.messages[name];
         // Support RPC/literal messages where response body contains one element named
         // after the operation + 'Response'. See http://www.w3.org/TR/wsdl#_names



Test patch:
diff --git a/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/request.json b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/request.json
new file mode 100644
index 0000000..e8eb9c5
--- /dev/null
+++ b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/request.json
@@ -0,0 +1,3 @@
+{
+  "IV_REQUESTER": "REQUSER1"
+}
diff --git a/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/request.xml b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/request.xml
new file mode 100644
index 0000000..d76e875
--- /dev/null
+++ b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/request.xml
@@ -0,0 +1,29 @@
+<?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:ns0="urn:company-com:document:company:rfc:functions"
+    xmlns:p1="urn:example:SYSTEM:RETAIL:StoreData"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+    <soap:Header>
+      <wsse:Security
+        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
+        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+        <wsu:Timestamp wsu:Id="Timestamp-2014-10-12T01:02:03Z">
+          <wsu:Created>2014-10-12T01:02:03Z</wsu:Created>
+          <wsu:Expires>2014-10-12T01:12:03Z</wsu:Expires>
+        </wsu:Timestamp>
+        <wsse:UsernameToken
+          xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+          wsu:Id="SecurityToken-2014-10-12T01:02:03Z">
+          <wsse:Username>basicuser</wsse:Username>
+          <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">basicpass</wsse:Password>
+          <wsu:Created>2014-10-12T01:02:03Z</wsu:Created>
+        </wsse:UsernameToken></wsse:Security>
+    </soap:Header>
+    <soap:Body>
+      <ns0:Z_STORE_TEMPLATE_GET_ALL xmlns:ns0="urn:company-com:document:company:rfc:functions">
+        <IV_REQUESTER>REQUSER1</IV_REQUESTER>
+      </ns0:Z_STORE_TEMPLATE_GET_ALL>
+    </soap:Body>
+</soap:Envelope>
diff --git a/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/response.json b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/response.json
new file mode 100644
index 0000000..962e194
--- /dev/null
+++ b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/response.json
@@ -0,0 +1,18 @@
+{
+  "ET_ALL_STORES": {
+    "item": [
+      { "STORE_ID": "1001" },
+      { "STORE_ID": "1002" }
+    ]
+  },
+  "ET_RETURN": {
+    "item": [
+      {
+        "TYPE": "S",
+        "ID": "MSG001",
+        "NUMBER": "000",
+        "MESSAGE": "Request processed successfully"
+      }
+    ]
+  }
+}
diff --git a/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/response.xml b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/response.xml
new file mode 100644
index 0000000..9f3d692
--- /dev/null
+++ b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/response.xml
@@ -0,0 +1,24 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+                  xmlns:urn="urn:company-com:document:company:rfc:functions">
+   <soapenv:Header/>
+   <soapenv:Body>
+      <urn:Z_STORE_TEMPLATE_GET_ALL.Response>
+         <ET_ALL_STORES>
+            <item>
+               <STORE_ID>1001</STORE_ID>
+            </item>
+            <item>
+               <STORE_ID>1002</STORE_ID>
+            </item>
+         </ET_ALL_STORES>
+         <ET_RETURN>
+            <item>
+               <TYPE>S</TYPE>
+               <ID>MSG001</ID>
+               <NUMBER>000</NUMBER>
+               <MESSAGE>Request processed successfully</MESSAGE>
+            </item>
+         </ET_RETURN>
+      </urn:Z_STORE_TEMPLATE_GET_ALL.Response>
+   </soapenv:Body>
+</soapenv:Envelope>
diff --git a/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/security.json b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/security.json
new file mode 100644
index 0000000..03aa664
--- /dev/null
+++ b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/security.json
@@ -0,0 +1,5 @@
+{
+  "type": "ws",
+  "username": "basicuser",
+  "password": "basicpass"
+}
diff --git a/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/soap.wsdl b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/soap.wsdl
new file mode 100644
index 0000000..3540dc3
--- /dev/null
+++ b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/soap.wsdl
@@ -0,0 +1,523 @@
+<wsdl:definitions xmlns:ns0="urn:company-com:document:company:rfc:functions"
+    xmlns:p1="urn:example:SYSTEM:RETAIL:StoreData"
+    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="SI_O_SYSTEM_STOREDATA"
+    targetNamespace="urn:example:SYSTEM:RETAIL:StoreData">
+    <wsdl:documentation />
+    <wsp:UsingPolicy wsdl:required="true" />
+    <wsp:Policy wsu:Id="OP_GET_ALL_STORE_NUMBERS" />
+    <wsp:Policy wsu:Id="OP_GET_DATA" />
+    <wsdl:types>
+        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns="urn:company-com:document:company:rfc:functions"
+            targetNamespace="urn:company-com:document:company:rfc:functions">
+            <xsd:element name="Z_STORE_TEMPLATE_GET_DATA">
+                <xsd:complexType>
+                    <xsd:all>
+                        <xsd:element name="IT_STORE_NUMBERS" minOccurs="0">
+                            <xsd:complexType>
+                                <xsd:sequence>
+                                    <xsd:element name="item" type="ZSTORE_S_STORE_NUMBERS"
+                                        minOccurs="0" maxOccurs="unbounded" />
+                                </xsd:sequence>
+                            </xsd:complexType>
+                        </xsd:element>
+                        <xsd:element name="IV_REQUESTER" minOccurs="0">
+                            <xsd:simpleType>
+                                <xsd:restriction base="xsd:string">
+                                    <xsd:maxLength value="10" />
+                                </xsd:restriction>
+                            </xsd:simpleType>
+                        </xsd:element>
+                    </xsd:all>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="Z_STORE_TEMPLATE_GET_ALL.Response">
+                <xsd:complexType>
+                    <xsd:all>
+                        <xsd:element name="ET_ALL_STORES" minOccurs="0">
+                            <xsd:complexType>
+                                <xsd:sequence>
+                                    <xsd:element name="item" type="ZSTORE_S_STORE_NUMBERS"
+                                        minOccurs="0" maxOccurs="unbounded" />
+                                </xsd:sequence>
+                            </xsd:complexType>
+                        </xsd:element>
+                        <xsd:element name="ET_RETURN" minOccurs="0">
+                            <xsd:complexType>
+                                <xsd:sequence>
+                                    <xsd:element name="item" type="BAPIRET2" minOccurs="0"
+                                        maxOccurs="unbounded" />
+                                </xsd:sequence>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:all>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="Z_STORE_TEMPLATE_GET_DATA.Response">
+                <xsd:complexType>
+                    <xsd:all>
+                        <xsd:element name="ET_STORE_DATA" minOccurs="0">
+                            <xsd:complexType>
+                                <xsd:sequence>
+                                    <xsd:element name="item" type="ZSTORE_S_STORE_DATA"
+                                        minOccurs="0"
+                                        maxOccurs="unbounded" />
+                                </xsd:sequence>
+                            </xsd:complexType>
+                        </xsd:element>
+                        <xsd:element name="ET_RETURN" minOccurs="0">
+                            <xsd:complexType>
+                                <xsd:sequence>
+                                    <xsd:element name="item" type="BAPIRET2" minOccurs="0"
+                                        maxOccurs="unbounded" />
+                                </xsd:sequence>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:all>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="Z_STORE_TEMPLATE_GET_ALL">
+                <xsd:complexType>
+                    <xsd:all>
+                        <xsd:element name="IV_REQUESTER" minOccurs="0">
+                            <xsd:simpleType>
+                                <xsd:restriction base="xsd:string">
+                                    <xsd:maxLength value="10" />
+                                </xsd:restriction>
+                            </xsd:simpleType>
+                        </xsd:element>
+                    </xsd:all>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:simpleType name="genericDate">
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value="....-..-.." />
+                </xsd:restriction>
+            </xsd:simpleType>
+            <xsd:simpleType name="date">
+                <xsd:union xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+                    xmlns="urn:company-com:document:company:rfc:functions"
+                    memberTypes="xsd:date genericDate" />
+            </xsd:simpleType>
+            <xsd:complexType name="ZSTORE_S_STORE_SD_DATA">
+                <xsd:sequence>
+                    <xsd:element name="BRAND_CODE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="CUSTOMER_GROUP" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="2" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="STORE_TYPE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="2" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="IS_INACTIVE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="1" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_S_STORE_DEPARTMENT_ASSIGN">
+                <xsd:sequence>
+                    <xsd:element name="DEPARTMENT" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="3" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_T_STORE_SALES_DATA">
+                <xsd:sequence>
+                    <xsd:element name="item" type="ZSTORE_S_STORE_SALES_DATA" minOccurs="0"
+                        maxOccurs="unbounded" />
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_T_STORE_DEPARTMENT_ASSIGN">
+                <xsd:sequence>
+                    <xsd:element name="item" type="ZSTORE_S_STORE_DEPARTMENT_ASSIGN" minOccurs="0"
+                        maxOccurs="unbounded" />
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_S_STORE_PLANNING_DATA">
+                <xsd:sequence>
+                    <xsd:element name="YEAR" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                                <xsd:pattern value="\d+" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="SEASON" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="1" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="STORE_GROUP" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="3" />
+                                <xsd:pattern value="\d+" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="STORE_FLAG" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="1" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="COMPETITIVE_FLAG" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="1" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_S_STORE_NUMBERS">
+                <xsd:sequence>
+                    <xsd:element name="STORE_ID" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_T_STORE_PLANNING_DATA">
+                <xsd:sequence>
+                    <xsd:element name="item" type="ZSTORE_S_STORE_PLANNING_DATA" minOccurs="0"
+                        maxOccurs="unbounded" />
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_S_STORE_SALES_DATA">
+                <xsd:sequence>
+                    <xsd:element name="SALES_ORG" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="DISTRIBUTION_CHANNEL" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="2" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="BAPIRET2">
+                <xsd:sequence>
+                    <xsd:element name="TYPE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="1" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="ID" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="20" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="NUMBER" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="3" />
+                                <xsd:pattern value="\d+" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="MESSAGE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="220" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="LOG_NO" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="20" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="LOG_MSG_NO" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="6" />
+                                <xsd:pattern value="\d+" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="MESSAGE_V1" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="50" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="MESSAGE_V2" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="50" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="MESSAGE_V3" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="50" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="MESSAGE_V4" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="50" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="PARAMETER" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="32" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="ROW" type="xsd:integer" minOccurs="0" />
+                    <xsd:element name="FIELD" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="30" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="SYSTEM" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="10" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_T_STORE_SD_DATA">
+                <xsd:sequence>
+                    <xsd:element name="item" type="ZSTORE_S_STORE_SD_DATA" minOccurs="0"
+                        maxOccurs="unbounded" />
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_S_STORE_DATA">
+                <xsd:sequence>
+                    <xsd:element name="STORE_ID" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="COMPANY_CODE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="STORE_CUSTOMER_ID" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="8" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="NAME1" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="30" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="POSTAL_CODE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="10" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="CITY" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="25" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="STREET" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="30" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="PHONE_NUMBER" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="30" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="OPENING_DATE" type="date" minOccurs="0" />
+                    <xsd:element name="LOCATION_CODE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="CLOSING_DATE" type="date" minOccurs="0" />
+                    <xsd:element name="RENOVATION_DATE" type="date" minOccurs="0" />
+                    <xsd:element name="COUNTRY_CODE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="2" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="PURCHASING_ORG" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="PURCHASING_GROUP" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="POS_SYSTEM" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="5" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="COUNTRY" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="3" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="DEPARTMENT_ASSIGNMENTS"
+                        type="ZSTORE_T_STORE_DEPARTMENT_ASSIGN"
+                        minOccurs="0" />
+                    <xsd:element name="PLANNING_DATA" type="ZSTORE_T_STORE_PLANNING_DATA"
+                        minOccurs="0" />
+                    <xsd:element name="SALES_AND_DISTRIBUTION_DATA" type="ZSTORE_T_STORE_SD_DATA"
+                        minOccurs="0" />
+                    <xsd:element name="SALES_DATA" type="ZSTORE_T_STORE_SALES_DATA" minOccurs="0" />
+                </xsd:sequence>
+            </xsd:complexType>
+        </xsd:schema>
+    </wsdl:types>
+    <wsdl:message name="ns0.Z_STORE_TEMPLATE_GET_ALL.Input">
+        <wsdl:documentation />
+        <wsdl:part name="parameters" element="ns0:Z_STORE_TEMPLATE_GET_ALL" />
+    </wsdl:message>
+    <wsdl:message name="ns0.Z_STORE_TEMPLATE_GET_ALL.Output">
+        <wsdl:documentation />
+        <wsdl:part name="parameters" element="ns0:Z_STORE_TEMPLATE_GET_ALL.Response" />
+    </wsdl:message>
+    <wsdl:message name="ns0.Z_STORE_TEMPLATE_GET_DATA.Input">
+        <wsdl:documentation />
+        <wsdl:part name="parameters" element="ns0:Z_STORE_TEMPLATE_GET_DATA" />
+    </wsdl:message>
+    <wsdl:message name="ns0.Z_STORE_TEMPLATE_GET_DATA.Output">
+        <wsdl:documentation />
+        <wsdl:part name="parameters" element="ns0:Z_STORE_TEMPLATE_GET_DATA.Response" />
+    </wsdl:message>
+    <wsdl:portType name="SI_O_SYSTEM_STOREDATA">
+        <wsdl:documentation />
+        <wsdl:operation name="GET_ALL_STORE_NUMBERS">
+            <wsdl:documentation />
+            <wsp:Policy>
+                <wsp:PolicyReference URI="#OP_GET_ALL_STORE_NUMBERS" />
+            </wsp:Policy>
+            <wsdl:input message="p1:ns0.Z_STORE_TEMPLATE_GET_ALL.Input" />
+            <wsdl:output message="p1:ns0.Z_STORE_TEMPLATE_GET_ALL.Output" />
+        </wsdl:operation>
+        <wsdl:operation name="GET_DATA">
+            <wsdl:documentation />
+            <wsp:Policy>
+                <wsp:PolicyReference URI="#OP_GET_DATA" />
+            </wsp:Policy>
+            <wsdl:input message="p1:ns0.Z_STORE_TEMPLATE_GET_DATA.Input" />
+            <wsdl:output message="p1:ns0.Z_STORE_TEMPLATE_GET_DATA.Output" />
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="SI_O_SYSTEM_STOREDATABinding" type="p1:SI_O_SYSTEM_STOREDATA">
+        <soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document"
+            transport="http://schemas.xmlsoap.org/soap/http" />
+        <wsdl:operation name="GET_ALL_STORE_NUMBERS">
+            <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                soapAction="http://example.com/xi/WebService/soap1.1" />
+            <wsdl:input>
+                <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="GET_DATA">
+            <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                soapAction="http://example.com/xi/WebService/soap1.1" />
+            <wsdl:input>
+                <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="SI_O_SYSTEM_STOREDATAService">
+        <wsdl:port name="HTTP_Port" binding="p1:SI_O_SYSTEM_STOREDATABinding">
+            <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                location="http://example-server.company.com:8080/SOAPAdapter/MessageServlet?senderParty=&amp;senderService=INTEGRATION_ENGINE&amp;receiverParty=&amp;receiverService=&amp;interface=SI_O_SYSTEM_STOREDATA&amp;interfaceNamespace=urn%3Aexample%3ASYSTEM%3ARETAIL%3AStoreData" />
+        </wsdl:port>
+        <wsdl:port name="HTTPS_Port" binding="p1:SI_O_SYSTEM_STOREDATABinding">
+            <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                location="https://example-server.company.com:8443/SOAPAdapter/MessageServlet?senderParty=&amp;senderService=INTEGRATION_ENGINE&amp;receiverParty=&amp;receiverService=&amp;interface=SI_O_SYSTEM_STOREDATA&amp;interfaceNamespace=urn%3Aexample%3ASYSTEM%3ARETAIL%3AStoreData" />
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
diff --git a/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/wsdl_options.js b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/wsdl_options.js
new file mode 100644
index 0000000..987ac6f
--- /dev/null
+++ b/test/request-response-samples/GET_ALL_STORE_NUMBERS__should_work_with_more_deeply_nested_XML_messages_and_security/wsdl_options.js
@@ -0,0 +1,3 @@
+'use strict';
+
+exports.ignoreBaseNameSpaces = false;
diff --git a/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/request.json b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/request.json
new file mode 100644
index 0000000..a0af462
--- /dev/null
+++ b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/request.json
@@ -0,0 +1,9 @@
+{
+  "IT_STORE_NUMBERS": {
+    "item": [
+      { "STORE_ID": "1001" },
+      { "STORE_ID": "1002" }
+    ]
+  },
+  "IV_REQUESTER": "REQUSER1"
+}
diff --git a/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/request.xml b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/request.xml
new file mode 100644
index 0000000..eb0e1d7
--- /dev/null
+++ b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/request.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<soapenv:Envelope
+   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:ns0="urn:company-com:document:company:rfc:functions"
+   xmlns:p1="urn:example:SYSTEM:RETAIL:StoreData"
+   xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+   <soapenv:Body>
+      <xmlns:ns0:Z_STORE_TEMPLATE_GET_DATA xmlns:urn="urn:company-com:document:company:rfc:functions">
+         <IT_STORE_NUMBERS>
+            <item>
+               <STORE_ID>1001</STORE_ID>
+            </item>
+            <item>
+               <STORE_ID>1002</STORE_ID>
+            </item>
+         </IT_STORE_NUMBERS>
+         <IV_REQUESTER>REQUSER1</IV_REQUESTER>
+      </xmlns:ns0:Z_STORE_TEMPLATE_GET_DATA>
+   </soapenv:Body>
+</soapenv:Envelope>
diff --git a/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/response.json b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/response.json
new file mode 100644
index 0000000..a9a1ffc
--- /dev/null
+++ b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/response.json
@@ -0,0 +1,40 @@
+{
+  "ET_STORE_DATA": {
+    "item": [
+      {
+        "STORE_ID": "1001",
+        "COMPANY_CODE": "C001",
+        "STORE_CUSTOMER_ID": "CUST1234",
+        "NAME1": "Downtown Store",
+        "POSTAL_CODE": "12345",
+        "CITY": "Metropolis",
+        "STREET": "Main St 1",
+        "PHONE_NUMBER": "+1-555-1111",
+        "OPENING_DATE": "2020-01-01",
+        "COUNTRY_CODE": "US"
+      },
+      {
+        "STORE_ID": "1002",
+        "COMPANY_CODE": "C002",
+        "STORE_CUSTOMER_ID": "CUST5678",
+        "NAME1": "Uptown Store",
+        "POSTAL_CODE": "67890",
+        "CITY": "Gotham",
+        "STREET": "High St 99",
+        "PHONE_NUMBER": "+1-555-2222",
+        "OPENING_DATE": "2021-06-15",
+        "COUNTRY_CODE": "US"
+      }
+    ]
+  },
+  "ET_RETURN": {
+    "item": [
+      {
+        "TYPE": "S",
+        "ID": "MSG001",
+        "NUMBER": "000",
+        "MESSAGE": "Data retrieved successfully"
+      }
+    ]
+  }
+}
diff --git a/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/response.xml b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/response.xml
new file mode 100644
index 0000000..5f0e3fa
--- /dev/null
+++ b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/response.xml
@@ -0,0 +1,42 @@
+<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"
+               xmlns:urn="urn:company-com:document:company:rfc:functions">
+   <SOAP:Header/>
+   <SOAP:Body>
+      <urn:Z_STORE_TEMPLATE_GET_DATA.Response>
+         <ET_STORE_DATA>
+            <item>
+               <STORE_ID>1001</STORE_ID>
+               <COMPANY_CODE>C001</COMPANY_CODE>
+               <STORE_CUSTOMER_ID>CUST1234</STORE_CUSTOMER_ID>
+               <NAME1>Downtown Store</NAME1>
+               <POSTAL_CODE>12345</POSTAL_CODE>
+               <CITY>Metropolis</CITY>
+               <STREET>Main St 1</STREET>
+               <PHONE_NUMBER>+1-555-1111</PHONE_NUMBER>
+               <OPENING_DATE>2020-01-01</OPENING_DATE>
+               <COUNTRY_CODE>US</COUNTRY_CODE>
+            </item>
+            <item>
+               <STORE_ID>1002</STORE_ID>
+               <COMPANY_CODE>C002</COMPANY_CODE>
+               <STORE_CUSTOMER_ID>CUST5678</STORE_CUSTOMER_ID>
+               <NAME1>Uptown Store</NAME1>
+               <POSTAL_CODE>67890</POSTAL_CODE>
+               <CITY>Gotham</CITY>
+               <STREET>High St 99</STREET>
+               <PHONE_NUMBER>+1-555-2222</PHONE_NUMBER>
+               <OPENING_DATE>2021-06-15</OPENING_DATE>
+               <COUNTRY_CODE>US</COUNTRY_CODE>
+            </item>
+         </ET_STORE_DATA>
+         <ET_RETURN>
+            <item>
+               <TYPE>S</TYPE>
+               <ID>MSG001</ID>
+               <NUMBER>000</NUMBER>
+               <MESSAGE>Data retrieved successfully</MESSAGE>
+            </item>
+         </ET_RETURN>
+      </urn:Z_STORE_TEMPLATE_GET_DATA.Response>
+   </SOAP:Body>
+</SOAP:Envelope>
diff --git a/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/soap.wsdl b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/soap.wsdl
new file mode 100644
index 0000000..3540dc3
--- /dev/null
+++ b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/soap.wsdl
@@ -0,0 +1,523 @@
+<wsdl:definitions xmlns:ns0="urn:company-com:document:company:rfc:functions"
+    xmlns:p1="urn:example:SYSTEM:RETAIL:StoreData"
+    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="SI_O_SYSTEM_STOREDATA"
+    targetNamespace="urn:example:SYSTEM:RETAIL:StoreData">
+    <wsdl:documentation />
+    <wsp:UsingPolicy wsdl:required="true" />
+    <wsp:Policy wsu:Id="OP_GET_ALL_STORE_NUMBERS" />
+    <wsp:Policy wsu:Id="OP_GET_DATA" />
+    <wsdl:types>
+        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns="urn:company-com:document:company:rfc:functions"
+            targetNamespace="urn:company-com:document:company:rfc:functions">
+            <xsd:element name="Z_STORE_TEMPLATE_GET_DATA">
+                <xsd:complexType>
+                    <xsd:all>
+                        <xsd:element name="IT_STORE_NUMBERS" minOccurs="0">
+                            <xsd:complexType>
+                                <xsd:sequence>
+                                    <xsd:element name="item" type="ZSTORE_S_STORE_NUMBERS"
+                                        minOccurs="0" maxOccurs="unbounded" />
+                                </xsd:sequence>
+                            </xsd:complexType>
+                        </xsd:element>
+                        <xsd:element name="IV_REQUESTER" minOccurs="0">
+                            <xsd:simpleType>
+                                <xsd:restriction base="xsd:string">
+                                    <xsd:maxLength value="10" />
+                                </xsd:restriction>
+                            </xsd:simpleType>
+                        </xsd:element>
+                    </xsd:all>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="Z_STORE_TEMPLATE_GET_ALL.Response">
+                <xsd:complexType>
+                    <xsd:all>
+                        <xsd:element name="ET_ALL_STORES" minOccurs="0">
+                            <xsd:complexType>
+                                <xsd:sequence>
+                                    <xsd:element name="item" type="ZSTORE_S_STORE_NUMBERS"
+                                        minOccurs="0" maxOccurs="unbounded" />
+                                </xsd:sequence>
+                            </xsd:complexType>
+                        </xsd:element>
+                        <xsd:element name="ET_RETURN" minOccurs="0">
+                            <xsd:complexType>
+                                <xsd:sequence>
+                                    <xsd:element name="item" type="BAPIRET2" minOccurs="0"
+                                        maxOccurs="unbounded" />
+                                </xsd:sequence>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:all>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="Z_STORE_TEMPLATE_GET_DATA.Response">
+                <xsd:complexType>
+                    <xsd:all>
+                        <xsd:element name="ET_STORE_DATA" minOccurs="0">
+                            <xsd:complexType>
+                                <xsd:sequence>
+                                    <xsd:element name="item" type="ZSTORE_S_STORE_DATA"
+                                        minOccurs="0"
+                                        maxOccurs="unbounded" />
+                                </xsd:sequence>
+                            </xsd:complexType>
+                        </xsd:element>
+                        <xsd:element name="ET_RETURN" minOccurs="0">
+                            <xsd:complexType>
+                                <xsd:sequence>
+                                    <xsd:element name="item" type="BAPIRET2" minOccurs="0"
+                                        maxOccurs="unbounded" />
+                                </xsd:sequence>
+                            </xsd:complexType>
+                        </xsd:element>
+                    </xsd:all>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="Z_STORE_TEMPLATE_GET_ALL">
+                <xsd:complexType>
+                    <xsd:all>
+                        <xsd:element name="IV_REQUESTER" minOccurs="0">
+                            <xsd:simpleType>
+                                <xsd:restriction base="xsd:string">
+                                    <xsd:maxLength value="10" />
+                                </xsd:restriction>
+                            </xsd:simpleType>
+                        </xsd:element>
+                    </xsd:all>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:simpleType name="genericDate">
+                <xsd:restriction base="xsd:string">
+                    <xsd:pattern value="....-..-.." />
+                </xsd:restriction>
+            </xsd:simpleType>
+            <xsd:simpleType name="date">
+                <xsd:union xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+                    xmlns="urn:company-com:document:company:rfc:functions"
+                    memberTypes="xsd:date genericDate" />
+            </xsd:simpleType>
+            <xsd:complexType name="ZSTORE_S_STORE_SD_DATA">
+                <xsd:sequence>
+                    <xsd:element name="BRAND_CODE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="CUSTOMER_GROUP" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="2" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="STORE_TYPE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="2" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="IS_INACTIVE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="1" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_S_STORE_DEPARTMENT_ASSIGN">
+                <xsd:sequence>
+                    <xsd:element name="DEPARTMENT" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="3" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_T_STORE_SALES_DATA">
+                <xsd:sequence>
+                    <xsd:element name="item" type="ZSTORE_S_STORE_SALES_DATA" minOccurs="0"
+                        maxOccurs="unbounded" />
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_T_STORE_DEPARTMENT_ASSIGN">
+                <xsd:sequence>
+                    <xsd:element name="item" type="ZSTORE_S_STORE_DEPARTMENT_ASSIGN" minOccurs="0"
+                        maxOccurs="unbounded" />
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_S_STORE_PLANNING_DATA">
+                <xsd:sequence>
+                    <xsd:element name="YEAR" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                                <xsd:pattern value="\d+" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="SEASON" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="1" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="STORE_GROUP" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="3" />
+                                <xsd:pattern value="\d+" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="STORE_FLAG" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="1" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="COMPETITIVE_FLAG" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="1" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_S_STORE_NUMBERS">
+                <xsd:sequence>
+                    <xsd:element name="STORE_ID" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_T_STORE_PLANNING_DATA">
+                <xsd:sequence>
+                    <xsd:element name="item" type="ZSTORE_S_STORE_PLANNING_DATA" minOccurs="0"
+                        maxOccurs="unbounded" />
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_S_STORE_SALES_DATA">
+                <xsd:sequence>
+                    <xsd:element name="SALES_ORG" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="DISTRIBUTION_CHANNEL" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="2" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="BAPIRET2">
+                <xsd:sequence>
+                    <xsd:element name="TYPE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="1" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="ID" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="20" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="NUMBER" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="3" />
+                                <xsd:pattern value="\d+" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="MESSAGE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="220" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="LOG_NO" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="20" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="LOG_MSG_NO" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="6" />
+                                <xsd:pattern value="\d+" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="MESSAGE_V1" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="50" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="MESSAGE_V2" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="50" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="MESSAGE_V3" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="50" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="MESSAGE_V4" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="50" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="PARAMETER" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="32" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="ROW" type="xsd:integer" minOccurs="0" />
+                    <xsd:element name="FIELD" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="30" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="SYSTEM" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="10" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_T_STORE_SD_DATA">
+                <xsd:sequence>
+                    <xsd:element name="item" type="ZSTORE_S_STORE_SD_DATA" minOccurs="0"
+                        maxOccurs="unbounded" />
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="ZSTORE_S_STORE_DATA">
+                <xsd:sequence>
+                    <xsd:element name="STORE_ID" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="COMPANY_CODE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="STORE_CUSTOMER_ID" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="8" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="NAME1" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="30" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="POSTAL_CODE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="10" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="CITY" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="25" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="STREET" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="30" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="PHONE_NUMBER" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="30" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="OPENING_DATE" type="date" minOccurs="0" />
+                    <xsd:element name="LOCATION_CODE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="CLOSING_DATE" type="date" minOccurs="0" />
+                    <xsd:element name="RENOVATION_DATE" type="date" minOccurs="0" />
+                    <xsd:element name="COUNTRY_CODE" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="2" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="PURCHASING_ORG" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="PURCHASING_GROUP" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="4" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="POS_SYSTEM" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="5" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="COUNTRY" minOccurs="0">
+                        <xsd:simpleType>
+                            <xsd:restriction base="xsd:string">
+                                <xsd:maxLength value="3" />
+                            </xsd:restriction>
+                        </xsd:simpleType>
+                    </xsd:element>
+                    <xsd:element name="DEPARTMENT_ASSIGNMENTS"
+                        type="ZSTORE_T_STORE_DEPARTMENT_ASSIGN"
+                        minOccurs="0" />
+                    <xsd:element name="PLANNING_DATA" type="ZSTORE_T_STORE_PLANNING_DATA"
+                        minOccurs="0" />
+                    <xsd:element name="SALES_AND_DISTRIBUTION_DATA" type="ZSTORE_T_STORE_SD_DATA"
+                        minOccurs="0" />
+                    <xsd:element name="SALES_DATA" type="ZSTORE_T_STORE_SALES_DATA" minOccurs="0" />
+                </xsd:sequence>
+            </xsd:complexType>
+        </xsd:schema>
+    </wsdl:types>
+    <wsdl:message name="ns0.Z_STORE_TEMPLATE_GET_ALL.Input">
+        <wsdl:documentation />
+        <wsdl:part name="parameters" element="ns0:Z_STORE_TEMPLATE_GET_ALL" />
+    </wsdl:message>
+    <wsdl:message name="ns0.Z_STORE_TEMPLATE_GET_ALL.Output">
+        <wsdl:documentation />
+        <wsdl:part name="parameters" element="ns0:Z_STORE_TEMPLATE_GET_ALL.Response" />
+    </wsdl:message>
+    <wsdl:message name="ns0.Z_STORE_TEMPLATE_GET_DATA.Input">
+        <wsdl:documentation />
+        <wsdl:part name="parameters" element="ns0:Z_STORE_TEMPLATE_GET_DATA" />
+    </wsdl:message>
+    <wsdl:message name="ns0.Z_STORE_TEMPLATE_GET_DATA.Output">
+        <wsdl:documentation />
+        <wsdl:part name="parameters" element="ns0:Z_STORE_TEMPLATE_GET_DATA.Response" />
+    </wsdl:message>
+    <wsdl:portType name="SI_O_SYSTEM_STOREDATA">
+        <wsdl:documentation />
+        <wsdl:operation name="GET_ALL_STORE_NUMBERS">
+            <wsdl:documentation />
+            <wsp:Policy>
+                <wsp:PolicyReference URI="#OP_GET_ALL_STORE_NUMBERS" />
+            </wsp:Policy>
+            <wsdl:input message="p1:ns0.Z_STORE_TEMPLATE_GET_ALL.Input" />
+            <wsdl:output message="p1:ns0.Z_STORE_TEMPLATE_GET_ALL.Output" />
+        </wsdl:operation>
+        <wsdl:operation name="GET_DATA">
+            <wsdl:documentation />
+            <wsp:Policy>
+                <wsp:PolicyReference URI="#OP_GET_DATA" />
+            </wsp:Policy>
+            <wsdl:input message="p1:ns0.Z_STORE_TEMPLATE_GET_DATA.Input" />
+            <wsdl:output message="p1:ns0.Z_STORE_TEMPLATE_GET_DATA.Output" />
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="SI_O_SYSTEM_STOREDATABinding" type="p1:SI_O_SYSTEM_STOREDATA">
+        <soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document"
+            transport="http://schemas.xmlsoap.org/soap/http" />
+        <wsdl:operation name="GET_ALL_STORE_NUMBERS">
+            <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                soapAction="http://example.com/xi/WebService/soap1.1" />
+            <wsdl:input>
+                <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="GET_DATA">
+            <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                soapAction="http://example.com/xi/WebService/soap1.1" />
+            <wsdl:input>
+                <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="SI_O_SYSTEM_STOREDATAService">
+        <wsdl:port name="HTTP_Port" binding="p1:SI_O_SYSTEM_STOREDATABinding">
+            <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                location="http://example-server.company.com:8080/SOAPAdapter/MessageServlet?senderParty=&amp;senderService=INTEGRATION_ENGINE&amp;receiverParty=&amp;receiverService=&amp;interface=SI_O_SYSTEM_STOREDATA&amp;interfaceNamespace=urn%3Aexample%3ASYSTEM%3ARETAIL%3AStoreData" />
+        </wsdl:port>
+        <wsdl:port name="HTTPS_Port" binding="p1:SI_O_SYSTEM_STOREDATABinding">
+            <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                location="https://example-server.company.com:8443/SOAPAdapter/MessageServlet?senderParty=&amp;senderService=INTEGRATION_ENGINE&amp;receiverParty=&amp;receiverService=&amp;interface=SI_O_SYSTEM_STOREDATA&amp;interfaceNamespace=urn%3Aexample%3ASYSTEM%3ARETAIL%3AStoreData" />
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
diff --git a/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/wsdl_options.js b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/wsdl_options.js
new file mode 100644
index 0000000..4adb86a
--- /dev/null
+++ b/test/request-response-samples/GET_DATA__should_work_with_more_deeply_nested_XML_messages_and_without_security/wsdl_options.js
@@ -0,0 +1,17 @@
+'use strict';
+
+exports.ignoreBaseNameSpaces = true;
+exports.envelopeKey = "soapenv";
+
+exports.ignoredNamespaces = {
+    "namespaces": ["targetNamespace", "typedNamespace"],
+    "override": "true"
+  };
+
+exports.overrideRootElement = {
+    "namespace": "xmlns:ns0",
+    "xmlnsAttributes": [{
+      "name": "xmlns:urn",
+      "value": "urn:company-com:document:company:rfc:functions"
+    }]
+  };