[Affelio-cvs 816] CVS update: affelio/lib/Affelio/SNS

Back to archive index

Tadashi Okoshi slash****@users*****
2005年 12月 10日 (土) 07:14:09 JST


Index: affelio/lib/Affelio/SNS/Handshaker_c.pm
diff -u affelio/lib/Affelio/SNS/Handshaker_c.pm:1.10 affelio/lib/Affelio/SNS/Handshaker_c.pm:1.11
--- affelio/lib/Affelio/SNS/Handshaker_c.pm:1.10	Fri Jul  1 11:00:09 2005
+++ affelio/lib/Affelio/SNS/Handshaker_c.pm	Sat Dec 10 07:14:09 2005
@@ -14,7 +14,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
-# $Id: Handshaker_c.pm,v 1.10 2005/07/01 02:00:09 slash5234 Exp $
+# $Id: Handshaker_c.pm,v 1.11 2005/12/09 22:14:09 slash5234 Exp $
 
 package Affelio::SNS::Handshaker_c;
 {
@@ -37,7 +37,48 @@
 
     use Exporter;
     @ISA = "Exporter";
-    @EXPORT = qw (send_HandShake reply_HandShake get_F2List post_Message);
+    @EXPORT = qw (send_HandShake reply_HandShake get_F2List post_Message get_news);
+
+    ##################################################################
+    #get_news
+    # proto_ver: 1
+    ##################################################################
+    sub get_news{
+	my %arg = @_;
+	my $proto_ver = 1.0;
+	my $dest_uri = $arg{dest_uri};
+	my $xwsse_mesg = $arg{xwsse_mesg};
+	my $format = "plain";
+
+	debug_print("C::get_news: dest=[$dest_uri]");
+	debug_print("C::get_news: wsse=[$xwsse_mesg]");
+
+	my $result = eval {
+	    XMLRPC::Lite
+		->proxy($dest_uri) #XML
+		->call(
+		       'affelio.get_news',
+		       $proto_ver,
+		       $xwsse_mesg,
+		       $format,
+		       )
+		->result;
+	  };
+
+	debug_print("C::get_news: RPC returned.\n");
+	if ($@) {
+	    throw Affelio::exception::NetworkException($@);
+	}
+	if($result->{flerror} ne "0"){
+	    throw Affelio::exception::NetworkException("XML-RPC Error: " . $result->{message});
+	}
+
+	debug_print("get_news: OK : $result->{message}\n");
+	debug_print("get_news: OK : [$result->{flerror}]\n");
+	return $result;
+
+
+    }
 
     #################################################################
     # post_Message


Affelio-cvs メーリングリストの案内
Back to archive index