By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,337 Members | 2,084 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,337 IT Pros & Developers. It's quick & easy.

How to call a WebService from VC++?

P: n/a
I need to call a function in a WebService from a VC++ 7.1 project. The
WebService requires NTLM authentication and should be the user of the
calling program. How should this be done?

I have found this article from Microsoft:
http://msdn.microsoft.com/library/de...entication.asp
But it looks that it's very low-level. Even if I copy the code generated by
the sproxy.exe program and manually change it; then there still are calls to
CSoapWininetClient::SendRequest (defined in atlsoap.h) which indirectly call
HttpSendRequest, mentioned in the article. Does this mean that I have to
change / write all the code in atlsoap.h by myself too?

And even then; in this article is described how to set the username and
password manually by calling InternetSetOption (although it didn't work for
me). But I don't want the user to enter the data again; he is logged in
already in Windows. I just want to send his credentials to the WebService
like Internet Explorer does this too (when the option User Authentication /
Logon / "Automatic logon only in Intranet zone" or "Automatic logon with
current username and password" is set).

How can I do this?

Eric

P.S. Sorry if I'm in the wrong newsgroup; it's a little difficult for this
subject.
Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Problem solved for me.
In either way a call to HttpSendRequest is made. That function automatically
makes requests with the correct authentication (Kerberos) if the calling
process is being impersonated correctly.
My problem was that I thought the calling process was impersonated and the
WebService requires NT Integrated Login. That was wrong. The calling process
is always running anonymous (probably Local System or so) and the setting
for the WebService was wrong and should have been Anonymous Login.
Authentication checks are made somewhere else.

Eric
"Eric" <ba********@kull.ch.nospam.me.com> wrote in message
news:dc**********@news.hispeed.ch...
I need to call a function in a WebService from a VC++ 7.1 project. The
WebService requires NTLM authentication and should be the user of the
calling program. How should this be done?

I have found this article from Microsoft:
http://msdn.microsoft.com/library/de...entication.asp
But it looks that it's very low-level. Even if I copy the code generated
by the sproxy.exe program and manually change it; then there still are
calls to CSoapWininetClient::SendRequest (defined in atlsoap.h) which
indirectly call HttpSendRequest, mentioned in the article. Does this mean
that I have to change / write all the code in atlsoap.h by myself too?

And even then; in this article is described how to set the username and
password manually by calling InternetSetOption (although it didn't work
for me). But I don't want the user to enter the data again; he is logged
in already in Windows. I just want to send his credentials to the
WebService like Internet Explorer does this too (when the option User
Authentication / Logon / "Automatic logon only in Intranet zone" or
"Automatic logon with current username and password" is set).

How can I do this?

Eric

P.S. Sorry if I'm in the wrong newsgroup; it's a little difficult for this
subject.

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.