SipUtils? Is a helper, for agile accessing the api @ AliSoft? SIP (Services Integration Platform)

SipUtils? Is a visit to Ali SIP software platform (Service Integration Platform) is a third-party Ruby libraries, it can be very convenient and quick to use the open SIP platform interface.

The Gem in the open beta stage, have questions please contact me.

------ CharlesCui? @ Alisoft

[MSN: cuizheng.hz @ hotmail.com] [Email: zheng.cuizh @ gmail.com]

Installation Method:

At first Downloads ( http://code.google.com/p/siputils/ ) Page download SipUtils? The Gem files, download the file into the directory, the implementation of the command line: gem install SipUtils?. Gem-l

Usage: The Gem is installed, you can see Ruby_Home? \ Gems \ 1.8 \ gems \ SipUtils? \ Test directory of the test file, try to implement, if they can correctly return the request, then the installation is successful and can be used.

Test code: This code tests are TaoBao the taobao.user.get interface, operational parameters are (: nick => "cuizhenghz",: v => "1.0") in order to get this account cuizhenghz at Taobao personal information.

require 'rubygems' 
dir = File.expand_path(File.join(File.dirname(FILE), '..', 'lib')) 
require File.join(dir, 'SIPUtils') 
require 'pp'

include SipGenerator

evalClient("SIP") 
@sipUrl="http://sip.alisoft.com/sip/rest"; 
@options={:sip_appkey=>"20786", :sip_apiname=>"taobao.user.get", :sip_sessionid=>SIP.getSessionId, :sip_appsecret=>"2413bce0de3111ddb2d6d2f4590e509c" ,:tokenttl=>"10"} 
@options.update({:fields=>"created,nick,real_name,sex,location,buyer_credit,seller_credit,phone,mobile,email,birthday,last_visit"}) 
@options.update({:nick=>"cuizhenghz",:v=>"1.0"})

response=SIP.sipRequest(@options,{:url=>@sipUrl})

header=response.header 
p header["sip_status"]#expect "9999"

body=Hash.from_xml response.body 
p body["rsp"]["user"]["sex"]#expect "m"