File tree Expand file tree Collapse file tree 4 files changed +71
-3
lines changed Expand file tree Collapse file tree 4 files changed +71
-3
lines changed Original file line number Diff line number Diff line change @@ -1093,8 +1093,11 @@ WSDL.prototype._processNextInclude = function(includes, callback) {
1093
1093
if ( err ) {
1094
1094
return callback ( err ) ;
1095
1095
}
1096
-
1097
- self . definitions . schemas [ include . namespace || wsdl . definitions . $targetNamespace ] = deepMerge ( self . definitions . schemas [ include . namespace || wsdl . definitions . $targetNamespace ] , wsdl . definitions ) ;
1096
+ if ( wsdl . definitions instanceof DefinitionsElement ) {
1097
+ _ . merge ( self . definitions , wsdl . definitions ) ;
1098
+ } else {
1099
+ self . definitions . schemas [ include . namespace || wsdl . definitions . $targetNamespace ] = deepMerge ( self . definitions . schemas [ include . namespace || wsdl . definitions . $targetNamespace ] , wsdl . definitions ) ;
1100
+ }
1098
1101
self . _processNextInclude ( includes , function ( err ) {
1099
1102
callback ( err ) ;
1100
1103
} ) ;
Original file line number Diff line number Diff line change @@ -44,12 +44,20 @@ wsdlNonStrictTests['should catch parse error'] = function(done) {
44
44
} ;
45
45
46
46
wsdlStrictTests [ 'should catch parse error' ] = function ( done ) {
47
- soap . createClient ( __dirname + '/wsdl/bad.txt' , function ( err ) {
47
+ soap . createClient ( __dirname + '/wsdl/bad.txt' , { strict : true } , function ( err ) {
48
48
assert . notEqual ( err , null ) ;
49
49
done ( ) ;
50
50
} ) ;
51
51
} ;
52
52
53
+ wsdlStrictTests [ 'should parse external wsdl' ] = function ( done ) {
54
+ soap . createClient ( __dirname + '/wsdl/wsdlImport/main.wsdl' , { strict : true } , function ( err , client ) {
55
+ assert . ok ( ! err ) ;
56
+ assert . equal ( typeof client . getLatestVersion , 'function' ) ;
57
+ done ( ) ;
58
+ } ) ;
59
+ } ;
60
+
53
61
module . exports = {
54
62
'WSDL Parser (strict)' : wsdlStrictTests ,
55
63
'WSDL Parser (non-strict)' : wsdlNonStrictTests
Original file line number Diff line number Diff line change
1
+ <?xml version =' 1.0' encoding =' UTF-8' ?><wsdl : definitions name =" UserRemoteServiceImplService" targetNamespace =" http://base.example.com" xmlns : ns1 =" http://example.com/" xmlns : ns2 =" http://cxf.apache.org/bindings/xformat" xmlns : soap =" http://schemas.xmlsoap.org/wsdl/soap/" xmlns : tns =" http://base.example.com" xmlns : wsdl =" http://schemas.xmlsoap.org/wsdl/" xmlns : xsd =" http://www.w3.org/2001/XMLSchema" >
2
+ <wsdl : import location =" sub.wsdl" namespace =" http://example.com/" >
3
+ </wsdl : import >
4
+ <wsdl : binding name =" UserRemoteServiceImplServiceSoapBinding" type =" ns1:IUserRemoteService" >
5
+ <soap : binding style =" document" transport =" http://schemas.xmlsoap.org/soap/http" />
6
+ <wsdl : operation name =" getLatestVersion" >
7
+ <soap : operation soapAction =" " style =" document" />
8
+ <wsdl : input name =" getLatestVersion" >
9
+ <soap : body use =" literal" />
10
+ </wsdl : input >
11
+ <wsdl : output name =" getLatestVersionResponse" >
12
+ <soap : body use =" literal" />
13
+ </wsdl : output >
14
+ </wsdl : operation >
15
+
16
+ </wsdl : binding >
17
+ <wsdl : service name =" UserRemoteServiceImplService" >
18
+ <wsdl : port binding =" tns:UserRemoteServiceImplServiceSoapBinding" name =" UserRemoteServiceImplPort" >
19
+ <soap : address location =" http://example.com/ws/UserRemoteService" />
20
+ </wsdl : port >
21
+ </wsdl : service >
22
+ </wsdl : definitions >
Original file line number Diff line number Diff line change
1
+ <?xml version =' 1.0' encoding =' UTF-8' ?><wsdl : definitions name =" IUserRemoteService" targetNamespace =" http://example.com/" xmlns : ns1 =" http://example.com/" xmlns : wsdl =" http://schemas.xmlsoap.org/wsdl/" xmlns : xsd =" http://www.w3.org/2001/XMLSchema" >
2
+ <wsdl : types >
3
+ <xs : schema elementFormDefault =" unqualified" targetNamespace =" http://example.com/" version =" 1.0" xmlns : tns =" http://example.com/" xmlns : xs =" http://www.w3.org/2001/XMLSchema" >
4
+
5
+ <xs : element name =" getLatestVersion" type =" tns:getLatestVersion" />
6
+ <xs : element name =" getLatestVersionResponse" type =" tns:getLatestVersionResponse" />
7
+
8
+ <xs : complexType name =" getLatestVersion" >
9
+ <xs : sequence />
10
+ </xs : complexType >
11
+ <xs : complexType name =" getLatestVersionResponse" >
12
+ <xs : sequence >
13
+ <xs : element minOccurs =" 0" name =" return" type =" xs:long" />
14
+ </xs : sequence >
15
+ </xs : complexType >
16
+
17
+ </xs : schema >
18
+ </wsdl : types >
19
+ <wsdl : message name =" getLatestVersion" >
20
+ <wsdl : part element =" ns1:getLatestVersion" name =" parameters" >
21
+ </wsdl : part >
22
+ </wsdl : message >
23
+ <wsdl : message name =" getLatestVersionResponse" >
24
+ <wsdl : part element =" ns1:getLatestVersionResponse" name =" parameters" ></wsdl : part >
25
+ </wsdl : message >
26
+ <wsdl : portType name =" IUserRemoteService" >
27
+ <wsdl : operation name =" getLatestVersion" >
28
+ <wsdl : input message =" ns1:getLatestVersion" name =" getLatestVersion" >
29
+ </wsdl : input >
30
+ <wsdl : output message =" ns1:getLatestVersionResponse" name =" getLatestVersionResponse" >
31
+ </wsdl : output >
32
+ </wsdl : operation >
33
+
34
+ </wsdl : portType >
35
+ </wsdl : definitions >
You can’t perform that action at this time.
0 commit comments