473,412 Members | 5,361 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Web Service always fails when called

Hello,

I'm trying to use a web service from my MFC C++ app.

For testing purposes, I created the simple web service in VS2005:

[WebMethod]
public int Sum(int num1, int num2)
{
return (num1+num2);
}

I tested it firstly using asp.net and it worked fine. To make this test, so
I could add a web reference, I
created a web site in IIS for the web service so I could test using
http://localhost/webservice/WSTest.asmx

Following that, I created a win32 console app, added a web reference to the
above
URL (which showed my Sum() method) and coded:

int _tmain(int argc, _TCHAR* argv[])

{

if(SUCCEEDED(CoInitialize(NULL)))

{

WSTest::CWSTest obj;

HRESULT hr;

int result=0;

hr = obj.Sum(3,4,&result);

if (SUCCEEDED(hr))

cout << "result = " << result;

else

cout << "error";

return 0;

CoUninitialize();

}

The problem is the call to obj.Sum() never succeeds (hr = E_FAIL). When I
created the console app, I selected ATL support, but I'm not sure if it's
needed.

What am I doing wrong?

Jeová
Jun 27 '08 #1
0 1000

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: Ken Allen | last post by:
I have a number of services developed in C# (.Net), and they have been working fine for the most part. Recently someone reported that ipon occassion (originally rarely, but more frequently on some...
23
by: Adam Clauss | last post by:
I have a C# Windows Service running as the NetworkService account because it needs to access a network share. As part of the service's initialization, I want the service to terminate, if an...
5
by: Gardar | last post by:
I have a .net webservice, developed with c++ managed extensions. The websrvice returns an xml-document with a reference to a server side xml-stylesheet in the format <?xml-stylesheet href =...
3
by: Robert May | last post by:
Here's the setup: Windows 2003 running .net 1.1 webservice with Integrated Authentication set. Client machine running .net 1.1 on xp pro with latest service packs and updates. User also has...
5
by: Benzi Eilon | last post by:
I have written a C# application which should run as a Windows Service. I must avoid having multiple instances of the application on one machine so I inserted the following code at the beginning of...
0
by: pdube | last post by:
I have been trying for a few weeks to have a service that calls a COM in .NET I made a service in .NET following simple instructions I found on the web. It worked fine. Then I needed to make a...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
10
by: Ryan | last post by:
Hello everyone, I have made a service that starts timers when it starts. I have another windows form application that stops and starts the service. Do I need to deal with any started timers when...
22
by: robertgregson | last post by:
Using C#, .NET3.5, Visual Studio 2008 and WCF on Windows VISTA SP1, I have written a service, service host (as a C# console application) and a client. The service uses...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.