@@ -389,13 +389,13 @@ describe('SchemaPack convert unit test WSDL 1.1 with options', function () {
389389 expectedOutput = `<?xml version=\"1.0\" encoding=\"utf-8\"?>
390390 <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
391391 <soap:Header>
392- <tns:AuthHeader xmlns=\"http://localhost/App.asmx\" CultureName=\"string\">
392+ <tns:AuthHeader xmlns:tns =\"http://localhost/App.asmx\" CultureName=\"string\">
393393 <tns:UserName>string</tns:UserName>
394394 <tns:Password>string</tns:Password>
395395 </tns:AuthHeader>
396396 </soap:Header>
397397 <soap:Body>
398- <tns:ChangePassword xmlns=\"http://localhost/App.asmx\">
398+ <tns:ChangePassword xmlns:tns =\"http://localhost/App.asmx\">
399399 <tns:userName>string</tns:userName>
400400 <tns:password>string</tns:password>
401401 <tns:oldPassword>string</tns:oldPassword>
@@ -412,6 +412,33 @@ describe('SchemaPack convert unit test WSDL 1.1 with options', function () {
412412 . to . equal ( removeLineBreakTabsSpaces ( expectedOutput ) ) ;
413413 } ) ;
414414 } ) ;
415+
416+ it ( '[Github #13300] - Should add proper namespace prefix to body element in request' , function ( ) {
417+ let fileContent = fs . readFileSync ( validWSDLs + '/targetNamespacePrefix.wsdl' , 'utf8' ) ;
418+
419+ const schema = new SchemaPack ( {
420+ data : fileContent ,
421+ type : 'string'
422+ } , { } ) ,
423+ expectedOutput = `<?xml version="1.0" encoding="utf-8"?>
424+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
425+ <soap:Body>
426+ <tns:TitleCaseWordsWithToken xmlns:tns="http://www.dataaccess.com/webservicesserver/">
427+ <tns:sText>string</tns:sText>
428+ <tns:sToken>string</tns:sToken>
429+ </tns:TitleCaseWordsWithToken>
430+ </soap:Body>
431+ </soap:Envelope>` ;
432+
433+ schema . convert ( ( error , result ) => {
434+ expect ( error ) . to . be . null ;
435+ expect ( result ) . to . be . an ( 'object' ) ;
436+ expect ( result . output [ 0 ] . data . item ) . to . have . lengthOf ( 1 ) ;
437+ expect ( result . output [ 0 ] . data . item [ 0 ] . name ) . to . eql ( 'TitleCaseWordsWithToken' ) ;
438+ expect ( removeLineBreakTabsSpaces ( result . output [ 0 ] . data . item [ 0 ] . request . body . raw ) )
439+ . to . equal ( removeLineBreakTabsSpaces ( expectedOutput ) ) ;
440+ } ) ;
441+ } ) ;
415442} ) ;
416443
417444describe ( 'SchemaPack convert unit test WSDL 2.0' , function ( ) {
0 commit comments