Include credentials in the SOAP Header? - InfoPath Dev
in

InfoPath Dev

Include credentials in the SOAP Header?

Last post 09-14-2012 09:38 AM by omatase. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-07-2007 07:05 AM

    Include credentials in the SOAP Header?

    Hi, I am trying to connect to a web service that requires me to pass the user's credentials in the SOAP Header as follows:

    <soap:Header>
    <Auth xmlns="http://namespace.com">
    <Username>username</Username>
    <Password>password</Password>
    </Auth>
    </soap:Header>


    Is there any way to do this in InfoPath?

    Thanks!
  • 02-10-2007 04:36 PM In reply to

    Re: Include credentials in the SOAP Header?

    Hi PDJohnson!
    We should know the answer to this. I've asked Jim to respond.
    Patrick Halstead
    Project Manager at Qdabra
  • 02-11-2007 12:50 PM In reply to

    • jimbob
    • Top 500 Contributor
    • Joined on 11-26-2004
    • USA
    • Posts 32

    Re: Include credentials in the SOAP Header?

    InfoPath does not support accessing the headers, but you can add a web reference to your InfoPath form in Visual Studio and call within your form code.

    This is a sample using a webservice defined method with

    MyWebService.Auth hdr = new global::InfoPathProject2.MyWebService.Auth();
    hdr.Username = "Fred";
    hdr.Password = "Barney";

    MyWebService.AdminService svc = new global::InfoPathProject2.MyWebService.AdminService();
    svc.AuthValue = hdr;
    svc.Credentials = System.Net.CredentialCache.DefaultCredentials;
    string data = svc.MyWebMethod();

    Jim Cantwell
    InfoPathDev - Redmond
  • 02-12-2007 01:36 PM In reply to

    Re: Include credentials in the SOAP Header?

    Thanks Jim, I'll give this a try. Do you know if this is supported in InfoPath 2007 or if there are there any plans to add support for this in a later version? It seems like a pretty common thing (at least in the Web Services I've tried to use that require authentication) and having to build the web service request myself in Visual Studio in these cases requires a lot more work...

    Anyway, thanks again for your help.

    Paul
  • 09-14-2012 09:38 AM In reply to

    Re: Include credentials in the SOAP Header?

    Is this still the best way to do this? I am using InfoPath 2010 and am having a hard time getting authentication passed in the SOAP header. I have created a Stack Overflow but I don't think that I'll get a lot of traffic on it. Reading your code I am having a hard time determining what it's doing. Does global::InfoPathProject2.MyWebService represent a "Web Reference"?
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.