Delphiµ÷ÓÃMagento's Webservice
×î½üÐèÒª½«Magento(¹úÍâ±È½Ï³öÃûµÄ¿ªÔ´PHP+MySQLµç×ÓÉÌÎñÍøÕ¾)ÓëÒ»¸öERP½øÐÐÕûºÏ£¬¾ÍÐèÒªµ÷ÓÃMagentoµÄWebservice¡£
MagentoÌṩ2Ì×api¡£
×¢£ºÈç¹ûÐèҪͬ¹¹µ÷ÓÃÐèҪʹÓõÚ1¸öwsdl£¬ÈçÒì¹¹³ÌÐòµ÷ÓÃÐèʹÓõÚ2¸öwsdl¡£
1.http://xxx.xxxxxxx.xxx/magento/api/soap/?wsdl
2.http://xxx.xxxxxxx.xxx/magento/api/v2_soap/?wsdl
µ÷Óò½Öè
Ò»¡¢ÔÚMagentoÖд´½¨µ÷ÓÃWebserviceµÄÓû§ÃûÓëÃÜÂë(½øÈëMagentoºǫ́¹ÜÀí->System->Web Services->Users)£¬ÔÚ´´½¨Óû§Ç°ÏÈÉè¼ÆÒ»¸ö½ÇÉ«(½øÈëMagentoºǫ́¹ÜÀí->System->Web Services->Roles)£¬ÓÃÀ´¶Ôµ÷ÓÃWebserviceµÄȨÏÞ½øÐÐÏÞÖÆ
¶þ¡¢ÔÚDelphi¶ËÓÃWSDL Import¹¤¾ß½øÐе¼È룬µ¼Èëºó»á×Ô¶¯Éú³ÉÏà¹Ø¶ÔÏóµÄÀàÐÅÏ¢
Èý¡¢Ê¹ÓÃMagentoµÄ½Ó¿Ú£¬µ÷ÓÃlogin¡¢salesOrderInfoµÈº¯Êý
Àý1£ºËÑË÷Ïà¹Ø×´Ì¬µÄ¶©µ¥
procedure TFrmSiteManagement.getOrderList;
var
P:Mage_Api_Model_Server_V2_HandlerPortType;
sessionID:WideString;
filterOn:filters;
aE:associativeEntity ;
aA:associativeArray;
orderList:salesOrderEntityArray;
order:salesOrderEntity;
i:Integer;
begin
P:= HTTPRIO1 as Mage_Api_Model_Server_V2_HandlerPortType;
//filter
filterOn:=filters.Create;
SetLength(aA,1);
aE:=associativeEntity.Create;
aE.key:='status';
aE.value:='Pending';
aA[0]:=aE;
filterOn.filter:=aA;
try
try
sessionID:= P.login('apiuser','apiuser');
orderList:=P.salesOrderList(sessionID,filterOn);
for i:=low(orderList) to high(orderList) do
begin
sessionID:= P.login('apiuser','apiuser');
order:=P.salesOrderInfo(sessionID,orderList[i].increment_id);
addContent(i,order) ;
end;
except
on E:Exception do
begin
ShowMessage(E.Message);
end;
end;
finally
P:=nil;
aE.Free;
SetLength(aA,0);
end;
end;
Àý2£ºLoad¶©µ¥Ã÷ϸ
var
P:Mage_Api_Model_Server_V2_HandlerPortType;
sessionID:WideString;
order: salesOrderEntity;
begin
P:= HTTPRIO1 as Mage_Api_Model_Server_V2_HandlerPortType;
try
try
sessionID:= P.login('apiuser
Ïà¹ØÎĵµ£º
ö¾ÙÀàÐÍ
¡¡¡¡Pascal³ÌÐò²»½öÓÃÓÚÊýÖµ´¦Àí£¬»¹¸ü¹ã·ºµØÓÃÓÚ´¦Àí·ÇÊýÖµµÄÊý¾Ý¡£ÀýÈ磬ÐÔ±ð¡¢Ô·ݡ¢ÐÇÆÚ¼¸¡¢ÑÕÉ«¡¢µ¥Î»Ãû¡¢Ñ§Àú¡¢Ö°ÒµµÈ¡£
1¡¢Ã¶¾ÙÀàÐ͵͍Òå
¸ñʽ:¡¡type ö¾ÙÀàÐͱêʶ·û=(±êʶ·û1,±êʶ·û2,…,±êʶ·ûn)
2¡¢Ã¶¾ÙÀàÐÍÊý¾ÝÌØµã
¢Ù ö¾ÙÔªËØÖ»ÄÜÊDZêʶ·û£»
ÀýÈ磬ÏÂÁÐÀàÐͶ¨ÒåÊǺϷ¨µÄ£º
¡¡¡¡ type ......
{ Private declarations }
procedure WMSysCommand (var Msg: TWMSysCommand) ; message WM_SYSCOMMAND;
procedure TForm1.WMSysCommand(var Msg: TWMSysCommand);
begin
if Msg.CmdType = SC_RESTORE then
begin
ShowMessage('SC_RESTORE');
if self.WindowState = wsMaximized then
begin
......
ÒÔCaps Lock¼ü¾ÙÀý£¬ÆäËü(VK_NUMLOCK),Ààͬ£º
ÅжÏ״̬£º
·½·¨1
Level: integer;
Level := GetKeyState(VK_CAPITAL);
if Level = 0 then
//ûÁÁ
else
//ÁÁÁË(1)
·½·¨2
KeyState : TKeyBoardState;
GetKeyboardState(KeyState);
if KeySt ......
Ê×ÏÈÓÃNotepad»òResource workshop 4.5½¨Á¢RCÎļþ¡£ ½á¹¹ÈçÏ /****************************************************************************
rcdemo.rc
produced by Borland Resource Workshop
*****************************************************************************/
# ......
¹«Ë¾µÄ²ÍÒûϵͳ³öÆ·µÄÖú¼ÇÂ룬»¹Ã»ÊµÏÖ×Ô¶¯´Ó³öÆ·Ãû³Æ»ñÈ¡ºº×ÖÆ´ÒôÊ××Öĸ¡£
ËùÒÔÔÚÍøÉÏÕÒÁËÈýÖÖ½â¾ö·½·¨£¬
Ò»ÖÖÊÇkaguo µÄʹÓó£Óúº×ÖÆ´Òô²éÕÒ·½·¨£¬ÕâÖÖ´úÂëÊ®·Ö¼òµ¥£¬ÊµÏÖ·½±ã£¬µ«ÊÇÕâÖÖ´úÂë½ö½öÊÇÒ»¼¶×ֿ⣬ֻ֧³ÖÈýǧÁ㼸¸ö×ֵġ£
//»ñÈ¡ÖÐÎÄ×Ö´®µÄÉùĸµ ......