473,395 Members | 2,467 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,395 software developers and data experts.

Error while passing parameters to a web Service thorugh C++ code

Hello,

I have created an web service in C# and accessing it thrugh C++ code.
But when i make a call through the client, the parameter does not reach the
server but it does not show any error code on client.

I have attached my code with this

Connector.CreateInstance(__uuidof(HttpConnector30) );
Connector->Property["EndPointURL"] = [WEbServiceURLname]
HRESULT hr = Connector->Connect();

// Begin message
Connector->Property["SoapAction"] = "http://tempuri.org/GetFloors";
hr =Connector->BeginMessage();

// Create the SoapSerializer
Serializer.CreateInstance(__uuidof(SoapSerializer3 0));

// Connect the serializer to the input stream of the connector
Serializer->Init(_variant_t((IUnknown*)Connector->InputStream));

// Build the SOAP Message
hr= Serializer->StartEnvelope("","NONE","");
hr = Serializer->StartBody("NONE");
hr = Serializer->StartElement("GetFloors","","NONE","");

hr = Serializer->StartElement("siteId","","NONE","");
Serializer->WriteString("1");
hr = Serializer->EndElement();

hr = Serializer->EndElement();
hr = Serializer->EndBody();
hr = Serializer->EndEnvelope();

// Send the message to the web service
hr = Connector->EndMessage();

// Let us read the response
hr = Reader.CreateInstance(__uuidof(SoapReader30));
// Connect the reader to the output stream of the connector
hr = Reader->Load(_variant_t((IUnknown*)Connector->OutputStream), "");

// Display the result
MSXML2::IXMLDOMElementPtr ptr = Reader->RpcResult->get_xml((BSTR*)&bstrXml);

But the value, which is coming in bstrXml is
<faultCode>soap:Server</faultCode>

The code on server is

C#:

[WebMethod]
public string GetFloors( string siteId )
{
return "tempString";
}

Please help

Thanks,
Nov 17 '05 #1
2 2058
It looks like you are using SOAP Toolkit. Just FYI, it is deprecated and
after March 31, 2005 it is not supported. Take a look on some migration
guides here
http://msdn.microsoft.com/webservice...kmigration.asp.

As for your error, the problem seems to be that you are not defining
namespace for your web service. Just type http://tempuri.org/GetFloors in
IE, and it will give you an error page with explanation of what to do about
it.
If you are using VS2003, please take a look on this section of documentation
http://msdn.microsoft.com/library/de...anagedcode.asp.
It has some good walkthroughs and samples of both web service providers and
consumers.
As for C++ story, in native code the best solution for web service client is
to use ATL Server. For example, you may take a look on SOAP Transport sample
http://msdn.microsoft.com/library/de...portsample.asp
It contains both a very simple web service and a very simple client for it.
As for managed code built with C++, the story is pretty much the same as for
C# or VB. If you use IDE, you need to add web reference to web service into
your project and then use a proxy class created for you by the IDE.

Hope that helps.
--
Nikola Dudar
Visual C++; // Program Manager
This posting is provided "AS IS" with no warranties, and confers no rights.

"Reshma Prabhu" <Re**********@discussions.microsoft.com> wrote in message
news:3A**********************************@microsof t.com...
Hello,

I have created an web service in C# and accessing it thrugh C++ code.
But when i make a call through the client, the parameter does not reach
the
server but it does not show any error code on client.

I have attached my code with this

Connector.CreateInstance(__uuidof(HttpConnector30) );
Connector->Property["EndPointURL"] = [WEbServiceURLname]
HRESULT hr = Connector->Connect();

// Begin message
Connector->Property["SoapAction"] = "http://tempuri.org/GetFloors";
hr =Connector->BeginMessage();

// Create the SoapSerializer
Serializer.CreateInstance(__uuidof(SoapSerializer3 0));

// Connect the serializer to the input stream of the connector
Serializer->Init(_variant_t((IUnknown*)Connector->InputStream));

// Build the SOAP Message
hr= Serializer->StartEnvelope("","NONE","");
hr = Serializer->StartBody("NONE");
hr = Serializer->StartElement("GetFloors","","NONE","");

hr = Serializer->StartElement("siteId","","NONE","");
Serializer->WriteString("1");
hr = Serializer->EndElement();

hr = Serializer->EndElement();
hr = Serializer->EndBody();
hr = Serializer->EndEnvelope();

// Send the message to the web service
hr = Connector->EndMessage();

// Let us read the response
hr = Reader.CreateInstance(__uuidof(SoapReader30));
// Connect the reader to the output stream of the connector
hr = Reader->Load(_variant_t((IUnknown*)Connector->OutputStream), "");

// Display the result
MSXML2::IXMLDOMElementPtr ptr =
Reader->RpcResult->get_xml((BSTR*)&bstrXml);

But the value, which is coming in bstrXml is
<faultCode>soap:Server</faultCode>

The code on server is

C#:

[WebMethod]
public string GetFloors( string siteId )
{
return "tempString";
}

Please help

Thanks,

Nov 17 '05 #2
> As for managed code built with C++, the story is pretty much the same as for
C# or VB. If you use IDE, you need to add web reference to web service into
your project and then use a proxy class created for you by the IDE.


i've had some problems with that route that i'd like to solve. see my
"Subject: Sites web service in C++" post in
microsoft.public.sharepoint.portalserver.developme nt
Nov 17 '05 #3

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

Similar topics

1
by: pronto | last post by:
Hi guys. I made Web Service (C#) and running it on my localhost (Win2000). It does work from IE and from C# client application. Now I'm trying to create application with Visual C++ 6 and get...
5
by: OpticTygre | last post by:
What is the best way that anyone has found to capture errors inside a windows service? It's pointless to use compilation constants, as you can't "debug" a service very easily, and you can't pass...
7
by: Jorgen Haukland, Norway | last post by:
Hi, I have created a Java webservice which runs in IBM WebSphere appserver. I take the WSDL-file and create a VS.NET WinForm application and calls the service running on my PC and everything...
5
by: csgraham74 | last post by:
Hi guys, Basically i have been developing in dotnet for a couple of years but ive had a few issues in regards to error handling. For example - I have a class that i call passing in a stored...
10
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication...
2
by: Hakan Örnek | last post by:
Hi , I want to parameter passing to my windows sevice. I call service commands like this ; '------------------------------------------------------------ Dim sc As ServiceController sc = New...
18
by: E11esar | last post by:
Hi there. I have written an asp.net / c# web application that subscribes to a web service and all works fine. If I then enclose the page functionality of the web page within AJAX tab and accordion...
3
by: cmrhema | last post by:
Hi, Kindly excuse if I am posting in the wrong place. I am using Visual Studio 2008, .net framework 3.5, asp.net , c# and sql server 2005. I am supposed to pass stored procedures from client...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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,...

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.