473,770 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to call a WebService from VC++?

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
CSoapWininetCli ent::SendReques t (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 InternetSetOpti on (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
1 5737
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********@kul l.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 CSoapWininetCli ent::SendReques t (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 InternetSetOpti on (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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1301
by: Thijs | last post by:
Hi, I am developing both a webservice and a Windows Forms webservice client. After I've deployed my webservice to the webserver I update my webservice reference in my client application, but the code generated by the webservice import program (wsdl version 1.1.4322.573) does not compile. I have to edit it manually to get it working. My webservice looks something like this (cut-down):
1
1687
by: shailesh | last post by:
Hi All, I have created a ASP.NET web service with a web method. This method retrives data from SQL Server and returns it as an XML string. Now I have added a web reference to this web service in a VC++ 7.1 (unmanaged) project. I call the web method in my VC++ code. The problem I am facing is that the line next to the line that calls the web method is executed even before the call to the web method returns, causing inconsistencies in...
1
1387
by: dbradley | last post by:
Hi, I am trying to access a webservice using VC++.Net. When I try and add a webservice using Project/Add Webservice I get to messages: "No Web References were found on this page" and "the request failed with HTTP status 407:Proxy Access Denied" Can anybody "baby step" me through the procedure I need to follow in order to remedy this problem. I just use C++ for its computational speed and am not a professional programmer.
4
3319
by: Tim Gallivan | last post by:
Hello group, I'm trying to develop a proof of concept webservice which asynchronously calls a function in a DLL. The function raises an event when it is finished, and works when used as part of a windows form. When I try to hook up the webservice to the event and call the WS, the CPU goes to 100% and I have to restart the WWW service. Does anyone have an idea as to how this can be done ... and if not, directions to a tall bridge would...
2
9927
by: Call Web service dynamically. | last post by:
I have VC++.NET application which takes the Webservice URL at the runtime from the user and it should call the webservice method based on what the user has supplied.
5
3798
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains about one of the object wanting to extend MarshalByRefObject object, and I get an error SDL1030. I can use the webservice in a C# project just fine but not the C++. Can anyone help me out with this?
0
1824
by: Sathya | last post by:
Hi, I have a vb.net webservice which takes XMLDocument as a parameter and returns bool. Signature of the method is some thing like this AddXmlEmpDetails(xmlEmp as XMLDocument) as Boolean. I am able to call this method from vb.net desktop client and add a record to the database(this I used to test if there is any problem in the webservice). My main requirement is to create a C++(native dll) wrapper what is recognized by a non...
0
1091
by: Standist | last post by:
vs.net 2003 I create a webservice using vc.net.In the webservice invoked a method in a dll from third party. I compile and link the program without any error.But I got a error when I debug it,I got the same error when I access the webservice through IE directly. The following is the error message: line 196£º <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
2
5574
by: jojoba | last post by:
Hello to all! I have a fairly simple webservice running in asp.net ajax under c# (vs 2008). I built the service and it runs just dandy when i test it by itself in visual studio. However, to make it work, i had to break up the webmethod into the BeginXXX, EndXXX model as per http://msdn2.microsoft.com/en-us/library/aa480516.aspx But now, i can no longer call this method from javascript (since to
0
9453
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.