Connect to a WCF web service using gSOAP

I am writing a simple CMD client to try to use the WCF web service that I developed to test how to connect to the web service using unmanaged C ++.

I followed this tutorial http://www.blinnov.com/en/2008/01/22/wcf-service-unmanaged-client/ step by step, but so far I have not been able to successfully use the service.

#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;
}

it always gives me Error 415: SOAP-ENV: Server [no subcode] "HTTP error" Details: HTTP / 1.1 415 Unsupported media type I tried all day to do this, but nothing new .:(

+3
source share
2 answers

, gSOAP- WCF SOAP 1.2. , soapcpp2 "-1", SOAP 1.1.

gSOAP 2.8.4 Ubuntu, .

+1

Windows-, ++\CLI, -, , wcf (HTTP, TCP, MSMQ,...).

librairy, , HTTP.

0

Source: https://habr.com/ru/post/1782093/