I am writing a simple cmd client to try to consume the WCF web service i developed in order to test how to connect to the Web service using unmanaged C++.
I have been following this tutorial http://www.blinnov.com/en/2008/01/22/wcf-service-unmanaged-client/ step by step but still not managed to consume the service successfully.
#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; //Succeeded
}
else {
myProxy.soap_stream_fault(std::cerr);
}
return 0;
}
it always gives me Error 415 fault: SOAP-ENV:Server[no subcode] "HTTP Error" Detail: HTTP/1.1 415 Unsupported Media Type I have been trying all the day to get it done but still nothing new. :(