forked from pixmeo/osirix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathN2WSDL.mm
59 lines (45 loc) · 1.62 KB
/
N2WSDL.mm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*=========================================================================
Program: OsiriX
Copyright (c) OsiriX Team
All rights reserved.
Distributed under GNU - LGPL
See http://www.osirix-viewer.com/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
=========================================================================*/
#import "N2WSDL.h"
@implementation N2WSDL
-(id)init {
self = [super init];
_types = [[NSMutableArray alloc] initWithCapacity:64];
_messages = [[NSMutableArray alloc] initWithCapacity:64];
_operations = [[NSMutableArray alloc] initWithCapacity:64];
_portTypes = [[NSMutableArray alloc] initWithCapacity:64];
_bindings = [[NSMutableArray alloc] initWithCapacity:64];
_ports = [[NSMutableArray alloc] initWithCapacity:64];
_services = [[NSMutableArray alloc] initWithCapacity:64];
return self;
}
-(void)dealloc {
[_types release];
[_messages release];
[_operations release];
[_portTypes release];
[_bindings release];
[_ports release];
[_services release];
[super dealloc];
}
-(id)initWithContentsOfURL:(NSURL*)url {
self = [self init];
NSError* error = NULL;
NSXMLDocument* wsdl = [[NSXMLDocument alloc] initWithContentsOfURL:url options:0 error:&error];
if (error)
[NSException raise:NSGenericException format:@"[NSXMLDocument initWithContentsOfURL:] error: %@", [error description]];
for (NSXMLElement* type in [wsdl objectsForXQuery:@"/wsdl:definitions/wsdl:types/*" error:&error])
NSLog(@"%@", [type XMLString]);
[wsdl release];
return self;
}
@end