Credentials from InfoPath form to Web Service - InfoPath Dev
in

InfoPath Dev

Credentials from InfoPath form to Web Service

Last post 04-09-2007 06:24 AM by madhuri. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 11-23-2005 11:45 AM

    Credentials from InfoPath form to Web Service

    Is there any way to pass credentials to web service from InfoPath Code Behind file. Like we do from aspx page like this to pass credentials to web service.

    I am using Windows Integrated Authentication for Web Services.


    I know that we do like this from aspx page to pass credentials to web service.


    TimeSheet.TimeSheetService tsService = new TimeSheet.TimeSheetService();
    tsService.PreAuthenticate =true;
    tsService.Credentials = ystem.Net.CredentialCache.DefaultCredentials;

    dgTimeSheetDtls.DataSource = tsService.TimeSheetDetailsSearch( Convert.ToInt32(selectedYear), Convert.ToInt32(selectedMonth), selectedEmployeeNumber );


    When we use web service adapter from InfoPath code behind code looks like this. Here how should we pass credentials.


    WebServiceAdapter2 oTSSAdapter =(WebServiceAdapter2) thisXDocument.DataAdapters["TimeSheetStatusSearch"];
    oTSSAdapter.Query();


    Because I already logged in to system using windows Authentication, credentials will be already present, but I am not sure how to pass these credentials to Web Service Adapter.

    Quick help is really appreciated.

    Thanks,
    Amar

  • 11-23-2005 12:13 PM In reply to

    Re: Credentials from InfoPath form to Web Service

    its as you specified: use DefaultCredentials:

    oTSSAdapter.Credentials = CredentialCache.DefaultCredentials;

    Anders




  • 12-30-2005 05:43 AM In reply to

    Re: Credentials from InfoPath form to Web Service

    There is no Credentials property for Web Service Adapter. Can you please tell me is there any way to set the Default Credentials.

    THanks,
    Amar
  • 01-02-2006 05:57 PM In reply to

    Re: Credentials from InfoPath form to Web Service

    Hi Amar,
    I will ask Jim to respond to this.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 01-03-2006 08:32 AM In reply to

    Re: Credentials from InfoPath form to Web Service

    Thanks Patrick

    Amar
  • 04-06-2007 08:22 AM In reply to

    Re: Credentials from InfoPath form to Web Service

    So what is the answer?
    I m' having the same problem, ending to an HTTP 401: Unauthorized error.
  • 04-09-2007 06:24 AM In reply to

    Re: Credentials from InfoPath form to Web Service

    Hi

    Just look at this link.This might help you
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=652&SearchTerms=HTTP,401
    Madhuri
    http://www.ggktech.com
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.