CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Jun 2007
    Posts
    6

    C++ Web Service Authentication Problem

    Hello Everyone!
    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> >

    with

    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:
    Code:
         PatAuskunft::CPatAuskunft* service;
         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
    Any Idea is welcome!
    Thank you in Advance

    Marc
    Last edited by MaYo; May 12th, 2009 at 02:44 AM. Reason: Bad Code Tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured