From: Byrne R. <by...@ma...> - 2004-04-16 15:22:00
|
It sometimes takes a while for the changes to trickle through the=20 system. Be patient - the changes will show up soon. =3D-D Paul Kulchenko wrote: >Mark, > >I'm not sure what's going on. I definitely committed my changes (my >working copy is in sync with the repository), but I don't see them >through viewCVS. I tried export and it returns the correct version.=20 > >Does anybody have an idea? > >Anyway, I attached the modified UDDI::Lite.pm. I hope the issue will >dissapear tomorrow ;). > >Best wishes, Paul.=20 > >--- Mark Fuller <mar...@ea...> wrote: > =20 > >>>I've just commited the update that fixes a known bug with not >>>handling attributes. See if it works for you. >>> =20 >>> >>Can you give me a URL? I probably don't know what I'm doing, but I >>tried >> >> >> =20 >> >http://cvs.sourceforge.net/viewcvs.py/soaplite/soaplite-dist/lib/UDDI/Li= te.pm > =20 > >>Nothing looked recently updated. I poked around different places >>near there. >>Didn't see anything. >> >>When I get this update I'll do a lot of testing and give you >>feedback about >>bugs I find, and/or enhancement ideas. Maybe this is the >>opportunity for me >>to learn Perl debugger and learn how this module works. I've >>written a few >>modules, but nothing that does so much in so few instructions. :) >> >>Mark >> >> =20 >> >>-----------------------------------------------------------------------= - >> >># =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >># >># Copyright (C) 2000-2001 Paul Kulchenko (pau...@ya...) >># SOAP::Lite is free software; you can redistribute it >># and/or modify it under the same terms as Perl itself. >># >># $Id: Lite.pm,v 1.2 2004/04/16 00:46:51 paulclinger Exp $ >># >># =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >>package UDDI::Lite; >> >>use 5.004; >>use strict; >>use vars qw($VERSION); >>$VERSION =3D sprintf("%d.%s", map {s/_//g; $_} q$Name: $ =3D~ /-(\d+)_= ([\d_]+)/); >> >>use SOAP::Lite; >> >># =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >>package UDDI::SOM; >> >>use vars qw(@ISA); >>@ISA =3D qw(SOAP::SOM); >> >>sub result { # result should point to immediate child of Body >> my $self =3D shift; >> my $result =3D '/Envelope/Body/[1]';=20 >> ref $self or return $result; >> defined $self->fault ? undef : $self->valueof($result); >>}; >> >># =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >>package UDDI::Data; >> >>use Carp (); >> >>use vars qw(@ISA $AUTOLOAD @EXPORT_OK %EXPORT_TAGS); >>@ISA =3D qw(SOAP::Data); >> >>my @elements =3D (with =3D> qw/accessPoint address addressLine authInfo= authToken bindingDetail bindingKey bindingTemplate bindingTemplates busi= nessDetail businessDetailExt businessEntity businessEntityExt businessInf= o businessInfos businessKey businessList businessService businessServices= categoryBag contact contacts description discoveryURL discoveryURLs disp= ositionReport email errInfo findQualifier findQualifiers hostingRedirecto= r identifierBag instanceDetails instanceParms keyValue keyedReference nam= e overviewDoc overviewURL personName phone registeredInfo result serviceD= etail serviceInfo serviceInfos serviceKey serviceList tModel tModelBag tM= odelDetail tModelInfo tModelInfos tModelInstanceDetails tModelInstanceInf= o tModelKey tModelList uploadRegister/); >>@EXPORT_OK =3D (@elements); >>%EXPORT_TAGS =3D ('all' =3D> [@EXPORT_OK]); >> >>use overload fallback =3D> 1, '""' =3D> sub { shift->SUPER::value }; >> >>use vars qw(%elements %attributes); >>%elements =3D (get_serviceDetail=3D>{serviceKey=3D>1},find_tModel=3D>{c= ategoryBag=3D>1,name=3D>1,identifierBag=3D>1,findQualifiers=3D>1},tModelI= nstanceInfo=3D>{instanceDetails=3D>1,description=3D>1},address=3D>{addres= sLine=3D>1},categoryBag=3D>{keyedReference=3D>1},save_binding=3D>{authInf= o=3D>1,bindingTemplate=3D>1},businessEntity=3D>{categoryBag=3D>1,business= Services=3D>1,name=3D>1,description=3D>1,identifierBag=3D>1,discoveryURLs= =3D>1,contacts=3D>1},businessInfos=3D>{businessInfo=3D>1},find_business=3D= >{categoryBag=3D>1,name=3D>1,identifierBag=3D>1,discoveryURLs=3D>1,findQu= alifiers=3D>1,tModelBag=3D>1},get_bindingDetail=3D>{bindingKey=3D>1},iden= tifierBag=3D>{keyedReference=3D>1},get_businessDetailExt=3D>{businessKey=3D= >1},businessServices=3D>{businessService=3D>1},tModelInfo=3D>{name=3D>1},= find_service=3D>{categoryBag=3D>1,name=3D>1,findQualifiers=3D>1,tModelBag= =3D>1},dispositionReport=3D>{result=3D>1},authToken=3D>{authInfo=3D>1},ge= t_tModelDetail=3D>{tModelKey=3D>1},delete_tModel=3D>{tModelKey=3D>1,authI= nfo=3D>1},bindingTemplate=3D>{tModelInstanceDetails=3D>1,accessPoint=3D>1= ,description=3D>1,hostingRedirector=3D>1},tModelDetail=3D>{tModel=3D>1},b= usinessInfo=3D>{serviceInfos=3D>1,name=3D>1,description=3D>1},get_registe= redInfo=3D>{authInfo=3D>1},businessEntityExt=3D>{businessEntity=3D>1},reg= isteredInfo=3D>{businessInfos=3D>1,tModelInfos=3D>1},find_binding=3D>{fin= dQualifiers=3D>1,tModelBag=3D>1},serviceInfo=3D>{name=3D>1},get_businessD= etail=3D>{businessKey=3D>1},delete_business=3D>{businessKey=3D>1,authInfo= =3D>1},discoveryURLs=3D>{discoveryURL=3D>1},businessDetail=3D>{businessEn= tity=3D>1},contacts=3D>{contact=3D>1},tModelInstanceDetails=3D>{tModelIns= tanceInfo=3D>1},tModelList=3D>{tModelInfos=3D>1},delete_service=3D>{servi= ceKey=3D>1,authInfo=3D>1},tModelInfos=3D>{tModelInfo=3D>1},serviceDetail=3D= >{businessService=3D>1},tModel=3D>{categoryBag=3D>1,name=3D>1,description= =3D>1,identifierBag=3D>1,overviewDoc=3D>1},businessList=3D>{businessInfos= =3D>1},bindingTemplates=3D>{bindingTemplate=3D>1},validate_categorization= =3D>{businessEntity=3D>1,tModel=3D>1,businessService=3D>1,keyValue=3D>1,t= ModelKey=3D>1},contact=3D>{email=3D>1,personName=3D>1,phone=3D>1,descript= ion=3D>1,address=3D>1},discard_authToken=3D>{authInfo=3D>1},overviewDoc=3D= >{overviewURL=3D>1,description=3D>1},delete_binding=3D>{bindingKey=3D>1,a= uthInfo=3D>1},serviceList=3D>{serviceInfos=3D>1},bindingDetail=3D>{bindin= gTemplate=3D>1},tModelBag=3D>{tModelKey=3D>1},businessDetailExt=3D>{busin= essEntityExt=3D>1},serviceInfos=3D>{serviceInfo=3D>1},save_tModel=3D>{upl= oadRegister=3D>1,tModel=3D>1,authInfo=3D>1},findQualifiers=3D>{findQualif= ier=3D>1},save_business=3D>{businessEntity=3D>1,uploadRegister=3D>1,authI= nfo=3D>1},instanceDetails=3D>{instanceParms=3D>1,description=3D>1,overvie= wDoc=3D>1},businessService=3D>{categoryBag=3D>1,name=3D>1,bindingTemplate= s=3D>1,description=3D>1},save_service=3D>{businessService=3D>1,authInfo=3D= >1},result=3D>{errInfo=3D>1}); >>%attributes =3D (get_serviceDetail=3D>{generic=3D>2},find_tModel=3D>{ma= xRows=3D>2,generic=3D>2},tModelInstanceInfo=3D>{tModelKey=3D>2},address=3D= >{sortCode=3D>2,useType=3D>2},email=3D>{useType=3D>2},save_binding=3D>{ge= neric=3D>2},businessEntity=3D>{authorizedName=3D>2,operator=3D>2,business= Key=3D>2},discoveryURL=3D>{useType=3D>2},find_business=3D>{maxRows=3D>2,g= eneric=3D>2},get_bindingDetail=3D>{generic=3D>2},get_businessDetailExt=3D= >{generic=3D>2},tModelInfo=3D>{tModelKey=3D>2},find_service=3D>{maxRows=3D= >2,businessKey=3D>2,generic=3D>2},dispositionReport=3D>{truncated=3D>2,op= erator=3D>2,generic=3D>2},authToken=3D>{operator=3D>2,generic=3D>2},get_t= ModelDetail=3D>{generic=3D>2},bindingTemplate=3D>{serviceKey=3D>2,binding= Key=3D>2},delete_tModel=3D>{generic=3D>2},tModelDetail=3D>{truncated=3D>2= ,operator=3D>2,generic=3D>2},businessInfo=3D>{businessKey=3D>2},get_regis= teredInfo=3D>{generic=3D>2},registeredInfo=3D>{truncated=3D>2,operator=3D= >2,generic=3D>2},phone=3D>{useType=3D>2},find_binding=3D>{maxRows=3D>2,se= rviceKey=3D>2,generic=3D>2},serviceInfo=3D>{serviceKey=3D>2,businessKey=3D= >2},get_businessDetail=3D>{generic=3D>2},delete_business=3D>{generic=3D>2= },businessDetail=3D>{truncated=3D>2,operator=3D>2,generic=3D>2},keyedRefe= rence=3D>{keyName=3D>2,keyValue=3D>2,tModelKey=3D>2},tModelList=3D>{trunc= ated=3D>2,operator=3D>2,generic=3D>2},delete_service=3D>{generic=3D>2},se= rviceDetail=3D>{truncated=3D>2,operator=3D>2,generic=3D>2},tModel=3D>{aut= horizedName=3D>2,operator=3D>2,tModelKey=3D>2},businessList=3D>{truncated= =3D>2,operator=3D>2,generic=3D>2},validate_categorization=3D>{generic=3D>= 2},contact=3D>{useType=3D>2},discard_authToken=3D>{generic=3D>2},delete_b= inding=3D>{generic=3D>2},serviceList=3D>{truncated=3D>2,operator=3D>2,gen= eric=3D>2},bindingDetail=3D>{truncated=3D>2,operator=3D>2,generic=3D>2},h= ostingRedirector=3D>{bindingKey=3D>2},businessDetailExt=3D>{truncated=3D>= 2,operator=3D>2,generic=3D>2},get_authToken=3D>{userID=3D>2,generic=3D>2,= cred=3D>2},save_tModel=3D>{generic=3D>2},errInfo=3D>{errCode=3D>2},save_b= usiness=3D>{generic=3D>2},accessPoint=3D>{URLType=3D>2},businessService=3D= >{serviceKey=3D>2,businessKey=3D>2},save_service=3D>{generic=3D>2},result= =3D>{keyType=3D>2,errno=3D>2}); >> >>sub new { >> my $self =3D shift; >> my $class =3D ref($self) || $self; >> >> unless (ref $self) { >> $self =3D $class->SUPER::new(@_, type =3D> 'uddi'); >> } >> return $self; >>} >> >>sub with { >> my $self =3D shift; >> $self =3D (__PACKAGE__->can($self) || Carp::croak "Don't know what to= do with '$self'")->() >> unless ref $self && UNIVERSAL::isa($self =3D> __PACKAGE__); >> >> my $name =3D $self->SUPER::name; >> my @values; >> while (@_) { >> my $data =3D shift; >> my($method, $attr, @value) =3D UNIVERSAL::isa($data =3D> __PACKAGE_= _) >> ? ($data->SUPER::name, $data->SUPER::attr, $data->SUPER::value) >> : ($data, {}, shift); >> exists $attributes{$name}{$method} >> # attribute >> ? $self->$method(@value) >> # sub element >> : push(@values, ($self->can($method) || Carp::croak "Don't know w= hat to do with '$method'")->(@value)->attr($attr)); >> } >> $self->set_value([@values]); >>} >> >>sub _compileit { >> no strict 'refs'; >> my $method =3D shift; >> *$method =3D sub {=20 >> >> # GENERATE element if no parameters: businessInfo() >> return __PACKAGE__->SUPER::name($method)=20 >> if !@_ && exists $elements{$method}; >> >> die "Expected element (UDDI::Data) as parameter for $method()\n" >> if !ref $_[0] && exists $elements{$method}; >> >> # MAKE ELEMENT: name( [{attr =3D> value},] 'old') >> if (!UNIVERSAL::isa($_[0] =3D> __PACKAGE__)) { >> # get optional list of attributes as a first parameter >> my $attr =3D ref $_[0] eq 'HASH' ? shift @_ : {}; >> return __PACKAGE__->SUPER::name($method =3D> @_)->attr($attr); >> } >> >> my $name =3D $_[0]->SUPER::name; >> >> if (defined $name) { >> # GET/SET ATTRIBUTE: businessInfo->businessKey >> return @_ > 1=20 >> ? scalar($_[0]->attr->{$method} =3D $_[1], $_[0]) = # SET >> : __PACKAGE__->SUPER::name($method =3D> $_[0]->attr->{$method= }) # GET >> if exists $attributes{$name} && exists $attributes{$name}{$meth= od}; >> >> # GET ELEMENT: businessInfos->businessInfo >> my @elems =3D grep { >> ref $_ && UNIVERSAL::isa($_ =3D> __PACKAGE__) && $_->SUPER::nam= e eq $method >> } map {ref $_ eq 'ARRAY' ? @$_ : $_} $_[0]->value; >> return wantarray? @elems : $elems[0] >> if exists $elements{$name} && exists $elements{$name}{$method};= >> >> # MAKE ELEMENT: businessInfos(businessInfo('something')) >> return __PACKAGE__->SUPER::name($method =3D> @_)=20 >> if exists $elements{$method} && exists $elements{$method}{$name= }; >> } >> >> # handle UDDI::Data->method() calls for those SOAP::Data methods=20 >> # that conflict with UDDI methods, like name() >> if (UNIVERSAL::can($ISA[0] =3D> $method)) { >> my $pkg =3D shift @_; >> return eval "\$pkg->SUPER::$method(\@_)"; >> } >> >> Carp::croak "Don't know what to do with '$method' and '$name' eleme= nts"; >> } >>} >> >>sub BEGIN { _compileit('name') } >> >>sub AUTOLOAD { >> my $method =3D substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2); >> return if $method eq 'DESTROY'; >> >> _compileit($method); >> goto &$AUTOLOAD; >>} >> >># =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >>package UDDI::Serializer; >> >>use vars qw(@ISA); >>@ISA =3D qw(SOAP::Serializer); >> >>sub new {=20 >> my $self =3D shift; >> my $class =3D ref($self) || $self; >> >> unless (ref $self) { >> $self =3D $class->SUPER::new( >> attr =3D> {}, >> namespaces =3D> { >> $SOAP::Constants::PREFIX_ENV ? ($SOAP::Constants::NS_ENV =3D> $= SOAP::Constants::PREFIX_ENV) : (), >> }, >> autotype =3D> 0, >> @_, >> ); >> } >> return $self; >>} >> >>use overload; # protect from stringification in UDDI::Data >>sub gen_id { overload::StrVal($_[1]) =3D~ /\((0x\w+)\)/o; $1 } >> >>sub as_uddi {=20 >> my $self =3D shift; >> my($value, $name, $type, $attr) =3D @_; >> return $self->encode_array($value, $name, undef, $attr) if ref $value= eq 'ARRAY'; >> return $self->encode_hash($value, $name, undef, $attr) if ref $value = eq 'HASH'; >> [$name, {%{$attr || {}}}, ref $value ? ([$self->encode_object($value)= ], $self->gen_id($value)) : $value]; >>} = =20 >> >>sub encode_array { >> my $self =3D shift; >> my $encoded =3D $self->SUPER::encode_array(@_); >> delete $encoded->[1]->{SOAP::Utils::qualify($self->encprefix =3D> 'ar= rayType')}; >> return $encoded; >>} >> >># =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >>package UDDI::Deserializer; >> >>use vars qw(@ISA); >>@ISA =3D qw(SOAP::Deserializer); >> >>sub decode_value { >> my $self =3D shift; >> my $ref =3D shift; >> my($name, $attrs, $children, $value) =3D @$ref; >> >> # base class knows what to do with elements in SOAP namespace >> return $self->SUPER::decode_value($ref)=20 >> if exists $attrs->{href} ||=20 >> (SOAP::Utils::splitlongname($name))[0] eq $SOAP::Constants::NS_E= NV; >> >> UDDI::Data >> -> SOAP::Data::name($name) >> -> attr($attrs) >> -> set_value(ref $children && @$children ? map(scalar(($self->decod= e_object($_))[1]), @$children) : $value); >>} >> >>sub deserialize { >> bless shift->SUPER::deserialize(@_) =3D> 'UDDI::SOM'; >>} >> >># =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >>package UDDI::Lite; >> >>use vars qw(@ISA $AUTOLOAD %EXPORT_TAGS); >>use Exporter; >>use Carp (); >>@ISA =3D qw(SOAP::Lite Exporter); >> >>BEGIN { # handle exports >> %EXPORT_TAGS =3D ( >> 'delete' =3D> [qw/delete_binding delete_business delete_service d= elete_tModel/], >> 'auth' =3D> [qw/get_authToken discard_authToken get_registeredI= nfo/], >> 'save' =3D> [qw/save_binding save_business save_service save_tM= odel/], >> 'validate' =3D> [qw/validate_categorization/], >> 'find' =3D> [qw/find_binding find_business find_service find_tM= odel/], >> 'get' =3D> [qw/get_bindingDetail get_businessDetail get_busine= ssDetailExt get_serviceDetail get_tModelDetail/], >> ); >> $EXPORT_TAGS{inquiry} =3D [map {@{$EXPORT_TAGS{$_}}} qw/find get/]; >> $EXPORT_TAGS{publish} =3D [map {@{$EXPORT_TAGS{$_}}} qw/delete auth s= ave validate/]; >> $EXPORT_TAGS{all} =3D [map {@{$EXPORT_TAGS{$_}}} qw/inquiry publi= sh/]; >> Exporter::export_ok_tags('all'); >>} >> >>sub new {=20 >> my $self =3D shift; >> my $class =3D ref($self) || $self; >> >> unless (ref $self) { >> $self =3D $class->SUPER::new( >> on_action =3D> sub {'""'}, >> serializer =3D> UDDI::Serializer->new, # register UDDI Serial= izer >> deserializer =3D> UDDI::Deserializer->new, # and Deserializer >> @_, >> ); >> } >> return $self; >>} >> >>sub AUTOLOAD { >> my $method =3D substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2); >> return if $method eq 'DESTROY'; >> >> no strict 'refs'; >> *$AUTOLOAD =3D sub {=20 >> return shift->call($method =3D> @_) if UNIVERSAL::isa($_[0] =3D> __= PACKAGE__); >> my $som =3D (__PACKAGE__->self || Carp::croak "Method call on unspe= cified object. Died")->call($method =3D> @_); >> UNIVERSAL::isa($som =3D> 'SOAP::SOM') ? $som->result : $som; >> }; >> goto &$AUTOLOAD; >>} >> >>sub call { SOAP::Trace::trace('()');=20 >> my $self =3D shift; >> my $method =3D shift; >> my @parameters; >> my $attr =3D ref $_[0] eq 'HASH' ? shift() : {}; >> while (@_) { >> push(@parameters, UNIVERSAL::isa($_[0] =3D> 'UDDI::Data')=20 >> ? shift : SOAP::Data->name(shift, shift)); >> } >> my $message =3D SOAP::Data >> -> name($method =3D> \SOAP::Data->value(@parameters)) >> -> attr({xmlns=3D>'urn:uddi-org:api', generic =3D> '1.0', %$attr});= >> >> my $serializer =3D $self->serializer; >> $serializer->on_nonserialized($self->on_nonserialized); >> >> my $respond =3D $self->transport->send_receive( >> endpoint =3D> $self->endpoint,=20 >> action =3D> $self->on_action->($self->uri), >> envelope =3D> $serializer->envelope(freeform =3D> $message),=20 >> encoding =3D> $serializer->encoding, >> ); >> >> return $respond if $self->outputxml; >> >> unless ($self->transport->is_success) { >> my $result =3D eval { $self->deserializer->deserialize($respond) } = if $respond; >> return $self->on_fault->($self, $@ ? $respond : $result) || $result= ; >> } >> >> return unless $respond; # nothing to do for one-ways >> return $self->deserializer->deserialize($respond); >>} >> >># =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >>1; >> >>__END__ >> >>=3Dhead1 NAME >> >>UDDI::Lite - Library for UDDI clients in Perl >> >>=3Dhead1 SYNOPSIS >> >> use UDDI::Lite; >> print UDDI::Lite >> -> proxy('http://uddi.microsoft.com/inquire') >> -> find_business(name =3D> 'old') >> -> result >> -> businessInfos->businessInfo->serviceInfos->serviceInfo->name; >> >>The same code with autodispatch:=20 >> >> use UDDI::Lite +autodispatch =3D>=20 >> proxy =3D> 'http://uddi.microsoft.com/inquire' >> ; >> >> print find_business(name =3D> 'old') >> -> businessInfos->businessInfo->serviceInfos->serviceInfo->name; = =20 >> >>Or with importing: >> >> use UDDI::Lite=20 >> 'UDDI::Lite' =3D> [':inquiry'], >> proxy =3D> 'http://uddi.microsoft.com/inquire' >> ; >> >> print find_business(name =3D> 'old') >> -> businessInfos->businessInfo->serviceInfos->serviceInfo->name; = =20 >> >>Publishing API: >> >> use UDDI::Lite=20 >> import =3D> ['UDDI::Data'],=20 >> import =3D> ['UDDI::Lite'], >> proxy =3D> "https://some.server.com/endpoint_fot_publishing_API"; >> >> my $auth =3D get_authToken({userID =3D> 'USERID', cred =3D> 'CRED'})-= >authInfo; >> my $busent =3D with businessEntity =3D> >> name("Contoso Manufacturing"),=20 >> description("We make components for business"), >> businessKey(''), >> businessServices with businessService =3D> >> name("Buy components"),=20 >> description("Bindings for buying our components"), >> serviceKey(''), >> bindingTemplates with bindingTemplate =3D> >> description("BASDA invoices over HTTP post"), >> accessPoint('http://www.contoso.com/buy.asp'), >> bindingKey(''), >> tModelInstanceDetails with tModelInstanceInfo =3D> >> description('some tModel'), >> tModelKey('UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4') >> ; >> print save_business($auth, $busent)->businessEntity->businessKey; >> >>=3Dhead1 DESCRIPTION >> >>UDDI::Lite for Perl is a collection of Perl modules which provides a=20 >>simple and lightweight interface to the Universal Description, Discover= y >>and Integration (UDDI) server. >> >>To learn more about UDDI, visit http://www.uddi.org/. >> >>The main features of the library are: >> >>=3Dover 3 >> >>=3Ditem * >> >>Supports both inquiry and publishing API=20 >> >>=3Ditem * >> >>Builded on top of SOAP::Lite module, hence inherited syntax and feature= s >> >>=3Ditem * >> >>Supports easy-to-use interface with convinient access to (sub)elements >>and attributes >> >>=3Ditem * >> >>Supports HTTPS protocol >> >>=3Ditem * >> >>Supports SMTP protocol >> >>=3Ditem * >> >>Supports Basic/Digest server authentication >> >>=3Dback >> >>=3Dhead1 OVERVIEW OF CLASSES AND PACKAGES >> >>This table should give you a quick overview of the classes provided by = the >>library. >> >> UDDI::Lite.pm >> -- UDDI::Lite -- Main class provides all logic >> -- UDDI::Data -- Provides extensions for serialization archite= cture >> -- UDDI::Serializer -- Serializes data structures to UDDI/SOAP packa= ge >> -- UDDI::Deserializer -- Deserializes result into objects >> -- UDDI::SOM -- Provides access to deserialized object tree >> >>=3Dhead2 UDDI::Lite >> >>All methods that UDDI::Lite gives you access to can be used for both >>setting and retrieving values. If you provide no parameters, you'll >>get current value, and if you'll provide parameter(s), new value >>will be assigned and method will return object (if not stated something= >>else). This is suitable for stacking these calls like: >> >> $uddi =3D UDDI::Lite >> -> on_debug(sub{print@_}) >> -> proxy('http://uddi.microsoft.com/inquire') >> ; >> >>Order is insignificant and you may call new() method first. If you >>don't do it, UDDI::Lite will do it for you. However, new() method >>gives you additional syntax: >> >> $uddi =3D new UDDI::Lite >> on_debug =3D> sub {print@_}, >> proxy =3D> 'http://uddi.microsoft.com/inquire' >> ; >> >>new() accepts hash with method names and values, and will call=20 >>appropriate method with passed value. >> >>Since new() is optional it won't be mentioned anymore. >> >>Other available methods inherited from SOAP::Lite and most usable are: >> >>=3Dover 4 >> >>=3Ditem proxy() >> >>Shortcut for C<transport-E<gt>proxy()>. This lets you specify an endpoi= nt and=20 >>also loads the required module at the same time. It is required for dis= patching SOAP=20 >>calls. The name of the module will be defined depending on the protocol= =20 >>specific for the endpoint. SOAP::Lite will do the rest work. >> >>=3Ditem on_fault() >> >>Lets you specify handler for on_fault event. Default behavior is die=20 >>on transport error and does nothing on others. You can change this=20 >>behavior globally or locally, for particular object. >> >>=3Ditem on_debug() >> >>Lets you specify handler for on_debug event. Default behavior is do=20 >>nothing. Use +trace/+debug option for UDDI::Lite instead. >> >>=3Dback >> >>=3Dhead2 UDDI::Data >> >>You can use this class if you want to specify value and name for UDDI=20 >>elements.=20 >>For example, C<UDDI::Data-E<gt>name('businessInfo')-E<gt>value(123)> wi= ll=20 >>be serialized to C<E<lt>businessInfoE<gt>123E<lt>/businessInfoE<gt>>, a= s=20 >>well as C<UDDI::Data->name(businessInfo =3DE<gt> 123)>. >> >>If you want to provide names for your parameters you can either specify= >> >> find_business(name =3D> 'old') >> >>or do it with UDDI::Data: >> >> find_business(UDDI::Data->name(name =3D> 'old')) >> >>Later has some advantages: it'll work on any level, so you can do: >> >> find_business(UDDI::Data->name(name =3D> UDDI::Data->name(subname =3D= > 'old'))) >> >>and also you can create arrays with this syntax: >> =20 >> find_business(UDDI::Data->name(name =3D>=20 >> [UDDI::Data->name(subname1 =3D> 'name1'),=20 >> UDDI::Data->name(subname2 =3D> 'name2')])) >> >>will be serialized into: >> >> <find_business xmlns=3D"urn:uddi-org:api" generic=3D"1.0"> >> <name> >> <subname1>name1</subname1> >> <subname2>name2</subname2> >> </name> >> </find_business> >> >>For standard elements more convinient syntax is available: >> >> find_business( >> findQualifiers(findQualifier('sortByNameAsc', >> 'caseSensitiveMatch')), >> name('M') >> ) >> >>and >>=20 >> find_business( >> findQualifiers([findQualifier('sortByNameAsc'),=20 >> findQualifier('caseSensitiveMatch')]),=20 >> name('M') >> ) >> >>both will generate: >> >> <SOAP-ENV:Envelope=20 >> xmlns:SOAP-ENV=3D"http://schemas.xmlsoap.org/soap/envelope/"> >> <SOAP-ENV:Body> >> <find_business xmlns=3D"urn:uddi-org:api" generic=3D"1.0"> >> <findQualifiers> >> <findQualifier>sortByNameAsc</findQualifier> >> <findQualifier>caseSensitiveMatch</findQualifier> >> </findQualifiers> >> <name>M</name> >> </find_business> >> </SOAP-ENV:Body> >> </SOAP-ENV:Envelope> >> >>You can use ANY valid combinations (according to "UDDI Programmer's=20 >>API Specification"). If you try to generate something unusual, like=20 >>C<name(name('myname'))>, you'll get: >> >> Don't know what to do with 'name' and 'name' elements .... >> >>If you REALLY need to do it, use C<UDDI::Data> syntax described above. >> >>As special case you can pass hash as the first parameter of method >>call and values of this hash will be added as attributes to top element= : >> >> find_business({maxRows =3D> 10}, UDDI::Data->name(name =3D> old)) >> >>gives you >> >> <find_business xmlns=3D"urn:uddi-org:api" generic=3D"1.0" maxRows=3D"= 10"> >> .... >> </find_business> >> >>You can also pass back parameters exactly as you get it from method cal= l >>(like you probably want to do with authInfo). >> >>You can get access to attributes and elements through the same interfac= e: >> >> my $list =3D find_business(name =3D> old); >> my $bis =3D $list->businessInfos; >> for ($bis->businessInfo) { >> my $s =3D $_->serviceInfos->serviceInfo; >> print $s->name, # element >> $s->businessKey, # attribute >> "\n"; >> } >> >>To match advantages provided by C<with> operator available in other=20 >>languages (like VB) we provide similar functionality that adds you=20 >>flexibility: >> >> with findQualifiers =3D>=20 >> findQualifier =3D> 'sortByNameAsc', >> findQualifier =3D> 'caseSensitiveMatch' >> >>is the same as:=20 >> >> with(findQualifiers =3D>=20 >> findQualifier('sortByNameAsc'), >> findQualifier('caseSensitiveMatch'), >> ) >> >>and: >> >> findQualifiers->with(=20 >> findQualifier('sortByNameAsc'), >> findQualifier('caseSensitiveMatch'), >> ) >> >>will all generate the same code as mentioned above: >> >> findQualifiers(findQualifier('sortByNameAsc', >> 'caseSensitiveMatch')), >> >>Advantage of C<with> syntax is the you can specify both attributes and = >>elements through the same interface. First argument is element where al= l=20 >>other elements and attributes will be attached. Provided examples and=20 >>tests cover different syntaxes. >> >>=3Dhead2 AUTODISPATCHING >> >>UDDI::Lite provides autodispatching feature that lets you create=20 >>code that looks similar for local and remote access. >> >>For example: >> >> use UDDI::Lite +autodispatch =3D>=20 >> proxy =3D> 'http://uddi.microsoft.com/inquire'; >> >>tells autodispatch all UDDI calls to=20 >>'http://uddi.microsoft.com/inquire'. All subsequent calls can look=20 >>like: >> >> find_business(name =3D> 'old'); >> find_business(UDDI::Data->name(name =3D> 'old')); >> find_business(name('old')); >> >>=3Dhead1 BUGS AND LIMITATIONS >> >>=3Dover 4 >> >>=3Ditem * >> >>Interface is still subject to change. >> >>=3Ditem * >> >>Though HTTPS/SSL is supported you should specify it yourself (with=20 >>C<proxy> or C<endpoint>) for publishing API calls. >> >>=3Dback >> >>=3Dhead1 AVAILABILITY >> >>For now UDDI::Lite is distributed as part of SOAP::Lite package. >>You can download it from ( http://soaplite.com/ )=20 >>or from CPAN ( http://search.cpan.org/search?dist=3DSOAP-Lite ). =20 >> >>=3Dhead1 SEE ALSO >> >>L<SOAP::Lite> ( http://search.cpan.org/search?dist=3DSOAP-Lite ) >>L<UDDI> ( http://search.cpan.org/search?dist=3DUDDI ) >> >>=3Dhead1 COPYRIGHT >> >>Copyright (C) 2000-2001 Paul Kulchenko. All rights reserved. >> >>This library is free software; you can redistribute it and/or modify >>it under the same terms as Perl itself. >> >>=3Dhead1 AUTHOR >> >>Paul Kulchenko (pau...@ya...) >> >>=3Dcut >> =20 >> |