PC Review


Reply
Thread Tools Rate Thread

How to connect to web service from C++

 
 
Manjunath.M
Guest
Posts: n/a
 
      28th Apr 2008
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 C++ code is passing the empty value to the Web service
because whn 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
 
Reply With Quote
 
 
 
 
Mr. Arnold
Guest
Posts: n/a
 
      28th Apr 2008

"Manjunath.M" <(E-Mail Removed)> wrote in message
news:fa90c17a-53b3-4987-b564-(E-Mail Removed)...

There is a MS.Public.DotnetWebservice forum.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PPC Connect to Web Service Error Sam Microsoft Dot NET Compact Framework 0 13th Jun 2010 05:28 PM
How to connect to a service Patrick Sona Microsoft Dot NET Framework 3 14th Jul 2008 08:51 AM
Windows The Windows Media Connect Service service failed to start due to the following error: Donald Bock Windows XP Help 1 5th Oct 2007 12:28 AM
can't connect to fax service Tarvirdi Microsoft Windows 2000 Fax 1 21st May 2006 03:55 PM
How to connect to a service? Vincent Finn Microsoft Dot NET 4 9th Dec 2004 05:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:04 PM.