我正在使用 gSOAP lib 开发一个 Qt 客户端 (C++),它应该与 Microsoft (WCF) 的 Web 服务讨论。我在两边都使用 SOAP 1.1。
我的客户端代码如下:
CustomBinding_USCOREISynchronisation service;
soap_ssl_init(); /* init OpenSSL (just once) */
soap_init2(service.soap, SOAP_IO_KEEPALIVE, SOAP_IO_KEEPALIVE);
service.soap->max_keep_alive = 1000; // at most 100 calls per keep-alive session
service.soap->accept_timeout = 6000; // optional: let server time out after ten minutes of inactivity
if (soap_ssl_client_context(service.soap,
SOAP_SSL_NO_AUTHENTICATION,
NULL, /* keyfile: required only when client must authenticate to server (see SSL docs on how to obtain this file) */
NULL, /* password to read the key file (not used with GNUTLS) */
NULL, /* cacert file to store trusted certificates (needed to verify server) */ NULL, /* capath to directory with trusted certificates */
NULL /* if randfile!=NULL: use a file with random data to seed randomness */
))
{
soap_print_fault(service.soap, stderr);
exit(1);
}
_ns1__Connect req;
_ns1__ConnectResponse resp;
std::string strLogin = "tata@gmail.com";
std::string strPassword = "681982981298192891287B0A";
bool bInternalUser = true;
req.login = &strLogin;
req.password = &strPassword;
req.isInternalUser = &bInternalUser;
int err = service.__ns1__Connect(&req, &resp);
if (SOAP_OK == err)
qDebug() << ":D";
else
{
qDebug() << "Error : " << err;
soap_print_fault(service.soap, stderr);
}
qDebug() << "Result of Connect : " << resp.ConnectResult;
问题:当我执行程序时,我在“tcp_disconnect”函数中得到一个 SIGPIPE(Broken pipe),正好在“r = SSL_shutdown (soap-> ssl);”这一行。
生成的错误消息:
错误 -1 故障:SOAP-ENV:客户端 [无子代码]“文件结束或无输入:操作中断或超时”详细信息:[无详细信息]
你知道为什么吗?如果您需要更多资源或信息,请告诉我!
提前非常感谢,
大声笑。