1UDDI::Lite(3) User Contributed Perl Documentation UDDI::Lite(3)
2
3
4
6 UDDI::Lite - Library for UDDI clients in Perl
7
9 use UDDI::Lite;
10 print UDDI::Lite
11 -> proxy('http://uddi.microsoft.com/inquire')
12 -> find_business(name => 'old')
13 -> result
14 -> businessInfos->businessInfo->serviceInfos->serviceInfo->name;
15
16 The same code with autodispatch:
17
18 use UDDI::Lite +autodispatch =>
19 proxy => 'http://uddi.microsoft.com/inquire'
20 ;
21
22 print find_business(name => 'old')
23 -> businessInfos->businessInfo->serviceInfos->serviceInfo->name;
24
25 Or with importing:
26
27 use UDDI::Lite
28 'UDDI::Lite' => [':inquiry'],
29 proxy => 'http://uddi.microsoft.com/inquire'
30 ;
31
32 print find_business(name => 'old')
33 -> businessInfos->businessInfo->serviceInfos->serviceInfo->name;
34
35 Publishing API:
36
37 use UDDI::Lite
38 import => ['UDDI::Data'],
39 import => ['UDDI::Lite'],
40 proxy => "https://some.server.com/endpoint_fot_publishing_API";
41
42 my $auth = get_authToken({userID => 'USERID', cred => 'CRED'})->authInfo;
43 my $busent = with businessEntity =>
44 name("Contoso Manufacturing"),
45 description("We make components for business"),
46 businessKey(''),
47 businessServices with businessService =>
48 name("Buy components"),
49 description("Bindings for buying our components"),
50 serviceKey(''),
51 bindingTemplates with bindingTemplate =>
52 description("BASDA invoices over HTTP post"),
53 accessPoint('http://www.contoso.com/buy.asp'),
54 bindingKey(''),
55 tModelInstanceDetails with tModelInstanceInfo =>
56 description('some tModel'),
57 tModelKey('UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4')
58 ;
59 print save_business($auth, $busent)->businessEntity->businessKey;
60
62 UDDI::Lite for Perl is a collection of Perl modules which provides a
63 simple and lightweight interface to the Universal Description, Discov‐
64 ery and Integration (UDDI) server.
65
66 To learn more about UDDI, visit http://www.uddi.org/.
67
68 The main features of the library are:
69
70 · Supports both inquiry and publishing API
71
72 · Builded on top of SOAP::Lite module, hence inherited syntax and fea‐
73 tures
74
75 · Supports easy-to-use interface with convinient access to (sub)ele‐
76 ments and attributes
77
78 · Supports HTTPS protocol
79
80 · Supports SMTP protocol
81
82 · Supports Basic/Digest server authentication
83
85 This table should give you a quick overview of the classes provided by
86 the library.
87
88 UDDI::Lite.pm
89 -- UDDI::Lite -- Main class provides all logic
90 -- UDDI::Data -- Provides extensions for serialization architecture
91 -- UDDI::Serializer -- Serializes data structures to UDDI/SOAP package
92 -- UDDI::Deserializer -- Deserializes result into objects
93 -- UDDI::SOM -- Provides access to deserialized object tree
94
95 UDDI::Lite
96
97 All methods that UDDI::Lite gives you access to can be used for both
98 setting and retrieving values. If you provide no parameters, you'll get
99 current value, and if you'll provide parameter(s), new value will be
100 assigned and method will return object (if not stated something else).
101 This is suitable for stacking these calls like:
102
103 $uddi = UDDI::Lite
104 -> on_debug(sub{print@_})
105 -> proxy('http://uddi.microsoft.com/inquire')
106 ;
107
108 Order is insignificant and you may call new() method first. If you
109 don't do it, UDDI::Lite will do it for you. However, new() method gives
110 you additional syntax:
111
112 $uddi = new UDDI::Lite
113 on_debug => sub {print@_},
114 proxy => 'http://uddi.microsoft.com/inquire'
115 ;
116
117 new() accepts hash with method names and values, and will call appro‐
118 priate method with passed value.
119
120 Since new() is optional it won't be mentioned anymore.
121
122 Other available methods inherited from SOAP::Lite and most usable are:
123
124 proxy()
125 Shortcut for "transport->proxy()". This lets you specify an end‐
126 point and also loads the required module at the same time. It is
127 required for dispatching SOAP calls. The name of the module will be
128 defined depending on the protocol specific for the endpoint.
129 SOAP::Lite will do the rest work.
130
131 on_fault()
132 Lets you specify handler for on_fault event. Default behavior is
133 die on transport error and does nothing on others. You can change
134 this behavior globally or locally, for particular object.
135
136 on_debug()
137 Lets you specify handler for on_debug event. Default behavior is do
138 nothing. Use +trace/+debug option for UDDI::Lite instead.
139
140 To change to UDDI Version 2, use the following pragma:
141
142 use UDDI::Lite uddiversion => 2;
143
144 UDDI::Data
145
146 You can use this class if you want to specify value and name for UDDI
147 elements. For example, "UDDI::Data->name('businessInfo')->value(123)"
148 will be serialized to "<businessInfo>123</businessInfo>", as well as
149 "UDDI::Data-"name(businessInfo => 123)>.
150
151 If you want to provide names for your parameters you can either specify
152
153 find_business(name => 'old')
154
155 or do it with UDDI::Data:
156
157 find_business(UDDI::Data->name(name => 'old'))
158
159 Later has some advantages: it'll work on any level, so you can do:
160
161 find_business(UDDI::Data->name(name => UDDI::Data->name(subname => 'old')))
162
163 and also you can create arrays with this syntax:
164
165 find_business(UDDI::Data->name(name =>
166 [UDDI::Data->name(subname1 => 'name1'),
167 UDDI::Data->name(subname2 => 'name2')]))
168
169 will be serialized into:
170
171 <find_business xmlns="urn:uddi-org:api" generic="1.0">
172 <name>
173 <subname1>name1</subname1>
174 <subname2>name2</subname2>
175 </name>
176 </find_business>
177
178 For standard elements more convinient syntax is available:
179
180 find_business(
181 findQualifiers(findQualifier('sortByNameAsc',
182 'caseSensitiveMatch')),
183 name('M')
184 )
185
186 and
187
188 find_business(
189 findQualifiers([findQualifier('sortByNameAsc'),
190 findQualifier('caseSensitiveMatch')]),
191 name('M')
192 )
193
194 both will generate:
195
196 <SOAP-ENV:Envelope
197 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
198 <SOAP-ENV:Body>
199 <find_business xmlns="urn:uddi-org:api" generic="1.0">
200 <findQualifiers>
201 <findQualifier>sortByNameAsc</findQualifier>
202 <findQualifier>caseSensitiveMatch</findQualifier>
203 </findQualifiers>
204 <name>M</name>
205 </find_business>
206 </SOAP-ENV:Body>
207 </SOAP-ENV:Envelope>
208
209 You can use ANY valid combinations (according to "UDDI Programmer's API
210 Specification"). If you try to generate something unusual, like
211 "name(name('myname'))", you'll get:
212
213 Don't know what to do with 'name' and 'name' elements ....
214
215 If you REALLY need to do it, use "UDDI::Data" syntax described above.
216
217 As special case you can pass hash as the first parameter of method call
218 and values of this hash will be added as attributes to top element:
219
220 find_business({maxRows => 10}, UDDI::Data->name(name => old))
221
222 gives you
223
224 <find_business xmlns="urn:uddi-org:api" generic="1.0" maxRows="10">
225 ....
226 </find_business>
227
228 You can also pass back parameters exactly as you get it from method
229 call (like you probably want to do with authInfo).
230
231 You can get access to attributes and elements through the same inter‐
232 face:
233
234 my $list = find_business(name => old);
235 my $bis = $list->businessInfos;
236 for ($bis->businessInfo) {
237 my $s = $_->serviceInfos->serviceInfo;
238 print $s->name, # element
239 $s->businessKey, # attribute
240 "\n";
241 }
242
243 To match advantages provided by "with" operator available in other lan‐
244 guages (like VB) we provide similar functionality that adds you flexi‐
245 bility:
246
247 with findQualifiers =>
248 findQualifier => 'sortByNameAsc',
249 findQualifier => 'caseSensitiveMatch'
250
251 is the same as:
252
253 with(findQualifiers =>
254 findQualifier('sortByNameAsc'),
255 findQualifier('caseSensitiveMatch'),
256 )
257
258 and:
259
260 findQualifiers->with(
261 findQualifier('sortByNameAsc'),
262 findQualifier('caseSensitiveMatch'),
263 )
264
265 will all generate the same code as mentioned above:
266
267 findQualifiers(findQualifier('sortByNameAsc',
268 'caseSensitiveMatch')),
269
270 Advantage of "with" syntax is the you can specify both attributes and
271 elements through the same interface. First argument is element where
272 all other elements and attributes will be attached. Provided examples
273 and tests cover different syntaxes.
274
275 AUTODISPATCHING
276
277 UDDI::Lite provides autodispatching feature that lets you create code
278 that looks similar for local and remote access.
279
280 For example:
281
282 use UDDI::Lite +autodispatch =>
283 proxy => 'http://uddi.microsoft.com/inquire';
284
285 tells autodispatch all UDDI calls to 'http://uddi.micro‐
286 soft.com/inquire'. All subsequent calls can look like:
287
288 find_business(name => 'old');
289 find_business(UDDI::Data->name(name => 'old'));
290 find_business(name('old'));
291
293 · Interface is still subject to change.
294
295 · Though HTTPS/SSL is supported you should specify it yourself (with
296 "proxy" or "endpoint") for publishing API calls.
297
299 For now UDDI::Lite is distributed as part of SOAP::Lite package. You
300 can download it from ( http://soaplite.com/ ) or from CPAN (
301 http://search.cpan.org/search?dist=SOAP-Lite ).
302
304 SOAP::Lite ( http://search.cpan.org/search?dist=SOAP-Lite ) UDDI (
305 http://search.cpan.org/search?dist=UDDI )
306
308 Copyright (C) 2000-2004 Paul Kulchenko. All rights reserved.
309
310 This library is free software; you can redistribute it and/or modify it
311 under the same terms as Perl itself.
312
314 Paul Kulchenko (paulclinger@yahoo.com)
315
316
317
318perl v5.8.8 2006-06-15 UDDI::Lite(3)