免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6474 | 回复: 4
打印 上一主题 下一主题

请问一个关于gsoap 中生成的wsdl的问题! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-11-25 12:26 |只看该作者 |倒序浏览
我写了一个mycat.h的文件用来生成mycat.wsdl
  1. //gsoap ns service name: mycat
  2. //gsoap ns service namespace: http://192.168.1.144:812/mycat.wsdl
  3. //gsoap ns service location: http://192.168.1.144:812
  4. //gsoap ns service executable: mycat
  5. //gsoap ns service encoding: encoded
  6. //gsoap ns schema namespace: urn:mycat

  7. int ns__my_cat_str(char *_str1, char *_str2, char **_result);
复制代码
然后写server端client都成功了。可以部署以后在浏览器访问看不到mycat.wsdl的内容。这个应该怎么做?

  1. int main(int argc, char **argv)
  2. {
  3.     int m, s; /* master and slave sockets */
  4.     struct soap mycat_soap;

  5.     soap_init(&mycat_soap);
  6.     soap_init2(&mycat,SOAP_IO_KEEPALIVE,SOAP_IO_KEEPALIVE);

  7.     soap_set_namespaces(&mycat_soap, mycat_namespaces);
  8.     if (argc < 2)
  9.     {
  10.         printf("usage: %s <server_port> \n", argv[0]);
  11.         exit(1);
  12.     }
  13.     else
  14.     {
  15.         m = soap_bind(&mycat_soap, NULL, atoi(argv[1]), 100);
  16.         if (m < 0)
  17.         {
  18.             soap_print_fault(&mycat_soap, stderr);
  19.             exit(-1);
  20.         }
  21.         fprintf(stderr, "Socket connection successful: master socket = %d\n", m);
  22.         for ( ; ; )
  23.         {
  24.             s = soap_accept(&mycat_soap);
  25.             if (s < 0)
  26.             {
  27.                 soap_print_fault(&mycat_soap, stderr);
  28.                 exit(-1);
  29.             }
  30.             fprintf(stderr, "Socket connection successful: slave socket = %d\n", s);
  31.             mycat_serve(&mycat_soap);
  32.             soap_end(&mycat_soap);
  33.         }
  34.     }
  35.     return 0;
  36. }
  37. int ns__my_cat_str(struct soap *mycat_soap, char *_str1, char *_str2, char **ret)
  38. {
  39. }
复制代码
编译完成后运行./my_cat_str 800
然后在浏览器打开显示

  1. <SOAP-ENV:Envelope>
  2.   <SOAP-ENV:Body>
  3.     <SOAP-ENV:Fault>
  4.       <faultcode>SOAP-ENV:Client</faultcode>
  5.       <faultstring>HTTP GET method not implemented</faultstring>
  6.     </SOAP-ENV:Fault>
  7.   </SOAP-ENV:Body>
  8. </SOAP-ENV:Envelope>
复制代码
看到网上有个帖子说是缺少
  1. mycat_soap.fget = http_get;
复制代码

  1. int   http_get(struct soap *soap)
  2. {
  3.         soap_response(soap, SOAP_HTML);
  4.         soap_send(soap,"<html>My Web sevice is operational.</html>\n");
  5.         soap_end_send(soap);
  6.         return SOAP_OK;
  7. }
复制代码
我加上以后结果不显示xml了只显示My Web sevice is operational.这一行,也就是http_get定义的内容,
如果我要显示http://192.168.1.144:800/mycat.wsdl 的内容应该怎么实现?

论坛徽章:
1
CU十二周年纪念徽章
日期:2013-10-24 15:41:34
2 [报告]
发表于 2010-11-25 12:42 |只看该作者

论坛徽章:
0
3 [报告]
发表于 2010-11-25 13:08 |只看该作者
相当犀利啊,谢谢了。

论坛徽章:
0
4 [报告]
发表于 2013-07-09 13:48 |只看该作者
soap->tmpbuf  在哪个头文件中。

论坛徽章:
0
5 [报告]
发表于 2013-07-09 13:48 |只看该作者
请大侠告诉我一下。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP