资源简介
用于delphi 开发三层和多层系统,还可以开发移动端的软件,是一个很好的中间件软件.
代码片段和文件信息
#include
#include
#include “..\kbmMW_Global.h“
#include “..\kbmMW_Variant.h“
#include “..\kbmMW_Exception.h“
#include “..\kbmMW_ClientTransport.h“
#include “..\kbmMW_Client.h“
int main(int argc char *argv[])
{
int err;
int i;
long l;
TkbmMWClientTransport *transport = KBMMW_NULL;
TkbmMWSimpleClient *client = KBMMW_NULL;
TkbmMWVariant *v = KBMMW_NULL;
TkbmMWVariant *arg = KBMMW_NULL;
char *result;
kbmMW_CT_Initialize();
err=0;
transport=kbmMW_New_CT();
transport->Connect(transport“localhost“3000);
kbmMW_IfException(transport) {
err=kbmMW_ErrorNo(transport);
printf(“Exception: %d - %s\n\r“errkbmMW_ErrorMessage(transport));
goto L_Exit;
}
client=kbmMW_New_SC(transport);
arg=kbmMW_New_Variant();
kbmMW_Set_VariantAsString(arg“KBMMW_INVENTORY“-1);
for (i=0; i<1000; i++) {
client->SendRequest(client“KBMMW_INVENTORY““kbmMW_1.0““GET SYNTAX ABSTRACT“arg&v);
kbmMW_IfException(client) {
err=kbmMW_ErrorNo(client);
printf(“Exception: %d - %s\n\r“errkbmMW_ErrorMessage(client));
goto L_Exit;
}
if (client->IsError(client)) {
printf(“Error from server: %d - %s\n\r“client->GetStatusCode(client)client->GetStatusText(client));
goto L_Exit;
}
// Print result.
printf(“Result:\n\r StatusCode=%d (%s)\n\r“client->ResponseStream->StatusCodeclient->ResponseStream->StatusText);
kbmMW_Get_VariantAsString(v&result&l);
printf(“Data: %s\n\r“result);
}
L_Exit:
kbmMW_Dispose_Variant(&v);
kbmMW_Dispose_Variant(&arg);
kbmMW_Dispose_SC(&client);
transport->Disconnect(transport);
kbmMW_Dispose_CT(&transport);
kbmMW_CT_Finalize();
return err;
}
- 上一篇:泰和安TX3816调试编程软件
- 下一篇:冰山客蝴蝶指标内附教材
评论
共有 条评论