【问题标题】:gsoap Server does not accept Client requestgsoap 服务器不接受客户端请求
【发布时间】:2013-06-09 17:43:00
【问题描述】:

我在 gsoap 中创建了一个 Web 服务,但服务器不接受请求。没有错误,但我不明白为什么它不接受来自客户端的请求。我在这里粘贴我的客户端和服务器代码。
客户代码

EnrollmentServiceSOAPProxy proxy;
_ns1__performRequest *req = new _ns1__performRequest();
_ns1__performRequestResponse *res = new _ns1__performRequestResponse(); 
if(proxy.performRequest(req, res) == SOAP_OK)
   print "OK" // pseudo code for print. 
else
    print "Not Ok"

服务器代码:

int __ns1__performRequest(soap *, _ns1__performRequest *ns1__performRequest, _ns1__performRequestResponse *ns1__performRequestResponse)
{
    ns1__performRequestResponse->jobID = "1011";
    return SOAP_OK;
}

服务器正在监听本地主机。但请求没有到达服务器。

这是 WSDL 文件:https://www.dropbox.com/s/n2sdv51qmttp7vb/EnrollmentService.wsdl

我调试了代码,但没有帮助。

【问题讨论】:

  • 您能否分享您在服务对象上进行soap_begin_serve() 调用和dispatch() 的服务器代码部分?

标签: gsoap


【解决方案1】:

它以前发生在我身上。在服务定义中,我使用了不同的端口,而服务器正在监听不同的端口。这似乎也是你的问题。

【讨论】:

    【解决方案2】:

    服务端点可能不会设置为您的服务器,而是设置为 WSDL 定义为服务器地址的任何内容。您应该将EnrollmentServiceSOAPProxy proxy("URL"); 与作为服务器端点地址的 URL 一起使用(http://hostaddrhttp://localhost:8000,当您在端口 8000 上本地运行服务器时)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-18
      • 2015-06-13
      • 1970-01-01
      • 1970-01-01
      • 2021-11-01
      • 1970-01-01
      • 2013-03-07
      • 1970-01-01
      相关资源
      最近更新 更多