May 12th, 2009, 03:34 AM
C++ Web Service Authentication Problem
Fist of all: Very Nice Forum! Found a lot of Help here already, but this time I have to post my Problem, because I could not find a solution by searching the forum.
Here we go:
I have a Visual C++ Application that uses a SOAP Web-Service. I addeed the Web-Service in Visual Studio 2003 with "AddWebReference" and it generated some Files for me, most importent the Header file for the Web Service.
The web Service needs User and Password Information in order to accept my request.
I realised it by exchanging the
template <typename TClient = CSoapSocketClientT<CSoapClient> >
template <typename TClient = CSoapSocketClientT<CSoapWininetClient> >
so it adds the NT Username and Password in the request (took a few hours of searching the web already ;-) ).
The Application works fine, if the NT User is registered at the WebService, but now the Problem is, that I have to use a so calles ServiceUser that is different from the NT-User.
Can anybody help me, how to pass a seperate Username and Password to the Webservice??
I know that there is a possibility in C# with some kind of SetCredentials, but I can not restart the whole Programming from scratch in C#! No Idea how this might work in C++!
Any Help appreciated!
Another Problem is, that I do not have Access to the Web Service from my Computer, so I can not easily re-register the Web Reference, but have to go with the Files, that I already got created from the Wizard.
The Code acessing the Webservice looks like this:
Any Idea is welcome!
service=new PatAuskunft::CPatAuskunft(); //Create the Service Instance
url=m_Ini->GetValue("URL","PatAuskunft"); //Get URL from INI File
service->SetUrl(url.data()); //Set URL of Service
service->GetPatient(call,patient,&result); //Access the Service
Thank you in Advance
Last edited by MaYo; May 12th, 2009 at 03:44 AM.
Reason: Bad Code Tags
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!