Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/135.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用gSOAP连接到WCF web服务 我正在编写一个简单的CMD客户端,试图消耗我开发的WCF Web服务,以便测试如何使用非托管C++ + < /P>连接到Web服务。_C++_Wcf_Gsoap - Fatal编程技术网

使用gSOAP连接到WCF web服务 我正在编写一个简单的CMD客户端,试图消耗我开发的WCF Web服务,以便测试如何使用非托管C++ + < /P>连接到Web服务。

使用gSOAP连接到WCF web服务 我正在编写一个简单的CMD客户端,试图消耗我开发的WCF Web服务,以便测试如何使用非托管C++ + < /P>连接到Web服务。,c++,wcf,gsoap,C++,Wcf,Gsoap,我一直在循序渐进地学习本教程,但仍然没有成功地使用该服务 #include "BasicHttpBinding_USCOREIService1.nsmap" #include "soapBasicHttpBinding_USCOREIService1Proxy.h" #include <iostream> #include <string> using namespace std; int main(int argc, char **argv) { BasicHtt

我一直在循序渐进地学习本教程,但仍然没有成功地使用该服务

#include "BasicHttpBinding_USCOREIService1.nsmap"
#include "soapBasicHttpBinding_USCOREIService1Proxy.h"
#include <iostream>
#include <string>

using namespace std;


int main(int argc, char **argv)
{
BasicHttpBinding_USCOREIService1Proxy myProxy;
static const char* const endPoint = "http://localhost:50181/Service1.svc";

myProxy.soap_endpoint = endPoint;
_ns1__GetData param;
_ns1__GetDataResponse response;
param.fileName = &std::string("house.ifc");

if ( myProxy.GetData(&param, &response) == SOAP_OK) {
    cout << "Hello" << endl; //Succeeded
}
else {

    myProxy.soap_stream_fault(std::cerr);
}
return 0;
}
#包括“BasicHttpBinding_USCOREIService1.nsmap”
#包括“soapBasicHttpBinding_USCOREIService1Proxy.h”
#包括
#包括
使用名称空间std;
int main(int argc,字符**argv)
{
BasicHttpBinding_USCOREIService1Proxy myProxy;
静态常量字符*常量端点=”http://localhost:50181/Service1.svc";
myProxy.soap_endpoint=端点;
_ns1__获取数据参数;
_ns1__GetDataResponse响应;
param.fileName=&std::string(“house.ifc”);
if(myProxy.GetData(¶m,&response)==SOAP\u OK){

cout如果您的客户端将安装在windows计算机上,最好的方法是使用C++\CLI网桥连接您的客户端和托管生成的代理,这是唯一适用于所有类型wcf绑定(HTTP、TCP、MSMQ等)的解决方案


如果您选择另一个库,请确保它只能完美地用于HTTP绑定。

这是因为gSOAP客户端和WCF服务不能很好地与SOAP 1.2配合使用。 如果将soapcpp2与“-1”开关一起使用以强制使用SOAP1.1,则它将起作用


我在Ubuntu上用GSOAP 2.84测试过它。它的工作原理。< /P>我不知道问题在哪里。我已经使用了BaseCHTTPBIN,就像在教程中所说的一样,但是仍然有相同的消息发生。有没有其他的方法可以实现,这使得我能够用非托管C++连接到WCF Web服务?谢谢你的建议。但是我已经犯错了。d在该链接的最后一篇文章中给出了解决方案