Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSXML Server Object 2

Status
Not open for further replies.

Jorrti

Programmer
Jun 10, 2003
13
NL
Hi all,
I'm trying to use the MSXML4 Server HTTP object to post to a SSL secured location.
I use the "Msxml2.ServerXMLHTTP4.0" object. I want to use the setOption method to specify which client has to be used.
Like this:

IServerXMLHTTPRequestPtr pHttpRequest;
Check(pHttpRequest.CreateInstance("Msxml2.ServerXMLHTTP4.0"));

pHttpRequest->setOption( 3, "certificatelocation");

I get a compile error:
error C2664: 'setOption' : cannot convert parameter 1 from 'const int' to 'enum _SERVERXMLHTTP_OPTION'
Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
Error executing cl.exe.

I also tried 'SXH_OPTION_SELECT_CLIENT_SSL_CERT instead' of just '3'. The complier says it's an Ambiguous symbol.

What am I doing wrong?

specs at:
Thanks in advance,

Jorrti
 
the website i post to is one for billing mobile transactions. I can only be accesses via a POST request so it is not possible to go to the website with a browser.
-The website controls the identity of every computer it receives posts from.
-I have to authenticate myself everytime I post, that's not a problem when I can use a certificate for this purpose. Now I have to click yes/accept every time. That's not what I want for a server application ;)
I'm gonna try your suggestion of the WinHTTP SDK now.
 
Please post some progress messages ... I may need to do the same in the future ;-)

/JOlesen
 
I don't think that using the WinHTTP SDK will solve the problem because ServerXMLHTTP uses WinHTTP already.
This was stated on MSDN and I tested it myself. Here's a line from a HTTP-Header of a ServerXMLHTTP POST request that I caught:

HTTP_USER_AGENT: Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)

 
You are quite right that ServerXMLHTTP uses WinHTTP.

However I don't agree with your conclusion :

If ServerXMLHTTP doesn't expose the complete interface provided by WinHTTP, you seem to be stuck in the problems you have described.
If however you have the full control of WinHTTP, I think you are in business.

Good luck !

/JOlesen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top