472,119 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

SSL, Web Services, "C"

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...
Nov 16 '05 #1
3 2598
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

"Wade Redmond" <wj***@hotmail.com> wrote in message
news:b4*************************@posting.google.co m...
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...

Nov 16 '05 #2
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!

"Alek Davis" <alekDOTdavisATintelDOTcom> wrote in message news:<Oc**************@TK2MSFTNGP10.phx.gbl>...
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

"Wade Redmond" <wj***@hotmail.com> wrote in message
news:b4*************************@posting.google.co m...
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...

Nov 16 '05 #3
Wade,

I think this is it:
<http://msdn.microsoft.com/library/de...-us/vcsample/h
tml/vcsamSecureSOAPSample.asp> (SecureSOAP Sample: Implements a Secure SOAP
Communication (HTTPS)). I did not test it, though, so I cannot guarantee
that it will work.

Alek

"Wade Redmond" <wj***@hotmail.com> wrote in message
news:b4**************************@posting.google.c om...
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!

"Alek Davis" <alekDOTdavisATintelDOTcom> wrote in message

news:<Oc**************@TK2MSFTNGP10.phx.gbl>...
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

"Wade Redmond" <wj***@hotmail.com> wrote in message
news:b4*************************@posting.google.co m...
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...

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Michael Rodriguez | last post: by
3 posts views Thread by gregory_may | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.