473,288 Members | 1,745 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,288 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 2056
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.