SSL, Web Services, "C"

  • Thread starter Thread starter Wade Redmond
  • Start date Start date
W

Wade Redmond

I'm consuming a web service built in VB.NET with a C++ compiled dll
that extern "C" declarations. Everything works fine on both the local
machine and production machine until I make SSL required in IIS. No
response or exception is thrown, it just runs right over the function
call like nothing is happening. Any ideas? tia...
 
Oh, boy. I had to go through the same hassle, when I needed to write a C++
DLL, which would act as a client of a Web Service. I wrote it using
Microsoft recommendations and it worked fine until I used SSL. I did some
digging and found some explaining how to implement SSL in C++ Web Service
client, which - to my surprise - did not come by default. There is an MSDN
sample which does this. The problem with this sample is that it does not
work with authentication (i.e. when a Web Service requires Basic or
Integrated Windows authentication). It is amazing: there is one class you
can use as a parent of a Web service client proxy which solves the
authentication problem, and there is another, which solves the SSL problem,
but they cannot be combined (if I remember it correctly one is HTTP-based,
while the other is TCP-based). At lease I did not have time to combine them,
so I could not think of a better (easier and faster) option than writing a
C# class responsible for invoking Web Service methods, which my C++ DLL
called via COM interop. In C#, SSL does not require any programming, and
authentication can be implemented in just few lines of code. If you do not
care about authentication, you can try Microsoft's sample (don't have it at
hand, but if you need it, let me know, and I will try to find it).
Otherwise, I recommend, my approach. In fact, a friend of mine who works in
another team had to do the same at a different time, and - as I found out
later - he chose the same path. So I assume that this is not an unreasonable
approach. What bothers me, though, is that nowhere does MSDN mention that
C++ Web Service clients cannot support SSL and authentication at the same
time. I would write it in huge bold letters.

Alek
 
Thanks for posting that information. It's saved me a lot of time.
I'm not able to find the information in the knowledge base article you
described below though. If you happen to know where it's at, please
let me know.

I actually started out as you described below by creating a .net
interop component to connect with the web service. However, I'd
really really like to get rid of that piece. I'm not using
authentication the way you described though so if I can just get the
communication with https everything should be ok. Thank you!
 
Back
Top