Click here to load reader
Upload
toshiya-tsuru
View
1.315
Download
0
Embed Size (px)
Citation preview
SugarCRMのSOAP実装:soap phpSugarCRMのSOAP実装:soap.php
h ?• soap.php ?– http://host/sugarcrm/soap.php
来• soap.php で出来ること– 認証:login(), logout()参– 参照:get_entry(), get_entries()
– 更新:set_entry(), set_entries()削除 t t ( d l t 1)– 削除:set_entry(:delete = 1)
– その他もろもろ
• 詳しくは• 詳しくは– http://www.sugarcrm.com/wiki/index.php?title=SOAP_Documentation
soap php使用上の注意soap.php 使用上の注意
サ バまわりとの相性• WEBサーバまわりとの相性– Apache(mod_php) + soap.php → ○– IIS(fastcgi) + soap.php → ○– Lighttpd(fastcgi) + soap.php → ×g p ( g ) p p p– Other + soap.php → ?
• LDAPユーザの認証E ti K で何らかのパスワ ド暗号化が必– EncryptionKeyで何らかのパスワード暗号化が必要
NETと SOAP.NET と SOAP
る ポ• Visual Studioによるサポート
– 「WEB参照の追加」(Visual Studio 2005)、「サービ参照 追加」( )、 サス参照の追加」(Visual Studio 2008)によるプロキシクラスの自動生成シクラ 自動 成
自動生成される自動生成される
実践SugarCRM SOAP API実践SugarCRM SOAP API
統合• ADO.NETとの統合
System.Data.SqlClient
System Data OracleClientADO.N
System.Data.OracleClient
System.Data.OleDbNET
System.Data.OleDb
System.Data.Odbc
System.Data.SugarClient
どうやって動く?どうやって動く?• System.Data.SugarClientSyste ata Suga C e t
string conStr = "Data Source=http://host/sugarcrm/;User=admin;Password=foo";
using(IDbConnection con = new SugarConnection(conStr)){con Open(); - Acon.Open(); A
IDbCommand cmd = con.CreateCommand();string sql = "SELECT * FROM Contacts";cmd.CommandText = "sql;IDataReader reader = cmd.ExecuteReader();
while(reader.Read()){ - B
}
con Close();con.Close(); }
SugarSoapReference.sugarsoap soap = new SugarSoapReference.sugarsoap();SugarSoapReference.user_auth auth = new SugarSoapReference.user_auth();auth user name = user;A auth.user_name = user;auth.password = MD5(password);var response = soap.login(auth, "SugarClient");string _session = res.id;
t t li t( i d l it i d ff t fi ld li it 0)
A
B soap.get_entry_list(_session, _module, _criteria, _order, _offset, _fields, limit, 0);B
サンプルアプリケーションサンプルアプリケーション
• SugarSql– System.Data.SugarClientを使ったSQLクライアントツール
ダウンロードダウンロード
• SugarClient (System.Data.SugarClient)– http://code.google.com/p/sugarclient/p // g g /p/ g /
• SugarSql– http://code.google.com/p/sugarsql/