2007년 5월 7일 월요일

Handling Lists, Structure, Objects ...

'Treat the result of SOAP call as variable of specified type' 으로 처리 함으로써 다양한 type의 결과물을 passing할 수 있다.

Client
#!perl -w
  use SOAP::Lite;
  my $result = SOAP::Lite
        -> uri('urn:xmethodsServicesManager')
        -> proxy('http://www.xmethods.net/soap/servlet/rpcrouter')
        -> getAllSOAPServices();
  if ($result->fault) {
    print $result->faultcode, " ", $result->faultstring, "\n";
  } else {
    # reference to array of structs is returned
    my @listings = @{$result->result};
    # @listings is the array of structs
    foreach my $listing (@listings) {
      print "-----------------------------------------\n";
      # print description for every listing
      foreach my $key (keys %{$listing}) {
        print $key, ": ", $listing->{$key} || '', "\n";
      }        
    }
  }


# 아 놔~~ 서버가 없쟎아. 썩을

댓글 없음:

댓글 쓰기