CodeSmith Community
Your Code. Your Way. Faster!

WebService return no data?

Latest post 02-20-2007 1:10 PM by bgjohnso. 5 replies.
  • 02-17-2007 12:52 PM

    • lin2000y
    • Top 100 Contributor
    • Joined on 11-14-2005
    • Posts 49
    • Points 1,163

    WebService return no data?

    when finished, i try to use webservice as the provider, and there is no any exception throwed but it can't return any data? the insert method act correctly. the data has into the DB. But still can't no give the data list?

    and nothing is changed except to uncomment the webservice provider in the web.config!

    Filed under:
    • Post Points: 65
  • 02-19-2007 10:43 AM In reply to

    Re: WebService return no data?

    try using a soap monitor or invoking the web method directly just to ensure that it's working properly.  Let us know how that goes, and we'll go from there.

    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 5
  • 02-20-2007 6:08 AM In reply to

    • lin2000y
    • Top 100 Contributor
    • Joined on 11-14-2005
    • Posts 49
    • Points 1,163

    Re: WebService return no data?

    the respone as following , the main meaning is about the 'LIN-MASTER\ASPNET'  user login failed:

    ResponseCode: 500 (Internal Server Error)
    Connection:close
    Content-Length:1934
    Cache-Control:private
    Content-Type:text/xml; charset=utf-8
    Date:Tue, 20 Feb 2007 11:56:22 GMT
    Server:Microsoft-IIS/5.1
    X-AspNet-Version:2.0.50727
    X-Powered-By:ASP.NET

    <?xml version="1.0" encoding="utf-16"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
        <soap:Fault>
          <faultcode>soap:Server</faultcode>
          <faultstring>System.Web.Services.Protocols.SoapException: 服务器无法处理请求。 ---&gt; System.Data.SqlClient.SqlException: 用户 'LIN-MASTER\ASPNET' 登录失败。
       在 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       在 System.Data.SqlClient.SqlConnection.Open()
       在 Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection()
       在 Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DbCommand command)
       在 football.Data.Utility.ExecuteReader(Database database, DbCommand dbCommand) 位置 G:\网站\足球综合站\testNettiers\football.Data\Utility.cs:行号 357
       在 football.Data.SqlClient.SqlAdvanceTypeProviderBase.GetAll(TransactionManager transactionManager, Int32 start, Int32 pageLength, Int32&amp; count) 位置 G:\网站\足球综合站\testNettiers\football.Data.SqlClient\SqlAdvanceTypeProviderBase.generated.cs:行号 460
       在 football.Data.Bases.EntityProviderBaseCore`2.GetAll(Int32 start, Int32 pageLength, Int32&amp; count) 位置 G:\网站\足球综合站\testNettiers\football.Data\Bases\EntityProviderBaseCore.generated.cs:行号 131
       在 FootballServices.AdvanceTypeProvider_GetAll(Int32 start, Int32 pageLength, Int32&amp; count) 位置 c:\NetTiers\football\WebServices\FootballServices.asmx:行号 6439
       --- 内部异常堆栈跟踪的结尾 ---</faultstring>
          <detail />
        </soap:Fault>
      </soap:Body>
    </soap:Envelope> 

     

    • Post Points: 35
  • 02-20-2007 10:53 AM In reply to

    • bgjohnso
    • Top 10 Contributor
    • Joined on 09-15-2005
    • Spokane, WA
    • Posts 767
    • Points 22,665

    Re: WebService return no data?

    You are using integrated security, and it looks like the ASPNET account is not able to login to your SQL Server.  When you switched to the web service, the database calls are now made on behalf of the web service, specifically the ASP.Net process.  As I see it you have several options:

    1.  Add the ASPNET account as a valid user in your database

    2.  Change the account that the web service is using to access the database.  You can do this by creating a separate app pool is IIS and changing the identity to something that can login to your database.

    3.  Change your web.config in the web service to use a SQL login rather than integrated security.

    Ben Johnson
    ------------------------------
     Member of the .NetTiers team
     Visit http://www.nettiers.com
    ------------------------------

    • Post Points: 5
  • 02-20-2007 1:03 PM In reply to

    • lin2000y
    • Top 100 Contributor
    • Joined on 11-14-2005
    • Posts 49
    • Points 1,163

    Re: WebService return no data?

    i think you're right,

    but another question: why i can use the insert method correctly but the select method can't?

    Thanks!

    • Post Points: 5
  • 02-20-2007 1:10 PM In reply to

    • bgjohnso
    • Top 10 Contributor
    • Joined on 09-15-2005
    • Spokane, WA
    • Posts 767
    • Points 22,665

    RE: WebService return no data?

    Did the insert method work using the Web Service provider?  ?  I assumed that you did the insert using the standard SQL Provider.  Is this a web application or a win forms application?  If it’s a win forms application, the connection will be made using your credentials.  If it’s a web app running in the development web server (not IIS), then it also runs using your credentials and not the ASPNET account.  The web service application is ran through IIS which by default will try and connect with the ASPNET account.

    Ben Johnson
    ------------------------------
     Member of the .NetTiers team
     Visit http://www.nettiers.com
    ------------------------------

    • Post Points: 5
Page 1 of 1 (6 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems