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(¶m, &response) == SOAP_OK) {
cout << "Hello" << endl;
}
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 .:(
source
share