有关tuxedo客户端的程序问题

#include<stdio.h>#include"atmi.h"#include"fml.h"/*myfuncmustbedefinedasbelow,otherdef... #include <stdio.h>
#include "atmi.h"
#include "fml.h"
/*myfunc must be defined as below,other define is error*/
void _TMDLLENTRY myfunc(char *buffer,long len,long flag)
{
long len2;
char buftype[20],subtype[20];
if ((len2=tptypes(buffer,buftype,subtype))<0)
{
printf("invalid buffer receive;\n");
}
else if(!strcmp(buftype,"STRING"))
{
printf("unsolicited message from server\n:%s\n",buffer);
}
else if(!strcmp(buftype,"FML"))
{
printf("unsolicited message from server:\n");
Fprint(buffer);
}
else
printf("cannot print out buffer\n");
}
#if defined(__STDC__) || defined(__cplusplus)
main(int argc, char *argv[])
#else
main(argc, argv)
int argc;
char *argv[];
#endif
{
char *sendbuf, *rcvbuf;
long sendlen, rcvlen;
int ret;
TPEVCTL evctl;
int sub_serv=0;
if(argc != 2) {
(void) fprintf(stderr, "Usage: simpcl money\n");
exit(1);
}
/* Attach to System/T as a Client Process */
if (tpinit((TPINIT *) NULL) == -1) {
(void) fprintf(stderr, "Tpinit failed\n");
exit(1);
}
sendlen = strlen(argv[1]);
if((sendbuf = (char *) tpalloc("STRING", NULL, sendlen+1)) == NULL) {
(void) fprintf(stderr,"Error allocating send buffer\n");
tpterm();
exit(1);
}
if((rcvbuf = (char *) tpalloc("STRING", NULL, sendlen+1)) == NULL) {
(void) fprintf(stderr,"Error allocating receive buffer\n");
tpfree(sendbuf);
tpterm();
exit(1);
}
if(tpsetunsol(myfunc)== TPUNSOLERR)
{
printf("tpsetunsol() failure:%s\n",tpstrerror(tperrno));
tpfree(sendbuf);
tpfree(rcvbuf);
tpterm();
exit(1);
}
//sub_serv=tpsubscribe(eventexpr,filter,(TPEVCTL *)NULL,TPSIGRSTRT);
evctl.flags = TPEVSERVICE;
strcpy(evctl.name1,"CLIENT");
sub_serv=tpsubscribe("BANK_TLR_WITHDRAWAL",NULL,(TPEVCTL *)NULL,TPSIGRSTRT);
if (sub_serv==-1L)
{
printf("tpsubscribe() failure:%s\n",tpstrerror(tperrno));
tpfree(sendbuf);
tpfree(rcvbuf);
tpterm () ;
exit(1);
}
else
printf("tpsubscribe(BANK_TLR_WITHDRAWAL) success\n");
(void) strcpy(sendbuf, argv[1]);
ret = tpcall("WITHDRAWAL", (char *)sendbuf, 0, (char **)&rcvbuf, &rcvlen, (long)0);
if(ret == -1) {
(void) fprintf(stderr, "tpcall(WITHDRAWAL) failure:%s\n",tpstrerror(tperrno));
tpfree(sendbuf);
tpfree(rcvbuf);
tpterm();
exit(1);
}
(void) fprintf(stdout, "Returned string is: %s\n", rcvbuf);
if (tpunsubscribe(sub_serv,TPSIGRSTRT)==-1)
printf("tpunsubscribe():%s\n",tpstrerror(tperrno));
/* Free Buffers & Detach from System/T */
tpfree(sendbuf);
tpfree(rcvbuf);
tpterm();
return(0);
}
为什么运行之后会出现tpcall(WITCHDRAWAL)failure:TPENOENT-no entry found 的错误
这个问题好像比较难回答,那么请问谁有用tpscrible()和tpunscrible()还有tppost()写的客户端和服务器端例子程序么,或者将simpapp的程序改写,可以编译运行就行。有的话,请发给我。672468756@qq.com如果可用,就给分。
展开
 我来答
时间无尽
2012-07-09
知道答主
回答量:20
采纳率:0%
帮助的人:19.1万
展开全部
请查看WITHDRWAWAL 服务是否启动:
>tmadmin
>psc
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式