1# ======================================================================
2#
3# Copyright (C) 2000-2001 Paul Kulchenko (paulclinger@yahoo.com)
4# SOAP::Lite is free software; you can redistribute it
5# and/or modify it under the same terms as Perl itself.
6#
7# $Id: Lite.pm 414 2012-07-15 09:18:42Z kutterma $
8#
9# ======================================================================
10
11package UDDI::Lite;
12use 5.006;
13use strict;
14{
15our $VERSION = 0.715;
16}
17# ======================================================================
18
19package UDDI::Constants;
20our $VERSION = 0.715;
21
22BEGIN
23{
24    use vars
25      qw(%UDDI_VERSIONS $ELEMENTS $ATTRIBUTES $WITHNAMES $NAMESPACE $GENERIC);
26
27    %UDDI_VERSIONS = (
28        1 => {
29            ELEMENTS => {
30                address         => { addressLine     => 1 },
31                authToken       => { authInfo        => 1 },
32                bindingDetail   => { bindingTemplate => 1 },
33                bindingTemplate => {
34                    accessPoint           => 1,
35                    description           => 1,
36                    hostingRedirector     => 1,
37                    tModelInstanceDetails => 1
38                },
39                bindingTemplates  => { bindingTemplate   => 1 },
40                businessDetail    => { businessEntity    => 1 },
41                businessDetailExt => { businessEntityExt => 1 },
42                businessEntity    => {
43                    businessServices => 1,
44                    categoryBag      => 1,
45                    contacts         => 1,
46                    description      => 1,
47                    discoveryURLs    => 1,
48                    identifierBag    => 1,
49                    name             => 1
50                },
51                businessEntityExt => { businessEntity => 1 },
52                businessInfo      =>
53                  { description => 1, name => 1, serviceInfos => 1 },
54                businessInfos   => { businessInfo  => 1 },
55                businessList    => { businessInfos => 1 },
56                businessService => {
57                    bindingTemplates => 1,
58                    categoryBag      => 1,
59                    description      => 1,
60                    name             => 1
61                },
62                businessServices => { businessService => 1 },
63                categoryBag      => { keyedReference  => 1 },
64                contact          => {
65                    address     => 1,
66                    description => 1,
67                    email       => 1,
68                    personName  => 1,
69                    phone       => 1
70                },
71                contacts          => { contact       => 1 },
72                delete_binding    => { authInfo      => 1, bindingKey => 1 },
73                delete_business   => { authInfo      => 1, businessKey => 1 },
74                delete_service    => { authInfo      => 1, serviceKey => 1 },
75                delete_tModel     => { authInfo      => 1, tModelKey => 1 },
76                discard_authToken => { authInfo      => 1 },
77                discoveryURLs     => { discoveryUrl  => 1 },
78                dispositionReport => { result        => 1 },
79                findQualifiers    => { findQualifier => 1 },
80                find_binding => { findQualifiers => 1, tModelBag => 1 },
81                find_business => {
82                    categoryBag    => 1,
83                    discoveryURLs  => 1,
84                    findQualifiers => 1,
85                    identifierBag  => 1,
86                    name           => 1,
87                    tModelBag      => 1
88                },
89                find_service => {
90                    categoryBag    => 1,
91                    findQualifiers => 1,
92                    name           => 1,
93                    tModelBag      => 1
94                },
95                find_tModel => {
96                    categoryBag    => 1,
97                    findQualifiers => 1,
98                    identifierBag  => 1,
99                    name           => 1
100                },
101                get_bindingDetail     => { bindingKey     => 1 },
102                get_businessDetail    => { businessKey    => 1 },
103                get_businessDetailExt => { businessKey    => 1 },
104                get_registeredInfo    => { authInfo       => 1 },
105                get_serviceDetail     => { serviceKey     => 1 },
106                get_tModelDetail      => { tModelKey      => 1 },
107                identifierBag         => { keyedReference => 1 },
108                instanceDetails       =>
109                  { description => 1, instanceParms => 1, overviewDoc => 1 },
110                overviewDoc    => { description   => 1, overviewURL => 1 },
111                registeredInfo => { businessInfos => 1, tModelInfos => 1 },
112                result         => { errInfo       => 1 },
113                save_binding  => { authInfo => 1, bindingTemplate => 1 },
114                save_business =>
115                  { authInfo => 1, businessEntity => 1, uploadRegister => 1 },
116                save_service => { authInfo => 1, businessService => 1 },
117                save_tModel  =>
118                  { authInfo => 1, tModel => 1, uploadRegister => 1 },
119                serviceDetail => { businessService => 1 },
120                serviceInfo   => { name            => 1 },
121                serviceInfos  => { serviceInfo     => 1 },
122                serviceList   => { serviceInfos    => 1 },
123                tModel        => {
124                    categoryBag   => 1,
125                    description   => 1,
126                    identifierBag => 1,
127                    name          => 1,
128                    overviewDoc   => 1
129                },
130                tModelBag             => { tModelKey          => 1 },
131                tModelDetail          => { tModel             => 1 },
132                tModelInfo            => { name               => 1 },
133                tModelInfos           => { tModelInfo         => 1 },
134                tModelInstanceDetails => { tModelInstanceInfo => 1 },
135                tModelInstanceInfo    =>
136                  { description => 1, instanceDetails => 1 },
137                tModelList              => { tModelInfos => 1 },
138                validate_categorization => {
139                    businessEntity  => 1,
140                    businessService => 1,
141                    keyValue        => 1,
142                    tModel          => 1,
143                    tModelKey       => 1
144                }
145            },
146            ATTRIBUTES => {
147                accessPoint => { URLType  => 2 },
148                address     => { sortCode => 2, useType => 2 },
149                authToken   => { generic  => 2, operator => 2 },
150                bindingDetail =>
151                  { generic => 2, operator => 2, truncated => 2 },
152                bindingTemplate => { bindingKey => 2, serviceKey => 2 },
153                businessDetail  =>
154                  { generic => 2, operator => 2, truncated => 2 },
155                businessDetailExt =>
156                  { generic => 2, operator => 2, truncated => 2 },
157                businessEntity =>
158                  { authorizedName => 2, businessKey => 2, operator => 2 },
159                businessInfo => { businessKey => 2 },
160                businessList =>
161                  { generic => 2, operator => 2, truncated => 2 },
162                businessService   => { businessKey => 2, serviceKey => 2 },
163                contact           => { useType     => 2 },
164                delete_binding    => { generic     => 2 },
165                delete_business   => { generic     => 2 },
166                delete_service    => { generic     => 2 },
167                delete_tModel     => { generic     => 2 },
168                description       => { lang        => 2 },
169                discard_authToken => { generic     => 2 },
170                discoveryUrl      => { useType     => 2 },
171                dispositionReport =>
172                  { generic => 2, operator => 2, truncated => 2 },
173                email        => { useType => 2 },
174                errInfo      => { errCode => 2 },
175                find_binding =>
176                  { generic => 2, maxRows => 2, serviceKey => 2 },
177                find_business => { generic => 2, maxRows => 2 },
178                find_service  =>
179                  { businessKey => 2, generic => 2, maxRows => 2 },
180                find_tModel   => { generic => 2, maxRows => 2 },
181                get_authToken => { cred    => 2, generic => 2, userID => 2 },
182                get_bindingDetail     => { generic    => 2 },
183                get_businessDetail    => { generic    => 2 },
184                get_businessDetailExt => { generic    => 2 },
185                get_registeredInfo    => { generic    => 2 },
186                get_serviceDetail     => { generic    => 2 },
187                get_tModelDetail      => { generic    => 2 },
188                hostingRedirector     => { bindingKey => 2 },
189                keyedReference        =>
190                  { keyName => 2, keyValue => 2, tModelKey => 2 },
191                phone          => { useType => 2 },
192                registeredInfo =>
193                  { generic => 2, operator => 2, truncated => 2 },
194                result        => { errno   => 2, keyType => 2 },
195                save_binding  => { generic => 2 },
196                save_business => { generic => 2 },
197                save_service  => { generic => 2 },
198                save_tModel   => { generic => 2 },
199                serviceDetail =>
200                  { generic => 2, operator => 2, truncated => 2 },
201                serviceInfo => { businessKey => 2, serviceKey => 2 },
202                serviceList =>
203                  { generic => 2, operator => 2, truncated => 2 },
204                tModel =>
205                  { authorizedName => 2, operator => 2, tModelKey => 2 },
206                tModelDetail =>
207                  { generic => 2, operator => 2, truncated => 2 },
208                tModelInfo         => { tModelKey => 2 },
209                tModelInstanceInfo => { tModelKey => 2 },
210                tModelList => { generic => 2, operator => 2, truncated => 2 },
211                validate_categorization => { generic => 2 }
212            },
213            WITHNAMES => [
214                qw/accessPoint address addressLine authInfo authToken bindingDetail bindingKey bindingTemplate bindingTemplates businessDetail businessDetailExt businessEntity businessEntityExt businessInfo businessInfos businessKey businessList businessService businessServices categoryBag contact contacts description discoveryURLs discoveryUrl dispositionReport email errInfo findQualifier findQualifiers hostingRedirector identifierBag instanceDetails instanceParms keyValue keyedReference name overviewDoc overviewURL personName phone registeredInfo result serviceDetail serviceInfo serviceInfos serviceKey serviceList tModel tModelBag tModelDetail tModelInfo tModelInfos tModelInstanceDetails tModelInstanceInfo tModelKey tModelList uploadRegister/
215            ],
216            NAMESPACE => 'urn:uddi-org:api',
217            GENERIC   => '1.0',             # string, not number; '.0' matters
218        },
219        2 => {
220            ELEMENTS => {
221                add_publisherAssertions =>
222                  { authInfo => 1, publisherAssertion => 1 },
223                address             => { addressLine => 1 },
224                assertionStatusItem => {
225                    fromKey        => 1,
226                    keyedReference => 1,
227                    keysOwned      => 1,
228                    toKey          => 1
229                },
230                assertionStatusReport => { assertionStatusItem => 1 },
231                authToken             => { authInfo            => 1 },
232                bindingDetail         => { bindingTemplate     => 1 },
233                bindingTemplate       => {
234                    accessPoint           => 1,
235                    description           => 1,
236                    hostingRedirector     => 1,
237                    tModelInstanceDetails => 1
238                },
239                bindingTemplates  => { bindingTemplate   => 1 },
240                businessDetail    => { businessEntity    => 1 },
241                businessDetailExt => { businessEntityExt => 1 },
242                businessEntity    => {
243                    businessServices => 1,
244                    categoryBag      => 1,
245                    contacts         => 1,
246                    description      => 1,
247                    discoveryURLs    => 1,
248                    identifierBag    => 1,
249                    name             => 1
250                },
251                businessEntityExt => { businessEntity => 1 },
252                businessInfo      =>
253                  { description => 1, name => 1, serviceInfos => 1 },
254                businessInfos   => { businessInfo  => 1 },
255                businessList    => { businessInfos => 1 },
256                businessService => {
257                    bindingTemplates => 1,
258                    categoryBag      => 1,
259                    description      => 1,
260                    name             => 1
261                },
262                businessServices => { businessService => 1 },
263                categoryBag      => { keyedReference  => 1 },
264                contact          => {
265                    address     => 1,
266                    description => 1,
267                    email       => 1,
268                    personName  => 1,
269                    phone       => 1
270                },
271                contacts        => { contact  => 1 },
272                delete_binding  => { authInfo => 1, bindingKey => 1 },
273                delete_business => { authInfo => 1, businessKey => 1 },
274                delete_publisherAssertions =>
275                  { authInfo => 1, publisherAssertion => 1 },
276                delete_service    => { authInfo       => 1, serviceKey => 1 },
277                delete_tModel     => { authInfo       => 1, tModelKey  => 1 },
278                discard_authToken => { authInfo       => 1 },
279                discoveryURLs     => { discoveryURL   => 1 },
280                dispositionReport => { result         => 1 },
281                findQualifiers    => { findQualifier  => 1 },
282                find_binding      => { findQualifiers => 1, tModelBag  => 1 },
283                find_business     => {
284                    categoryBag    => 1,
285                    discoveryURLs  => 1,
286                    findQualifiers => 1,
287                    identifierBag  => 1,
288                    name           => 1,
289                    tModelBag      => 1
290                },
291                find_relatedBusinesses => {
292                    businessKey    => 1,
293                    findQualifiers => 1,
294                    keyedReference => 1
295                },
296                find_service => {
297                    categoryBag    => 1,
298                    findQualifiers => 1,
299                    name           => 1,
300                    tModelBag      => 1
301                },
302                find_tModel => {
303                    categoryBag    => 1,
304                    findQualifiers => 1,
305                    identifierBag  => 1,
306                    name           => 1
307                },
308                get_assertionStatusReport =>
309                  { authInfo => 1, completionStatus => 1 },
310                get_bindingDetail       => { bindingKey     => 1 },
311                get_businessDetail      => { businessKey    => 1 },
312                get_businessDetailExt   => { businessKey    => 1 },
313                get_publisherAssertions => { authInfo       => 1 },
314                get_registeredInfo      => { authInfo       => 1 },
315                get_serviceDetail       => { serviceKey     => 1 },
316                get_tModelDetail        => { tModelKey      => 1 },
317                identifierBag           => { keyedReference => 1 },
318                instanceDetails         =>
319                  { description => 1, instanceParms => 1, overviewDoc => 1 },
320                keysOwned          => { fromKey     => 1, toKey       => 1 },
321                overviewDoc        => { description => 1, overviewURL => 1 },
322                publisherAssertion =>
323                  { fromKey => 1, keyedReference => 1, toKey => 1 },
324                publisherAssertions => { publisherAssertion => 1 },
325                registeredInfo => { businessInfos => 1, tModelInfos => 1 },
326                relatedBusinessInfo => {
327                    businessKey         => 1,
328                    description         => 1,
329                    name                => 1,
330                    sharedRelationships => 1
331                },
332                relatedBusinessInfos  => { relatedBusinessInfo => 1 },
333                relatedBusinessesList =>
334                  { businessKey => 1, relatedBusinessInfos => 1 },
335                result       => { errInfo  => 1 },
336                save_binding => { authInfo => 1, bindingTemplate => 1 },
337                save_business =>
338                  { authInfo => 1, businessEntity => 1, uploadRegister => 1 },
339                save_service => { authInfo => 1, businessService => 1 },
340                save_tModel  =>
341                  { authInfo => 1, tModel => 1, uploadRegister => 1 },
342                serviceDetail           => { businessService => 1 },
343                serviceInfo             => { name            => 1 },
344                serviceInfos            => { serviceInfo     => 1 },
345                serviceList             => { serviceInfos    => 1 },
346                set_publisherAssertions =>
347                  { authInfo => 1, publisherAssertion => 1 },
348                sharedRelationships => { keyedReference => 1 },
349                tModel              => {
350                    categoryBag   => 1,
351                    description   => 1,
352                    identifierBag => 1,
353                    name          => 1,
354                    overviewDoc   => 1
355                },
356                tModelBag             => { tModelKey          => 1 },
357                tModelDetail          => { tModel             => 1 },
358                tModelInfo            => { name               => 1 },
359                tModelInfos           => { tModelInfo         => 1 },
360                tModelInstanceDetails => { tModelInstanceInfo => 1 },
361                tModelInstanceInfo    =>
362                  { description => 1, instanceDetails => 1 },
363                tModelList      => { tModelInfos => 1 },
364                validate_values =>
365                  { businessEntity => 1, businessService => 1, tModel => 1 }
366            },
367            ATTRIBUTES => {
368                accessPoint             => { URLType => 2 },
369                add_publisherAssertions => { generic => 2 },
370                address => { sortCode => 2, tModelKey => 2, useType => 2 },
371                addressLine => { keyName => 2, keyValue => 2 },
372                assertionStatusItem => { completionStatus => 2 },
373                assertionStatusReport => { generic => 2, operator => 2 },
374                authToken     => { generic => 2, operator => 2 },
375                bindingDetail =>
376                  { generic => 2, operator => 2, truncated => 2 },
377                bindingTemplate => { bindingKey => 2, serviceKey => 2 },
378                businessDetail  =>
379                  { generic => 2, operator => 2, truncated => 2 },
380                businessDetailExt =>
381                  { generic => 2, operator => 2, truncated => 2 },
382                businessEntity =>
383                  { authorizedName => 2, businessKey => 2, operator => 2 },
384                businessInfo => { businessKey => 2 },
385                businessList =>
386                  { generic => 2, operator => 2, truncated => 2 },
387                businessService => { businessKey => 2, serviceKey => 2 },
388                contact         => { useType     => 2 },
389                delete_binding  => { generic     => 2 },
390                delete_business => { generic     => 2 },
391                delete_publisherAssertions => { generic => 2 },
392                delete_service             => { generic => 2 },
393                delete_tModel              => { generic => 2 },
394                description                => { lang    => 2 },
395                discard_authToken          => { generic => 2 },
396                discoveryURL               => { useType => 2 },
397                dispositionReport          =>
398                  { generic => 2, operator => 2, truncated => 2 },
399                email        => { useType => 2 },
400                errInfo      => { errCode => 2 },
401                find_binding =>
402                  { generic => 2, maxRows => 2, serviceKey => 2 },
403                find_business          => { generic => 2, maxRows => 2 },
404                find_relatedBusinesses => { generic => 2, maxRows => 2 },
405                find_service           =>
406                  { businessKey => 2, generic => 2, maxRows => 2 },
407                find_tModel               => { generic => 2, maxRows => 2 },
408                get_assertionStatusReport => { generic => 2 },
409                get_authToken => { cred => 2, generic => 2, userID => 2 },
410                get_bindingDetail       => { generic    => 2 },
411                get_businessDetail      => { generic    => 2 },
412                get_businessDetailExt   => { generic    => 2 },
413                get_publisherAssertions => { generic    => 2 },
414                get_registeredInfo      => { generic    => 2 },
415                get_serviceDetail       => { generic    => 2 },
416                get_tModelDetail        => { generic    => 2 },
417                hostingRedirector       => { bindingKey => 2 },
418                keyedReference          =>
419                  { keyName => 2, keyValue => 2, tModelKey => 2 },
420                name                => { lang    => 2 },
421                phone               => { useType => 2 },
422                publisherAssertions =>
423                  { authorizedName => 2, generic => 2, operator => 2 },
424                registeredInfo =>
425                  { generic => 2, operator => 2, truncated => 2 },
426                relatedBusinessesList =>
427                  { generic => 2, operator => 2, truncated => 2 },
428                result        => { errno   => 2, keyType => 2 },
429                save_binding  => { generic => 2 },
430                save_business => { generic => 2 },
431                save_service  => { generic => 2 },
432                save_tModel   => { generic => 2 },
433                serviceDetail =>
434                  { generic => 2, operator => 2, truncated => 2 },
435                serviceInfo => { businessKey => 2, serviceKey => 2 },
436                serviceList =>
437                  { generic => 2, operator => 2, truncated => 2 },
438                set_publisherAssertions => { generic   => 2 },
439                sharedRelationships     => { direction => 2 },
440                tModel                  =>
441                  { authorizedName => 2, operator => 2, tModelKey => 2 },
442                tModelDetail =>
443                  { generic => 2, operator => 2, truncated => 2 },
444                tModelInfo         => { tModelKey => 2 },
445                tModelInstanceInfo => { tModelKey => 2 },
446                tModelList => { generic => 2, operator => 2, truncated => 2 },
447                validate_values => { generic => 2 }
448            },
449            WITHNAMES => [
450                qw/accessPoint address addressLine assertionStatusItem assertionStatusReport authInfo authToken bindingDetail bindingKey bindingTemplate bindingTemplates businessDetail businessDetailExt businessEntity businessEntityExt businessInfo businessInfos businessKey businessList businessService businessServices categoryBag completionStatus contact contacts description discoveryURL discoveryURLs dispositionReport email errInfo findQualifier findQualifiers fromKey hostingRedirector identifierBag instanceDetails instanceParms keyedReference keysOwned name overviewDoc overviewURL personName phone publisherAssertion publisherAssertions registeredInfo relatedBusinessInfo relatedBusinessInfos relatedBusinessesList result serviceDetail serviceInfo serviceInfos serviceKey serviceList sharedRelationships tModel tModelBag tModelDetail tModelInfo tModelInfos tModelInstanceDetails tModelInstanceInfo tModelKey tModelList toKey uploadRegister/
451            ],
452            NAMESPACE => 'urn:uddi-org:api_v2',
453            GENERIC   => '2.0',
454        },
455        3 => {
456            ELEMENTS => {
457                add_publisherAssertions =>
458                  { authInfo => 1, publisherAssertion => 1 },
459                address             => { addressLine => 1 },
460                assertionStatusItem => {
461                    fromKey        => 1,
462                    keyedReference => 1,
463                    keysOwned      => 1,
464                    toKey          => 1
465                },
466                assertionStatusReport => { assertionStatusItem => 1 },
467                authToken             => { authInfo            => 1 },
468                bindingDetail         =>
469                  { bindingTemplate => 1, listDescription => 1 },
470                bindingTemplate => {
471                    accessPoint           => 1,
472                    categoryBag           => 1,
473                    description           => 1,
474                    Signature             => 1,
475                    hostingRedirector     => 1,
476                    tModelInstanceDetails => 1
477                },
478                bindingTemplates => { bindingTemplate => 1 },
479                businessDetail   => { businessEntity  => 1 },
480                businessEntity   => {
481                    businessServices => 1,
482                    categoryBag      => 1,
483                    contacts         => 1,
484                    description      => 1,
485                    discoveryURLs    => 1,
486                    Signature        => 1,
487                    identifierBag    => 1,
488                    name             => 1
489                },
490                businessInfo =>
491                  { description => 1, name => 1, serviceInfos => 1 },
492                businessInfos => { businessInfo  => 1 },
493                businessList  => { businessInfos => 1, listDescription => 1 },
494                businessService => {
495                    bindingTemplates => 1,
496                    categoryBag      => 1,
497                    description      => 1,
498                    Signature        => 1,
499                    name             => 1
500                },
501                businessServices => { businessService => 1 },
502                categoryBag      => {
503                    keyedReference      => 1,
504                    keyedReferenceGroup => 1,
505                    keyedReferenceGroup => 1
506                },
507                contact => {
508                    address     => 1,
509                    description => 1,
510                    email       => 1,
511                    personName  => 1,
512                    phone       => 1
513                },
514                contacts        => { contact  => 1 },
515                delete_binding  => { authInfo => 1, bindingKey => 1 },
516                delete_business => { authInfo => 1, businessKey => 1 },
517                delete_publisherAssertions =>
518                  { authInfo => 1, publisherAssertion => 1 },
519                delete_service    => { authInfo      => 1, serviceKey => 1 },
520                delete_tModel     => { authInfo      => 1, tModelKey  => 1 },
521                discard_authToken => { authInfo      => 1 },
522                discoveryURLs     => { discoveryURL  => 1 },
523                dispositionReport => { result        => 1 },
524                findQualifiers    => { findQualifier => 1 },
525                find_binding      => {
526                    authInfo       => 1,
527                    categoryBag    => 1,
528                    findQualifiers => 1,
529                    find_tModel    => 1,
530                    tModelBag      => 1
531                },
532                find_business => {
533                    authInfo               => 1,
534                    categoryBag            => 1,
535                    discoveryURLs          => 1,
536                    findQualifiers         => 1,
537                    find_relatedBusinesses => 1,
538                    find_tModel            => 1,
539                    identifierBag          => 1,
540                    name                   => 1,
541                    tModelBag              => 1
542                },
543                find_relatedBusinesses => {
544                    authInfo       => 1,
545                    businessKey    => 1,
546                    findQualifiers => 1,
547                    fromKey        => 1,
548                    keyedReference => 1,
549                    toKey          => 1
550                },
551                find_service => {
552                    authInfo       => 1,
553                    categoryBag    => 1,
554                    findQualifiers => 1,
555                    find_tModel    => 1,
556                    name           => 1,
557                    tModelBag      => 1
558                },
559                find_tModel => {
560                    authInfo       => 1,
561                    categoryBag    => 1,
562                    findQualifiers => 1,
563                    identifierBag  => 1,
564                    name           => 1
565                },
566                get_assertionStatusReport =>
567                  { authInfo => 1, completionStatus => 1 },
568                get_bindingDetail   => { authInfo => 1, bindingKey  => 1 },
569                get_businessDetail  => { authInfo => 1, businessKey => 1 },
570                get_operationalInfo => { authInfo => 1, entityKey   => 1 },
571                get_publisherAssertions => { authInfo => 1 },
572                get_registeredInfo      => { authInfo => 1 },
573                get_serviceDetail       => { authInfo => 1, serviceKey => 1 },
574                get_tModelDetail        => { authInfo => 1, tModelKey => 1 },
575                identifierBag   => { keyedReference => 1 },
576                instanceDetails => {
577                    description   => 1,
578                    instanceParms => 1,
579                    instanceParms => 1,
580                    overviewDoc   => 1
581                },
582                keyedReferenceGroup => { keyedReference => 1 },
583                keysOwned => { fromKey => 1, toKey => 1, toKey => 1 },
584                listDescription =>
585                  { actualCount => 1, includeCount => 1, listHead => 1 },
586                operationalInfo => {
587                    authorizedName            => 1,
588                    created                   => 1,
589                    modified                  => 1,
590                    modifiedIncludingChildren => 1,
591                    nodeID                    => 1
592                },
593                operationalInfos => { operationalInfo => 1 },
594                overviewDoc      =>
595                  { description => 1, overviewURL => 1, overviewURL => 1 },
596                publisherAssertion => {
597                    Signature      => 1,
598                    fromKey        => 1,
599                    keyedReference => 1,
600                    toKey          => 1
601                },
602                publisherAssertions => { publisherAssertion => 1 },
603                registeredInfo => { businessInfos => 1, tModelInfos => 1 },
604                relatedBusinessInfo => {
605                    businessKey         => 1,
606                    description         => 1,
607                    name                => 1,
608                    sharedRelationships => 1
609                },
610                relatedBusinessInfos  => { relatedBusinessInfo => 1 },
611                relatedBusinessesList => {
612                    businessKey          => 1,
613                    listDescription      => 1,
614                    relatedBusinessInfos => 1
615                },
616                result        => { errInfo  => 1 },
617                save_binding  => { authInfo => 1, bindingTemplate => 1 },
618                save_business => { authInfo => 1, businessEntity => 1 },
619                save_service  => { authInfo => 1, businessService => 1 },
620                save_tModel   => { authInfo => 1, tModel => 1 },
621                serviceDetail => { businessService => 1 },
622                serviceInfo   => { name            => 1 },
623                serviceInfos  => { serviceInfo     => 1 },
624                serviceList   => { listDescription => 1, serviceInfos => 1 },
625                set_publisherAssertions =>
626                  { authInfo => 1, publisherAssertion => 1 },
627                sharedRelationships =>
628                  { keyedReference => 1, publisherAssertion => 1 },
629                tModel => {
630                    categoryBag   => 1,
631                    description   => 1,
632                    Signature     => 1,
633                    identifierBag => 1,
634                    name          => 1,
635                    overviewDoc   => 1
636                },
637                tModelBag    => { tModelKey   => 1 },
638                tModelDetail => { tModel      => 1 },
639                tModelInfo   => { description => 1, name => 1 },
640                tModelInfos  => { tModelInfo  => 1 },
641                tModelInstanceDetails => { tModelInstanceInfo => 1 },
642                tModelInstanceInfo    =>
643                  { description => 1, instanceDetails => 1 },
644                tModelList => { listDescription => 1, tModelInfos => 1 }
645            },
646            ATTRIBUTES => {
647                accessPoint => { useType => 2 },
648                address     =>
649                  { sortCode => 2, tModelKey => 2, useType => 2, lang => 2 },
650                addressLine => { keyName => 2, keyValue => 2 },
651                assertionStatusItem => { completionStatus => 2 },
652                bindingDetail       => { truncated        => 2 },
653                bindingTemplate => { bindingKey  => 2, serviceKey => 2 },
654                businessDetail  => { truncated   => 2 },
655                businessEntity  => { businessKey => 2 },
656                businessInfo    => { businessKey => 2 },
657                businessList    => { truncated   => 2 },
658                businessService   => { businessKey => 2, serviceKey => 2 },
659                contact           => { useType     => 2 },
660                description       => { lang        => 2 },
661                discoveryURL      => { useType     => 2 },
662                dispositionReport => { truncated   => 2 },
663                email             => { useType     => 2 },
664                errInfo           => { errCode     => 2 },
665                find_binding      =>
666                  { listHead => 2, maxRows => 2, serviceKey => 2 },
667                find_business          => { listHead => 2, maxRows => 2 },
668                find_relatedBusinesses => { listHead => 2, maxRows => 2 },
669                find_service           =>
670                  { businessKey => 2, listHead => 2, maxRows => 2 },
671                find_tModel        => { listHead      => 2, maxRows => 2 },
672                get_authToken      => { cred          => 2, userID  => 2 },
673                get_registeredInfo => { infoSelection => 2 },
674                hostingRedirector  => { bindingKey    => 2 },
675                keyedReference     =>
676                  { keyName => 2, keyValue => 2, tModelKey => 2 },
677                keyedReferenceGroup   => { tModelKey => 2 },
678                name                  => { lang      => 2 },
679                operationalInfo       => { entityKey => 2 },
680                operationalInfos      => { truncated => 2 },
681                overviewURL           => { useType   => 2 },
682                personName            => { lang      => 2 },
683                phone                 => { useType   => 2 },
684                registeredInfo        => { truncated => 2 },
685                relatedBusinessesList => { truncated => 2 },
686                result                => { errno     => 2, keyType => 2 },
687                serviceDetail         => { truncated => 2 },
688                serviceInfo         => { businessKey => 2, serviceKey => 2 },
689                serviceList         => { truncated   => 2 },
690                sharedRelationships => { direction   => 2 },
691                tModel             => { deleted   => 2, tModelKey => 2 },
692                tModelDetail       => { truncated => 2 },
693                tModelInfo         => { tModelKey => 2 },
694                tModelInstanceInfo => { tModelKey => 2 },
695                tModelList         => { truncated => 2 }
696            },
697            WITHNAMES => [
698                qw/accessPoint actualCount address addressLine assertionStatusItem assertionStatusReport authToken authorizedName bindingDetail bindingKey bindingTemplate bindingTemplates businessDetail businessEntity businessInfo businessInfos businessKey businessList businessService businessServices categoryBag completionStatus contact contacts created description discoveryURL discoveryURLs dispositionReport email entityKey errInfo findQualifier findQualifiers fromKey hostingRedirector identifierBag includeCount infoSelection instanceDetails instanceParms keyedReference keyedReferenceGroup keysOwned listDescription listHead modified modifiedIncludingChildren name nodeID operationalInfo operationalInfos overviewDoc overviewURL personName phone publisherAssertion publisherAssertions registeredInfo relatedBusinessInfo relatedBusinessInfos relatedBusinessesList result serviceDetail serviceInfo serviceInfos serviceKey serviceList sharedRelationships tModel tModelBag tModelDetail tModelInfo tModelInfos tModelInstanceDetails tModelInstanceInfo tModelKey tModelList toKey/
699            ],
700            NAMESPACE => 'urn:uddi-org:api_v3',
701            GENERIC   => undef,
702        },
703    );
704}
705
706# ======================================================================
707
708package UDDI::SOM;
709our $VERSION = 0.715;
710use vars qw(@ISA);
711@ISA = qw(SOAP::SOM);
712
713sub result
714{    # result should point to immediate child of Body
715    my $self   = shift;
716    my $result = '/Envelope/Body/[1]';
717    ref $self or return $result;
718    defined $self->fault ? undef: $self->valueof($result);
719}
720
721# ======================================================================
722
723package UDDI::Data;
724our $VERSION = 0.715;
725
726
727use Carp ();
728
729use vars qw(@ISA $AUTOLOAD);
730@ISA = qw(SOAP::Data);
731
732use overload fallback => 1, '""' => sub { shift->SUPER::value };
733
734sub _init
735{
736    use vars qw(@EXPORT_OK %EXPORT_TAGS);
737    @EXPORT_OK   = ( with => @$UDDI::Constants::WITHNAMES );
738    %EXPORT_TAGS = ( all  => [@EXPORT_OK] );
739
740    use vars qw($elements $attributes);
741    $elements   = $UDDI::Constants::ELEMENTS;
742    $attributes = $UDDI::Constants::ATTRIBUTES;
743}
744
745sub new
746{
747    my $self  = shift;
748    my $class = ref($self) || $self;
749
750    unless ( ref $self )
751    {
752        $self = $class->SUPER::new( @_, type => 'uddi' );
753    }
754    return $self;
755}
756
757sub with
758{
759    my $self = shift;
760    $self =
761      (      __PACKAGE__->can($self)
762          || Carp::croak "Don't know what to do with '$self'" )->()
763      unless ref $self && UNIVERSAL::isa( $self => __PACKAGE__ );
764
765    my $name = $self->SUPER::name;
766    my @values;
767    while (@_)
768    {
769        my $data = shift;
770        my ( $method, $attr, @value ) =
771          UNIVERSAL::isa( $data => __PACKAGE__ )
772          ? ( $data->SUPER::name, $data->SUPER::attr, $data->SUPER::value )
773          : ( $data, {}, shift );
774        exists $attributes->{$name}{$method}
775
776          # attribute
777          ? $self->$method(@value)
778
779          # sub element
780          : push(
781            @values,
782            (
783                $self->can($method)
784                  || Carp::croak "Don't know what to do with '$method'"
785              )->(@value)->attr($attr)
786          );
787    }
788    $self->set_value( [@values] );
789}
790
791sub _compileit
792{
793    no strict 'refs';
794    my $method = shift;
795    *$method = sub {
796
797        # GENERATE element if no parameters: businessInfo()
798        return __PACKAGE__->SUPER::name($method)
799          if !@_ && exists $elements->{$method};
800
801        die "Expected element (UDDI::Data) as parameter for $method()\n"
802          if !ref $_[0] && exists $elements->{$method};
803
804        # MAKE ELEMENT: name( [{attr => value},] 'old')
805        if ( !UNIVERSAL::isa( $_[0] => __PACKAGE__ ) )
806        {
807
808            # get optional list of attributes as a first parameter
809            my $attr = ref $_[0] eq 'HASH' ? shift @_ : {};
810            return __PACKAGE__->SUPER::name( $method => @_ )->attr($attr);
811        }
812
813        my $name = $_[0]->SUPER::name;
814
815        if ( defined $name )
816        {
817
818            # GET/SET ATTRIBUTE: businessInfo->businessKey
819            return @_ > 1
820              ? scalar( $_[0]->attr->{$method} = $_[1], $_[0] )    # SET
821              : __PACKAGE__->SUPER::name(
822                $method => $_[0]->attr->{$method} )                # GET
823              if exists $attributes->{$name}
824              && exists $attributes->{$name}{$method};
825
826            # GET ELEMENT: businessInfos->businessInfo
827            my @elems = grep {
828                     ref $_
829                  && UNIVERSAL::isa( $_ => __PACKAGE__ )
830                  && $_->SUPER::name eq $method
831            } map { ref $_ eq 'ARRAY' ? @$_ : $_ } $_[0]->value;
832            return wantarray ? @elems : $elems[0]
833              if exists $elements->{$name}
834              && exists $elements->{$name}{$method};
835
836            # MAKE ELEMENT: businessInfos(businessInfo('something'))
837            return __PACKAGE__->SUPER::name( $method => @_ )
838              if exists $elements->{$method}
839              && exists $elements->{$method}{$name};
840        }
841
842        # handle UDDI::Data->method() calls for those SOAP::Data methods
843        #  that conflict with UDDI methods, like name()
844        if ( UNIVERSAL::can( $ISA[0] => $method ) )
845        {
846            my $pkg = shift @_;
847            return eval "\$pkg->SUPER::$method(\@_)";
848        }
849
850        Carp::croak
851          "Don't know what to do with '$method' and '$name' elements";
852      }
853}
854
855sub BEGIN { _compileit('name') }
856
857sub AUTOLOAD
858{
859    my $method = substr( $AUTOLOAD, rindex( $AUTOLOAD, '::' ) + 2 );
860    return if $method eq 'DESTROY';
861
862    _compileit($method);
863    goto &$AUTOLOAD;
864}
865
866# ======================================================================
867
868package UDDI::Serializer;
869our $VERSION = 0.715;
870
871use vars qw(@ISA);
872@ISA = qw(SOAP::Serializer);
873
874sub new
875{
876    my $self  = shift;
877    my $class = ref($self) || $self;
878
879    unless ( ref $self )
880    {
881        $self = $class->SUPER::new(
882            attr       => {},
883            namespaces => {
884                $SOAP::Constants::PREFIX_ENV
885                ? ( $SOAP::Constants::NS_ENV => $SOAP::Constants::PREFIX_ENV )
886                : (),
887            },
888            autotype => 0,
889            @_,
890        );
891    }
892    return $self;
893}
894
895use overload;    # protect from stringification in UDDI::Data
896sub gen_id { overload::StrVal( $_[1] ) =~ /\((0x\w+)\)/o; $1 }
897
898sub as_uddi
899{
900    my $self = shift;
901    my ( $value, $name, $type, $attr ) = @_;
902    return $self->encode_array( $value, $name, undef, $attr )
903      if ref $value eq 'ARRAY';
904    return $self->encode_hash( $value, $name, undef, $attr )
905      if ref $value eq 'HASH';
906    [
907        $name,
908        { %{ $attr || {} } },
909        ref $value
910        ? ( [ $self->encode_object($value) ], $self->gen_id($value) )
911        : $value
912    ];
913}
914
915sub encode_array
916{
917    my $self    = shift;
918    my $encoded = $self->SUPER::encode_array(@_);
919    delete $encoded->[1]
920      ->{ SOAP::Utils::qualify( $self->encprefix => 'arrayType' ) };
921    return $encoded;
922}
923
924# ======================================================================
925
926package UDDI::Deserializer;
927our $VERSION = 0.715;
928
929use vars qw(@ISA);
930@ISA = qw(SOAP::Deserializer);
931
932sub decode_value
933{
934    my $self = shift;
935    my $ref  = shift;
936    my ( $name, $attrs, $children, $value ) = @$ref;
937
938    # base class knows what to do with elements in SOAP namespace
939    return $self->SUPER::decode_value($ref)
940      if exists $attrs->{href}
941      || ( SOAP::Utils::splitlongname($name) )[0] eq $SOAP::Constants::NS_ENV;
942
943    UDDI::Data->SOAP::Data::name($name)->attr($attrs)
944      ->set_value( ref $children
945          && @$children
946        ? map( scalar( ( $self->decode_object($_) )[1] ), @$children )
947        : $value );
948}
949
950sub deserialize
951{
952    bless shift->SUPER::deserialize(@_) => 'UDDI::SOM';
953}
954
955# ======================================================================
956
957package UDDI::Lite;
958our $VERSION = 0.715;
959
960use vars qw(@ISA $AUTOLOAD %EXPORT_TAGS);
961use Exporter;
962use Carp ();
963use SOAP::Lite;
964@ISA = qw(SOAP::Lite Exporter);
965
966BEGIN
967{    # handle exports
968    %EXPORT_TAGS = (
969        'delete' => [
970            qw/delete_binding delete_business delete_service
971              delete_tModel delete_publisherAssertions/
972        ],
973
974        # ^-------------------- v2/3
975        'auth' => [qw/get_authToken discard_authToken get_registeredInfo/],
976        'save' => [
977            qw/save_binding save_business save_service save_tModel
978              add_publisherAssertions set_publisherAssertions/
979        ],
980
981        # ^----------------- v2/3 ^----------------- v2/3
982        'validate' => [qw/validate_categorization validate_values/],
983
984        # ^------------------- v1 ^------------v2
985        'find' => [
986            qw/find_binding find_business find_service find_tModel
987              find_relatedBusinesses/
988        ],
989
990        # ^---------------- v2/3
991        'get' => [
992            qw/get_bindingDetail get_businessDetail get_businessDetailExt
993              get_serviceDetail get_tModelDetail
994              get_assertionStatusReport get_publisherAssertions/
995        ],
996
997        # ^------------------- v2/3 ^----------------- v2/3
998    );
999    $EXPORT_TAGS{inquiry} = [ map { @{ $EXPORT_TAGS{$_} } } qw/find get/ ];
1000    $EXPORT_TAGS{publish} =
1001      [ map { @{ $EXPORT_TAGS{$_} } } qw/delete auth save validate/ ];
1002    $EXPORT_TAGS{all} = [ map { @{ $EXPORT_TAGS{$_} } } qw/inquiry publish/ ];
1003    Exporter::export_ok_tags('all');
1004}
1005
1006my $uddiversion;
1007
1008sub uddiversion
1009{
1010    my $self    = shift;
1011    my $version = shift or return $uddiversion;
1012
1013    die qq!Wrong UDDI version. Supported versions: @{[
1014        join ", ", keys %UDDI::Constants::UDDI_VERSIONS]}\n!
1015      unless defined $UDDI::Constants::UDDI_VERSIONS{$version};
1016
1017    foreach ( keys %{ $UDDI::Constants::UDDI_VERSIONS{$version} } )
1018    {
1019        eval
1020"\$UDDI::Constants::$_ = \$UDDI::Constants::UDDI_VERSIONS{$version}->{$_}"
1021          or die;
1022    }
1023
1024    UDDI::Data->_init;
1025
1026    $uddiversion = $version;
1027    $self;
1028}
1029
1030BEGIN { UDDI::Lite->uddiversion(1) }
1031
1032sub new
1033{
1034    my $self  = shift;
1035    my $class = ref($self) || $self;
1036
1037    unless ( ref $self )
1038    {
1039        $self = $class->SUPER::new(
1040            on_action  => sub { '""' },
1041            serializer => UDDI::Serializer->new, # register UDDI Serializer
1042            deserializer => UDDI::Deserializer->new,    # and Deserializer
1043            @_,
1044        );
1045    }
1046    return $self;
1047}
1048
1049sub AUTOLOAD
1050{
1051    my $method = substr( $AUTOLOAD, rindex( $AUTOLOAD, '::' ) + 2 );
1052    return if $method eq 'DESTROY';
1053
1054    no strict 'refs';
1055    *$AUTOLOAD = sub {
1056        return shift->call( $method => @_ )
1057          if UNIVERSAL::isa( $_[0] => __PACKAGE__ );
1058        my $som =
1059          (      __PACKAGE__->self
1060              || Carp::croak "Method call on unspecified object. Died" )
1061          ->call( $method => @_ );
1062        UNIVERSAL::isa( $som => 'SOAP::SOM' ) ? $som->result : $som;
1063    };
1064    goto &$AUTOLOAD;
1065}
1066
1067sub call
1068{
1069    SOAP::Trace::trace('()');
1070    my $self   = shift;
1071    my $method = shift;
1072    my @parameters;
1073    my $attr = ref $_[0] eq 'HASH' ? shift() : {};
1074    while (@_)
1075    {
1076        push( @parameters,
1077            UNIVERSAL::isa( $_[0] => 'UDDI::Data' )
1078            ? shift
1079            : SOAP::Data->name( shift, shift ) );
1080    }
1081    my $message =
1082      SOAP::Data->name( $method => \SOAP::Data->value(@parameters) )->attr(
1083        {
1084            xmlns => $UDDI::Constants::NAMESPACE,
1085            (
1086                defined $UDDI::Constants::GENERIC
1087                ? ( generic => $UDDI::Constants::GENERIC )
1088                : ()
1089            ),
1090            %$attr
1091        }
1092      );
1093
1094    my $serializer = $self->serializer;
1095    $serializer->on_nonserialized( $self->on_nonserialized );
1096
1097    my $respond = $self->transport->send_receive(
1098        endpoint => $self->endpoint,
1099        action   => $self->on_action->( $self->uri ),
1100        envelope => $serializer->envelope( freeform => $message ),
1101        encoding => $serializer->encoding,
1102    );
1103
1104    return $respond if $self->outputxml;
1105
1106    unless ( $self->transport->is_success )
1107    {
1108        my $result = eval { $self->deserializer->deserialize($respond) }
1109          if $respond;
1110        return $self->on_fault->( $self, $@ ? $respond : $result ) || $result;
1111    }
1112
1113    return unless $respond;    # nothing to do for one-ways
1114    return $self->deserializer->deserialize($respond);
1115}
1116
1117# ======================================================================
1118
11191;
1120
1121__END__
1122
1123=head1 NAME
1124
1125UDDI::Lite - Library for UDDI clients in Perl
1126
1127=head1 SYNOPSIS
1128
1129  use UDDI::Lite;
1130  print UDDI::Lite
1131    -> proxy('http://uddi.microsoft.com/inquire')
1132    -> find_business(name => 'old')
1133    -> result
1134    -> businessInfos->businessInfo->serviceInfos->serviceInfo->name;
1135
1136The same code with autodispatch:
1137
1138  use UDDI::Lite +autodispatch =>
1139    proxy => 'http://uddi.microsoft.com/inquire'
1140  ;
1141
1142  print find_business(name => 'old')
1143    -> businessInfos->businessInfo->serviceInfos->serviceInfo->name;
1144
1145Or with importing:
1146
1147  use UDDI::Lite
1148    'UDDI::Lite' => [':inquiry'],
1149    proxy => 'http://uddi.microsoft.com/inquire'
1150  ;
1151
1152  print find_business(name => 'old')
1153    -> businessInfos->businessInfo->serviceInfos->serviceInfo->name;
1154
1155Publishing API:
1156
1157  use UDDI::Lite
1158    import => ['UDDI::Data'],
1159    import => ['UDDI::Lite'],
1160    proxy => "https://some.server.com/endpoint_fot_publishing_API";
1161
1162  my $auth = get_authToken({userID => 'USERID', cred => 'CRED'})->authInfo;
1163  my $busent = with businessEntity =>
1164    name("Contoso Manufacturing"),
1165    description("We make components for business"),
1166    businessKey(''),
1167    businessServices with businessService =>
1168      name("Buy components"),
1169      description("Bindings for buying our components"),
1170      serviceKey(''),
1171      bindingTemplates with bindingTemplate =>
1172        description("BASDA invoices over HTTP post"),
1173        accessPoint('http://www.contoso.com/buy.asp'),
1174        bindingKey(''),
1175        tModelInstanceDetails with tModelInstanceInfo =>
1176          description('some tModel'),
1177          tModelKey('UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4')
1178  ;
1179  print save_business($auth, $busent)->businessEntity->businessKey;
1180
1181=head1 DESCRIPTION
1182
1183UDDI::Lite for Perl is a collection of Perl modules which provides a
1184simple and lightweight interface to the Universal Description, Discovery
1185and Integration (UDDI) server.
1186
1187To learn more about UDDI, visit http://www.uddi.org/.
1188
1189The main features of the library are:
1190
1191=over 3
1192
1193=item *
1194
1195Supports both inquiry and publishing API
1196
1197=item *
1198
1199Builded on top of SOAP::Lite module, hence inherited syntax and features
1200
1201=item *
1202
1203Supports easy-to-use interface with convenient access to (sub)elements
1204and attributes
1205
1206=item *
1207
1208Supports HTTPS protocol
1209
1210=item *
1211
1212Supports SMTP protocol
1213
1214=item *
1215
1216Supports Basic/Digest server authentication
1217
1218=back
1219
1220=head1 OVERVIEW OF CLASSES AND PACKAGES
1221
1222This table should give you a quick overview of the classes provided by the
1223library.
1224
1225 UDDI::Lite.pm
1226 -- UDDI::Lite         -- Main class provides all logic
1227 -- UDDI::Data         -- Provides extensions for serialization architecture
1228 -- UDDI::Serializer   -- Serializes data structures to UDDI/SOAP package
1229 -- UDDI::Deserializer -- Deserializes result into objects
1230 -- UDDI::SOM          -- Provides access to deserialized object tree
1231
1232=head2 UDDI::Lite
1233
1234All methods that UDDI::Lite gives you access to can be used for both
1235setting and retrieving values. If you provide no parameters, you'll
1236get current value, and if you'll provide parameter(s), new value
1237will be assigned and method will return object (if not stated something
1238else). This is suitable for stacking these calls like:
1239
1240  $uddi = UDDI::Lite
1241    -> on_debug(sub{print@_})
1242    -> proxy('http://uddi.microsoft.com/inquire')
1243  ;
1244
1245Order is insignificant and you may call new() method first. If you
1246don't do it, UDDI::Lite will do it for you. However, new() method
1247gives you additional syntax:
1248
1249  $uddi = new UDDI::Lite
1250    on_debug => sub {print@_},
1251    proxy => 'http://uddi.microsoft.com/inquire'
1252  ;
1253
1254new() accepts hash with method names and values, and will call
1255appropriate method with passed value.
1256
1257Since new() is optional it won't be mentioned anymore.
1258
1259Other available methods inherited from SOAP::Lite and most usable are:
1260
1261=over 4
1262
1263=item proxy()
1264
1265Shortcut for C<transport-E<gt>proxy()>. This lets you specify an endpoint and
1266also loads the required module at the same time. It is required for dispatching SOAP
1267calls. The name of the module will be defined depending on the protocol
1268specific for the endpoint. SOAP::Lite will do the rest work.
1269
1270=item on_fault()
1271
1272Lets you specify handler for on_fault event. Default behavior is die
1273on transport error and does nothing on others. You can change this
1274behavior globally or locally, for particular object.
1275
1276=item on_debug()
1277
1278Lets you specify handler for on_debug event. Default behavior is do
1279nothing. Use +trace/+debug option for UDDI::Lite instead.
1280
1281=back
1282
1283To change to UDDI Version 2, use the following pragma:
1284
1285  use UDDI::Lite uddiversion => 2;
1286
1287=head2 UDDI::Data
1288
1289You can use this class if you want to specify value and name for UDDI
1290elements.
1291For example, C<UDDI::Data-E<gt>name('businessInfo')-E<gt>value(123)> will
1292be serialized to C<E<lt>businessInfoE<gt>123E<lt>/businessInfoE<gt>>, as
1293well as C<UDDI::Data->name(businessInfo =E<gt> 123)>.
1294
1295If you want to provide names for your parameters you can either specify
1296
1297  find_business(name => 'old')
1298
1299or do it with UDDI::Data:
1300
1301  find_business(UDDI::Data->name(name => 'old'))
1302
1303Later has some advantages: it'll work on any level, so you can do:
1304
1305  find_business(UDDI::Data->name(name => UDDI::Data->name(subname => 'old')))
1306
1307and also you can create arrays with this syntax:
1308
1309  find_business(UDDI::Data->name(name =>
1310    [UDDI::Data->name(subname1 => 'name1'),
1311     UDDI::Data->name(subname2 => 'name2')]))
1312
1313will be serialized into:
1314
1315  <find_business xmlns="urn:uddi-org:api" generic="1.0">
1316    <name>
1317      <subname1>name1</subname1>
1318      <subname2>name2</subname2>
1319    </name>
1320  </find_business>
1321
1322For standard elements more convenient syntax is available:
1323
1324  find_business(
1325    findQualifiers(findQualifier('sortByNameAsc',
1326                                 'caseSensitiveMatch')),
1327    name('M')
1328  )
1329
1330and
1331
1332  find_business(
1333    findQualifiers([findQualifier('sortByNameAsc'),
1334                    findQualifier('caseSensitiveMatch')]),
1335    name('M')
1336  )
1337
1338both will generate:
1339
1340  <SOAP-ENV:Envelope
1341    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
1342    <SOAP-ENV:Body>
1343      <find_business xmlns="urn:uddi-org:api" generic="1.0">
1344        <findQualifiers>
1345          <findQualifier>sortByNameAsc</findQualifier>
1346          <findQualifier>caseSensitiveMatch</findQualifier>
1347        </findQualifiers>
1348        <name>M</name>
1349      </find_business>
1350    </SOAP-ENV:Body>
1351  </SOAP-ENV:Envelope>
1352
1353You can use ANY valid combinations (according to "UDDI Programmer's
1354API Specification"). If you try to generate something unusual, like
1355C<name(name('myname'))>, you'll get:
1356
1357  Don't know what to do with 'name' and 'name' elements ....
1358
1359If you REALLY need to do it, use C<UDDI::Data> syntax described above.
1360
1361As special case you can pass hash as the first parameter of method
1362call and values of this hash will be added as attributes to top element:
1363
1364  find_business({maxRows => 10}, UDDI::Data->name(name => old))
1365
1366gives you
1367
1368  <find_business xmlns="urn:uddi-org:api" generic="1.0" maxRows="10">
1369    ....
1370  </find_business>
1371
1372You can also pass back parameters exactly as you get it from method call
1373(like you probably want to do with authInfo).
1374
1375You can get access to attributes and elements through the same interface:
1376
1377  my $list = find_business(name => old);
1378  my $bis = $list->businessInfos;
1379  for ($bis->businessInfo) {
1380    my $s = $_->serviceInfos->serviceInfo;
1381    print $s->name,        # element
1382          $s->businessKey, # attribute
1383          "\n";
1384  }
1385
1386To match advantages provided by C<with> operator available in other
1387languages (like VB) we provide similar functionality that adds you
1388flexibility:
1389
1390    with findQualifiers =>
1391      findQualifier => 'sortByNameAsc',
1392      findQualifier => 'caseSensitiveMatch'
1393
1394is the same as:
1395
1396    with(findQualifiers =>
1397      findQualifier('sortByNameAsc'),
1398      findQualifier('caseSensitiveMatch'),
1399    )
1400
1401and:
1402
1403    findQualifiers->with(
1404      findQualifier('sortByNameAsc'),
1405      findQualifier('caseSensitiveMatch'),
1406    )
1407
1408will all generate the same code as mentioned above:
1409
1410    findQualifiers(findQualifier('sortByNameAsc',
1411                                 'caseSensitiveMatch')),
1412
1413Advantage of C<with> syntax is the you can specify both attributes and
1414elements through the same interface. First argument is element where all
1415other elements and attributes will be attached. Provided examples and
1416tests cover different syntaxes.
1417
1418=head2 AUTODISPATCHING
1419
1420UDDI::Lite provides autodispatching feature that lets you create
1421code that looks similar for local and remote access.
1422
1423For example:
1424
1425  use UDDI::Lite +autodispatch =>
1426    proxy => 'http://uddi.microsoft.com/inquire';
1427
1428tells autodispatch all UDDI calls to
1429'http://uddi.microsoft.com/inquire'. All subsequent calls can look
1430like:
1431
1432  find_business(name => 'old');
1433  find_business(UDDI::Data->name(name => 'old'));
1434  find_business(name('old'));
1435
1436=head1 BUGS AND LIMITATIONS
1437
1438=over 4
1439
1440=item *
1441
1442Interface is still subject to change.
1443
1444=item *
1445
1446Though HTTPS/SSL is supported you should specify it yourself (with
1447C<proxy> or C<endpoint>) for publishing API calls.
1448
1449=back
1450
1451=head1 AVAILABILITY
1452
1453For now UDDI::Lite is distributed as part of SOAP::Lite package.
1454You can download it from ( http://soaplite.com/ )
1455or from CPAN ( http://search.cpan.org/search?dist=SOAP-Lite ).
1456
1457=head1 SEE ALSO
1458
1459L<SOAP::Lite> ( http://search.cpan.org/search?dist=SOAP-Lite )
1460L<UDDI> ( http://search.cpan.org/search?dist=UDDI )
1461
1462=head1 COPYRIGHT
1463
1464Copyright (C) 2000-2004 Paul Kulchenko. All rights reserved.
1465
1466This library is free software; you can redistribute it and/or modify
1467it under the same terms as Perl itself.
1468
1469=head1 AUTHOR
1470
1471Paul Kulchenko (paulclinger@yahoo.com)
1472
1473=cut
1474