473,387 Members | 1,502 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,387 software developers and data experts.

How to connect to web service from C++

Hi,

I have created a simple Web service with only one function, which
takes only one parameter.
Below is the function from Web service
[WebMethod]
public string HelloWorld(string input)
{
return "Hello World"+input+"Here";
}
I am trying to access to this function from C++.Below is the Code

ISoapSerializerPtr Serializer;
ISoapReaderPtr Reader;
ISoapConnectorPtr Connector;
// Connect to the service
Connector.CreateInstance(__uuidof(HttpConnector));

Connector->Property["EndPointURL"] = "http://localhost/
FinalService/
Service1.asmx";
Connector->Connect();
// Begin message
Connector->Property["SoapAction"] = "http://tempuri.org/
HelloWorld";
Connector->BeginMessage();
// Create the SoapSerializer
Serializer.CreateInstance(__uuidof(SoapSerializer) );
// Connect the serializer to the input stream of the connector
Serializer->Init(_variant_t((IUnknown*)Connector-
>InputStream));
// Build the SOAP Message

Serializer->startEnvelope("","","");
Serializer->startBody("");
Serializer->startElement("HelloWorld","http://tempuri.org/
HelloWorld","","m");
Serializer->startElement("input","","","");
Serializer->writeString( "Test");
Serializer->endElement();
Serializer->endElement();
Serializer->endBody();
Serializer->endEnvelope();

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

But here the C++ code is passing the empty value to the Web service
because when I display
the o/p is "Hello WorldHere".
I am expecting "Hello WorldTestHere". but it is not displaying.

Please can any one tell me how to pass the parameter value?

Thanks,
Manjunath.M
Jun 27 '08 #1
0 2651

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

Similar topics

20
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
0
by: Brad Clements | last post by:
I'm trying to get a simple service to work with py2exe and python 2.3 I get this error when I start it (after registering it) The description for Event ID ( 240 ) in Source ( UMXWIN32SVC )...
0
by: Jim | last post by:
I'm working on my first .net project using c#. I've been using activex controls embedded in a web page and wanted to do the same in ..net. My approach has been to create a windows control library...
1
by: Mike Stephens | last post by:
I would like to write a service app, a simple application that runs in the background and does its thing, and not necessarily running on the local machine. This service app will not have any GUI...
0
by: Wali Khan | last post by:
HI, I have developed a window service in VB.NET to connect to VSS and some operations are followed. Problem is i am unable to connect to VSS when i install the Service.When i m debugging as an...
0
by: Moe | last post by:
It seems that some recent Microsoft Windows 2000 Service Pack updates has caused the configuration export function in IBM DB2 connect Ver. 7.2 to malfunction by exporting a blank file. The...
0
by: jordo | last post by:
I have an asp.Net app that connects to the WSS 2.0 list web service. I'm having issues with IIS and .Net configurations and hope that someone can help me. My ideal configuration is: asp.net:...
10
by: blurryimage | last post by:
Ok guys I have racked my brain on this one. I have a vb .net service installed on a win2k server. I am trying to get it to connect to sql 2000 box but I get this error: An error has occurred...
3
by: arasub | last post by:
ep 20, 2007 11:25:57 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found...
1
by: Manjunath.M | last post by:
Hi, I have created a simple Web service with only one function, which takes only one parameter. Below is the function from Web service public string HelloWorld(string input) { return "Hello...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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,...
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...

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.