WebService SQL connection problems - InfoPath Dev
in

InfoPath Dev

WebService SQL connection problems

Last post 03-27-2006 10:32 AM by dmhollis. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-15-2006 01:00 PM

    WebService SQL connection problems

    I'm having trouble submitting an Infopath form via my newly created WebService. Here's the error I keep getting when I submit:

    The SOAP response indicates that an error occurred on the server:

    System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Login failed for user 'dhollis2'.
    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.SqlClient.SqlConnection.Open()
    at InfopathService1.Service1.UpdateCustomers(DataSet dsUpdated) in c:\inetpub\wwwroot\infopathservice1\service1.asmx.cs:line 177
    --- End of inner exception stack trace ---

    I originally had integrated security=sspi but found a blog that told me what to do for that.... my login is the SQL db owner and has admin rights on the machine and I have made the Trusted Connection=False, but am still having no luck getting past this error. Any thoughts out there?

    Thanks,

    dmhollis
  • 03-15-2006 06:14 PM In reply to

    Re: WebService SQL connection problems

    Is this error specific to infopath? Meaning have tried running this web service in debug mode within visual studio? Looks like you may have a connection string issue. Would you mind posting your connection string? Also ensure that you SQL Server DB allows for SQL server login accounts (Enterprise Manager >> right click DB instance >> properties >> security tab >> Authentication check "SQL Server and Windows").
    Jason
    http://www.k2distillery.com/
  • 03-20-2006 06:26 AM In reply to

    Re: WebService SQL connection problems

    I got past my connection error.... I included an Identity impersonate="true" tag in the web service web.config file and now it submits. However, I'm still not getting any data updated in my database. Now I seem to need some work on my dataset. Can I submit the entire form (as one of the options suggests?) I have tried submitting my fields as a group to the dataset and that isnn't working.
    dmhollis
  • 03-22-2006 06:30 AM In reply to

    Re: WebService SQL connection problems

    This is how I do it. In my web service method I provide parameters like this:

    Public Function UpdateCategory(ByVal Description As String, ByVal Active As Boolean, ByVal CatID As Integer) As Boolean

    There are two ways to submit via Web Service: InfoPath Data Connections Or Managed Code (Visual Studio)...

    If using InfoPath Data Connections you Add your Web Service as a Submit Data Type. You map your Web Service Method parameters to the Form Template Main Data Source fields. Then you can add a button on the form and give it a Submit Action with the Data Connection you just created.

    If you are using Managed Code you can do something like this in a Button Submit_OnClick event (VB.NET):

    Try
    Dim ws as New YourWebService.Service
    ws.URL = getCurrentServiceEnvironment() 'a function
    ws.Credentials = getUserCredentials() 'a function
    ws.UpdateCategory(strDescription, blnActive, intCatID)
    Catch ex as exception
    'exception error handler here
    End Try

    That's it in a nutshell. If you need further examples let us know and we can point you to some better documentation than mine here in this forum.
  • 03-27-2006 10:32 AM In reply to

    Re: WebService SQL connection problems

    Thanks for the post Wayne,

    That got me started in the right direction. My Web method parameters were not correct...now I think I'm on the right track.

    dmhollis
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.