473,657 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

gSoap authentication from C# Soap Client

Hi,

I have a gSoap Web Service written using C++, it uses SOAP username and
password authentication.

I also have a C# form client consuming the web service, all this was working
fine until I added the authentication on the server, now I can not get the
client to authenticate. Can someone tell me how to add authentication info
to the SOAP message posted from the C# SOAP client.
here is some code I call to initilize the soap call from the C# form.

public partial class MyForm : Form
{
public MyForm()
{
InitializeCompo nent();

Service service = new Service();
}
...
...
...
Thanks,
Enda Manni

Jan 11 '08 #1
2 8451
Enda,

How did you add authentication on the server? Are you using message
security or transport security? In other words, are you counting on using
the authentication provided by the HTTP transport (in the headers) or is it
embedded in the message?

This is assuming, of course, you are using HTTP as the transport
mechanism for your SOAP calls.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Enda Manni" <en*********@ho tmail.comwrote in message
news:E7******** *************** ***********@mic rosoft.com...
Hi,

I have a gSoap Web Service written using C++, it uses SOAP username and
password authentication.

I also have a C# form client consuming the web service, all this was
working fine until I added the authentication on the server, now I can not
get the client to authenticate. Can someone tell me how to add
authentication info to the SOAP message posted from the C# SOAP client.
here is some code I call to initilize the soap call from the C# form.

public partial class MyForm : Form
{
public MyForm()
{
InitializeCompo nent();

Service service = new Service();
}
..
..
..
Thanks,
Enda Manni

Jan 11 '08 #2
Hi,

I am using SOAP authentication, with a username and password. Here is the
soap request I would like to receive at the web service.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap .org/soap/encoding/"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:ns1="http ://localhost:80/Service.wsdl"
xmlns:ns2="http ://tempuri.org/ns1.xsd"><SOAP-ENV:Body><ns2:g etBatteryLevel> </ns2:getBatteryL evel></SOAP-ENV:Body></SOAP-ENV:Envelope>PO ST
/ HTTP/1.1
Host: localhost:8080
User-Agent: gSOAP/2.7
Content-Type: text/xml; charset=utf-8
Content-Length: 489
Connection: close
Authorization: Basic dXNlcjpwYXNz
SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap .org/soap/encoding/"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:ns1="http ://localhost:8080/Service.wsdl"
xmlns:ns2="http ://tempuri.org/ns1.xsd"><SOAP-ENV:Body><ns2:G etDBOldestPendi ngRow><iMaxRows >100</iMaxRows></ns2:GetDBOldest PendingRow></SOAP-ENV:Body></SOAP-ENV:Envelope>
Is there a way I can get this info into the C# client request?

Thanks,
Enda

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote in
message news:eX******** ******@TK2MSFTN GP02.phx.gbl...
Enda,

How did you add authentication on the server? Are you using message
security or transport security? In other words, are you counting on using
the authentication provided by the HTTP transport (in the headers) or is
it embedded in the message?

This is assuming, of course, you are using HTTP as the transport
mechanism for your SOAP calls.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Enda Manni" <en*********@ho tmail.comwrote in message
news:E7******** *************** ***********@mic rosoft.com...
>Hi,

I have a gSoap Web Service written using C++, it uses SOAP username and
password authentication.

I also have a C# form client consuming the web service, all this was
working fine until I added the authentication on the server, now I can
not get the client to authenticate. Can someone tell me how to add
authenticati on info to the SOAP message posted from the C# SOAP client.
here is some code I call to initilize the soap call from the C# form.

public partial class MyForm : Form
{
public MyForm()
{
InitializeCompo nent();

Service service = new Service();
}
..
..
..
Thanks,
Enda Manni

Jan 14 '08 #3

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

Similar topics

0
2375
by: Eric Dennison | last post by:
I've been playing around with NuSOAP as a PHP based SOAP server and client. Works great! Now I'm trying to write (using gSOAP) a simple C/C++ based client to test against my simple SOAP server. Not so easy. My client forms the request nicely, and I see with my packet sniffer that the SOAP server is producing the expected response message, but all I can get my client to do is return a NULL pointer (at least I don't have any errors!).
0
4016
by: Torsten Mueller | last post by:
Does anybody use gSOAP 2.7 in a multithreaded environment? Are the gSOAP functions (especially soap_serve) really thread safe? I use pthreads on Solaris. The main function has a loop like this: while (true) { int r=soap_accept(soap); if (r>=0) { pthread_create(&tid,NULL,
0
1805
by: Naoum Naoumov | last post by:
So I have a gsoap server and a PHP soap client and I am trying to return a list (vector) of objects to the PHP client. However, the client seems to only store the last element of the array ... Any ideas on how to solve that? $rs = $client->get( new SoapParam($request, "request") , new SoapParam($response, "response" ) ); print_r($rs); REQUEST: <?xml version="1.0" encoding="UTF-8"?<SOAP-ENV:Envelope
5
12708
by: ayaz.usman | last post by:
Hi, I've built a web services proxy server, in C# using wsdl.exe, by importing wsdl. Howeever, when I go to : http://localhost/sample.asmx?wsdl, they wsdl there does not match the wsdl I fed into wsdl.exe. Why is this? Is there something I can do to make the input and output wsdl match?
1
13946
by: cherman | last post by:
I don't know if anybody here worked with gSOAP software, but I do hope so. I've made some simple server app using gSOAP example. Everythig worked fine until I switched it into ssl mode. Using it results in huge memory leak. My question is if anybody has any idea what am I doing wrong or what am I missing? Here is some of my code: ----------------------------------------------------------------------------------------------------- ...
0
2699
by: sumeta | last post by:
Hello Everyone , i m a fresher nd have to Develop TR-069 protocol (CPE WAN Management Protocol) using gSOAP toolkit , in c/c++ in Linux .. CPE WAN Management Protocol , intended for communiction between CPE and Auto configuration server . the connection must use HTTP1.1 GET requet and in turn must receive response as "200(OK)" or "204(NO-Content) HTTP code .. nd TR-069 wants .. sending HTTP response from ACS containing a...
0
1650
dav01it
by: dav01it | last post by:
Does someone have experience with gSoap and .NET webservices? I've build a .NET webservice that works very well but only with .NET clients. Creating a client with gsoap 7.10 gives errors: (...) Tags 'q1:FCKLoginResponse' and 'q4:FCKLoginResponse' match but namespaces differ Receiving SOAP Fault Error: soap_get_soapfault() failed. Is this a SOAP message at all? Using different version of gsoap gives different results!
4
12035
by: gcharbon | last post by:
Hi community, I have a problem with a Soap client written in php. I have a local server (coded in c and a client in c too, it works fine), but i want to test client in php, and i have an error (I'm not sure to understand it...) : SoapFault exception: Method 'ns1:getMetadataRequest' not implemented: method name or namespace not recognized in beta_2/soap.php:26 Stack trace: #0 /root/src/rxtxws/beta_2/soap.php(26):...
0
3383
by: leon70 | last post by:
Hi Group, I built a gSoap 2.7.11 Web services client in C++ on AIX and have got it talking to the remote service. The service is sending back an array of objects to my client but the client is unable to decode it. The client seems to be having a problem with the "item" tag element that is used to wrap the sequence of array objects. The SOAP call returns a SOAP_OK - no exception or error returned to the client. The returned XML...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6163
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.