Related
I'm running Rider 2019.3.1 on macOS 10.15.2, and when I try to install a NuGet package, I get an error like the following (I have removed the address of our private repository):
Failed to retrieve information about 'AWSSDK.StepFunctions' from remote source 'https://<private repo>/api/nuget/nuget/FindPackagesById()?id='AWSSDK.StepFunctions'&semVerLevel=2.0.0'.
NuGet.Protocol.Core.Types.FatalProtocolException: Failed to retrieve information about 'AWSSDK.StepFunctions' from remote source 'https://<private repo>/api/nuget/nuget/FindPackagesById()?id='AWSSDK.StepFunctions'&semVerLevel=2.0.0'. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode () [0x00040] in <92622ed7863541938d6ad8728c1e890c>:0
at NuGet.Protocol.HttpSource+<>c__DisplayClass14_0`1[T].<GetAsync>b__0 (System.Threading.CancellationToken lockedToken) [0x003e8] in <3337e34b437e4961a8f2de48cf2685ed>:0
at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T] (System.String filePath, System.Func`2[T,TResult] action, System.Threading.CancellationToken token) [0x00212] in <2613e7f2f62d4d78a9ca66443392e7f5>:0
at NuGet.Protocol.HttpSource.GetAsync[T] (NuGet.Protocol.HttpSourceCachedRequest request, System.Func`2[T,TResult] processAsync, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x000e7] in <3337e34b437e4961a8f2de48cf2685ed>:0
at NuGet.Protocol.RemoteV2FindPackageByIdResource.FindPackagesByIdAsyncCore (System.String id, NuGet.Protocol.Core.Types.SourceCacheContext cacheContext, NuGet.Common.ILogger logger, System.Threading.CancellationToken cancellationToken) [0x002ac] in <3337e34b437e4961a8f2de48cf2685ed>:0
--- End of inner exception stack trace ---
at NuGet.Protocol.RemoteV2FindPackageByIdResource.FindPackagesByIdAsyncCore (System.String id, NuGet.Protocol.Core.Types.SourceCacheContext cacheContext, NuGet.Common.ILogger logger, System.Threading.CancellationToken cancellationToken) [0x00379] in <3337e34b437e4961a8f2de48cf2685ed>:0
at NuGet.Protocol.RemoteV2FindPackageByIdResource.GetPackageInfoAsync (System.String id, NuGet.Versioning.NuGetVersion version, NuGet.Protocol.Core.Types.SourceCacheContext cacheContext, NuGet.Common.ILogger logger, System.Threading.CancellationToken cancellationToken) [0x00096] in <3337e34b437e4961a8f2de48cf2685ed>:0
at NuGet.Protocol.RemoteV2FindPackageByIdResource.DoesPackageExistAsync (System.String id, NuGet.Versioning.NuGetVersion version, NuGet.Protocol.Core.Types.SourceCacheContext cacheContext, NuGet.Common.ILogger logger, System.Threading.CancellationToken cancellationToken) [0x000ea] in <3337e34b437e4961a8f2de48cf2685ed>:0
at NuGet.Commands.SourceRepositoryDependencyProvider.FindLibraryCoreAsync (NuGet.LibraryModel.LibraryRange libraryRange, NuGet.Protocol.Core.Types.SourceCacheContext cacheContext, NuGet.Common.ILogger logger, System.Threading.CancellationToken cancellationToken) [0x00166] in <ab830f5711cc4cd9b03b9e2396816a6c>:0
at NuGet.Commands.SourceRepositoryDependencyProvider+<>c__DisplayClass19_0.<FindLibraryAsync>b__0 () [0x0007f] in <ab830f5711cc4cd9b03b9e2396816a6c>:0
at NuGet.Commands.SourceRepositoryDependencyProvider.FindLibraryAsync (NuGet.LibraryModel.LibraryRange libraryRange, NuGet.Frameworks.NuGetFramework targetFramework, NuGet.Protocol.Core.Types.SourceCacheContext cacheContext, NuGet.Common.ILogger logger, System.Threading.CancellationToken cancellationToken) [0x00170] in <ab830f5711cc4cd9b03b9e2396816a6c>:0
at NuGet.DependencyResolver.ResolverUtility+<>c__DisplayClass9_1.<FindLibraryFromSourcesAsync>b__0 () [0x00075] in <77c53f42bb4c4dc991a34360aa339d88>:0
at NuGet.DependencyResolver.ResolverUtility.FindLibraryFromSourcesAsync (NuGet.LibraryModel.LibraryRange libraryRange, System.Collections.Generic.IEnumerable`1[T] providers, System.Func`2[T,TResult] action) [0x00160] in <77c53f42bb4c4dc991a34360aa339d88>:0
at NuGet.DependencyResolver.ResolverUtility.FindLibraryByVersionAsync (NuGet.LibraryModel.LibraryRange libraryRange, NuGet.Frameworks.NuGetFramework framework, System.Collections.Generic.IEnumerable`1[T] providers, NuGet.Protocol.Core.Types.SourceCacheContext cacheContext, NuGet.Common.ILogger logger, System.Threading.CancellationToken token) [0x00298] in <77c53f42bb4c4dc991a34360aa339d88>:0
at NuGet.DependencyResolver.ResolverUtility.FindPackageLibraryMatchAsync (NuGet.LibraryModel.LibraryRange libraryRange, NuGet.Frameworks.NuGetFramework framework, System.Collections.Generic.IEnumerable`1[T] remoteProviders, System.Collections.Generic.IEnumerable`1[T] localProviders, NuGet.Protocol.Core.Types.SourceCacheContext cacheContext, NuGet.Common.ILogger logger, System.Threading.CancellationToken cancellationToken) [0x002d9] in <77c53f42bb4c4dc991a34360aa339d88>:0
at NuGet.DependencyResolver.ResolverUtility.FindLibraryMatchAsync (NuGet.LibraryModel.LibraryRange libraryRange, NuGet.Frameworks.NuGetFramework framework, System.String runtimeIdentifier, System.Collections.Generic.IEnumerable`1[T] remoteProviders, System.Collections.Generic.IEnumerable`1[T] localProviders, System.Collections.Generic.IEnumerable`1[T] projectProviders, System.Collections.Generic.IDictionary`2[TKey,TValue] lockFileLibraries, NuGet.Protocol.Core.Types.SourceCacheContext cacheContext, NuGet.Common.ILogger logger, System.Threading.CancellationToken cancellationToken) [0x00354] in <77c53f42bb4c4dc991a34360aa339d88>:0
at NuGet.DependencyResolver.ResolverUtility.FindLibraryEntryAsync (NuGet.LibraryModel.LibraryRange libraryRange, NuGet.Frameworks.NuGetFramework framework, System.String runtimeIdentifier, NuGet.DependencyResolver.RemoteWalkContext context, System.Threading.CancellationToken cancellationToken) [0x000e0] in <77c53f42bb4c4dc991a34360aa339d88>:0
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode (NuGet.LibraryModel.LibraryRange libraryRange, NuGet.Frameworks.NuGetFramework framework, System.String runtimeName, NuGet.RuntimeModel.RuntimeGraph runtimeGraph, System.Func`2[T,TResult] predicate, NuGet.DependencyResolver.GraphEdge`1[TItem] outerEdge) [0x0020d] in <77c53f42bb4c4dc991a34360aa339d88>:0
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode (NuGet.LibraryModel.LibraryRange libraryRange, NuGet.Frameworks.NuGetFramework framework, System.String runtimeName, NuGet.RuntimeModel.RuntimeGraph runtimeGraph, System.Func`2[T,TResult] predicate, NuGet.DependencyResolver.GraphEdge`1[TItem] outerEdge) [0x00538] in <77c53f42bb4c4dc991a34360aa339d88>:0
at NuGet.Commands.ProjectRestoreCommand.WalkDependenciesAsync (NuGet.LibraryModel.LibraryRange projectRange, NuGet.Frameworks.NuGetFramework framework, System.String runtimeIdentifier, NuGet.RuntimeModel.RuntimeGraph runtimeGraph, NuGet.DependencyResolver.RemoteDependencyWalker walker, NuGet.DependencyResolver.RemoteWalkContext context, System.Threading.CancellationToken token) [0x000be] in <ab830f5711cc4cd9b03b9e2396816a6c>:0
at NuGet.Commands.ProjectRestoreCommand.TryRestoreAsync (NuGet.LibraryModel.LibraryRange projectRange, System.Collections.Generic.IEnumerable`1[T] frameworkRuntimePairs, NuGet.Repositories.NuGetv3LocalRepository userPackageFolder, System.Collections.Generic.IReadOnlyList`1[T] fallbackPackageFolders, NuGet.DependencyResolver.RemoteDependencyWalker remoteWalker, NuGet.DependencyResolver.RemoteWalkContext context, System.Boolean forceRuntimeGraphCreation, System.Threading.CancellationToken token, NuGet.Common.TelemetryActivity telemetryActivity) [0x00188] in <ab830f5711cc4cd9b03b9e2396816a6c>:0
at NuGet.Commands.RestoreCommand.ExecuteRestoreAsync (NuGet.Repositories.NuGetv3LocalRepository userPackageFolder, System.Collections.Generic.IReadOnlyList`1[T] fallbackPackageFolders, NuGet.DependencyResolver.RemoteWalkContext context, System.Threading.CancellationToken token, NuGet.Common.TelemetryActivity telemetryActivity) [0x002f1] in <ab830f5711cc4cd9b03b9e2396816a6c>:0
at NuGet.Commands.RestoreCommand.ExecuteAsync (System.Threading.CancellationToken token) [0x005c8] in <ab830f5711cc4cd9b03b9e2396816a6c>:0
at NuGet.Commands.RestoreRunner.ExecuteAsync (NuGet.Commands.RestoreSummaryRequest summaryRequest, System.Threading.CancellationToken token) [0x000c3] in <ab830f5711cc4cd9b03b9e2396816a6c>:0
at NuGet.Commands.RestoreRunner.CompleteTaskAsync (System.Collections.Generic.List`1[T] restoreTasks) [0x000ce] in <ab830f5711cc4cd9b03b9e2396816a6c>:0
at NuGet.Commands.RestoreRunner.RunWithoutCommit (System.Collections.Generic.IEnumerable`1[T] restoreRequests, NuGet.Commands.RestoreArgs restoreContext) [0x001db] in <ab830f5711cc4cd9b03b9e2396816a6c>:0
at NuGet.PackageManagement.DependencyGraphRestoreUtility.PreviewRestoreAsync (NuGet.PackageManagement.ISolutionManager solutionManager, NuGet.ProjectManagement.Projects.BuildIntegratedNuGetProject project, NuGet.ProjectModel.PackageSpec packageSpec, NuGet.ProjectManagement.DependencyGraphCacheContext context, NuGet.Commands.RestoreCommandProvidersCache providerCache, System.Action`1[T] cacheContextModifier, System.Collections.Generic.IEnumerable`1[T] sources, System.Guid parentId, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x001bd] in <f8f7798361a74e00b7ab7c2972093bf2>:0
at NuGet.PackageManagement.NuGetPackageManager.PreviewBuildIntegratedProjectActionsAsync (NuGet.ProjectManagement.Projects.BuildIntegratedNuGetProject buildIntegratedProject, System.Collections.Generic.IEnumerable`1[T] nuGetProjectActions, NuGet.ProjectManagement.INuGetProjectContext nuGetProjectContext, System.Threading.CancellationToken token) [0x004a7] in <f8f7798361a74e00b7ab7c2972093bf2>:0
at NuGet.PackageManagement.NuGetPackageManager.PreviewInstallPackageAsync (NuGet.ProjectManagement.NuGetProject nuGetProject, NuGet.Packaging.Core.PackageIdentity packageIdentity, NuGet.PackageManagement.ResolutionContext resolutionContext, NuGet.ProjectManagement.INuGetProjectContext nuGetProjectContext, System.Collections.Generic.IEnumerable`1[T] primarySources, System.Collections.Generic.IEnumerable`1[T] secondarySources, System.Threading.CancellationToken token) [0x001d7] in <f8f7798361a74e00b7ab7c2972093bf2>:0
at NuGet.PackageManagement.NuGetPackageManager.InstallPackageAsync (NuGet.ProjectManagement.NuGetProject nuGetProject, NuGet.Packaging.Core.PackageIdentity packageIdentity, NuGet.PackageManagement.ResolutionContext resolutionContext, NuGet.ProjectManagement.INuGetProjectContext nuGetProjectContext, NuGet.Protocol.Core.Types.PackageDownloadContext downloadContext, System.Collections.Generic.IEnumerable`1[T] primarySources, System.Collections.Generic.IEnumerable`1[T] secondarySources, System.Threading.CancellationToken token) [0x0009b] in <f8f7798361a74e00b7ab7c2972093bf2>:0
at NuGet.PackageManagement.NuGetPackageManager.InstallPackageAsync (NuGet.ProjectManagement.NuGetProject nuGetProject, NuGet.Packaging.Core.PackageIdentity packageIdentity, NuGet.PackageManagement.ResolutionContext resolutionContext, NuGet.ProjectManagement.INuGetProjectContext nuGetProjectContext, System.Collections.Generic.IEnumerable`1[T] primarySources, System.Collections.Generic.IEnumerable`1[T] secondarySources, System.Threading.CancellationToken token) [0x000d3] in <f8f7798361a74e00b7ab7c2972093bf2>:0
at JetBrains.ProjectModel.NuGet.Operations.NuGetInstallOperation+<>c__DisplayClass5_0.<InstallAsync>b__0 (NuGet.ProjectManagement.NuGetProject nuGetProject, System.Threading.CancellationToken token) [0x000a5] in <69ff65df27804523b892fa15354acdab>:0
at JetBrains.ProjectModel.NuGet.Operations.NuGetInstallOperation.InstallInternal (JetBrains.ProjectModel.IProject project, System.String packageId, System.String packgeUserStr, JetBrains.ProjectModel.NuGet.Configs.NuGetFeedContext feedContext, System.Int32 nestedLevel, JetBrains.ProjectModel.NuGet.Logging.NuGetNotificationMode mode, JetBrains.ProjectModel.NuGet.Operations.NuGetOperationReporter reporter, System.Func`3[T1,T2,TResult] nativeInstall) [0x003e6] in <69ff65df27804523b892fa15354acdab>:0
System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode () [0x00040] in <92622ed7863541938d6ad8728c1e890c>:0
at NuGet.Protocol.HttpSource+<>c__DisplayClass14_0`1[T].<GetAsync>b__0 (System.Threading.CancellationToken lockedToken) [0x003e8] in <3337e34b437e4961a8f2de48cf2685ed>:0
at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T] (System.String filePath, System.Func`2[T,TResult] action, System.Threading.CancellationToken token) [0x00212] in <2613e7f2f62d4d78a9ca66443392e7f5>:0
at NuGet.Protocol.HttpSource.GetAsync[T] (NuGet.Protocol.HttpSourceCachedRequest request, System.Func`2[T,TResult] processAsync, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x000e7] in <3337e34b437e4961a8f2de48cf2685ed>:0
at NuGet.Protocol.RemoteV2FindPackageByIdResource.FindPackagesByIdAsyncCore (System.String id, NuGet.Protocol.Core.Types.SourceCacheContext cacheContext, NuGet.Common.ILogger logger, System.Threading.CancellationToken cancellationToken) [0x002ac] in <3337e34b437e4961a8f2de48cf2685ed>:0
Running dotnet add package AWSSDK.StepFunctions -v 3.3.103.18 in the terminal successfully installs the package, and Rider sees the package as being installed when I switch back to it.
I was having a problem with this on 2019.3, and the patch fixed it in a previous project, but when I started a new one, the error came back. What gives?
EDIT: Here are the contents of ~/.nuget/NuGet/NuGet.Config:
<!-- Generated by ICA CLI -->
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="artifactory" value="https://<private repo bits>/api/nuget/nuget" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<packageSourceCredentials>
<artifactory>
<add key="Username" value="<username>" />
<add key="ClearTextPassword" value="<password>" />
</artifactory>
</packageSourceCredentials>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
</configuration>
And here are the contents of ~/.config/NuGet/NuGet.Config:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by ICA CLI -->
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="artifactory" value="https://<private repo bits>/api/nuget/nuget" />
</packageSources>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
</configuration>
I am trying to use SQLiteCodeFirst with Entity Framework 6.2 and VS2017 15.9.4 to create a simple database.
However the database does not create.
Here is the DbContext
public class HelloDbContext : DbContext
{
public HelloDbContext()
: base("name=ConnectionString")
{
}
public DbSet<Setting> Settings { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
var sqliteConnectionInitializer = new SqliteCreateDatabaseIfNotExists<HelloDbContext>(modelBuilder);
Database.SetInitializer(sqliteConnectionInitializer);
}
}
Here is the data entity class
public class Setting
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
public string Value { get; set; }
}
Here is the code that the exception occurs in
using (var ctx = new HelloDbContext())
{
try
{
var obj = new Setting { Name = "blue" };
ctx.Settings.Add(obj);
ctx.SaveChanges();
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
}
Here is app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)"
invariant="System.Data.SQLite.EF6"
description=".NET Framework Data Provider for SQLite (Entity Framework 6)"
type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite"
description=".Net Framework Data Provider for SQLite"
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
<entityFramework>
<providers>
<provider invariantName="System.Data.SQLite.EF6"
type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
<provider invariantName="System.Data.SqlClient"
type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite"
type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=c:\mydb.sqlite" providerName="System.Data.SQLite"/>
</connectionStrings>
</configuration>
Here is the exception
{System.Data.DataException: An exception occurred while initializing the database. See the InnerException for details. ---> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SQLite.SQLiteException: unable to open database file
at System.Data.SQLite.SQLite3.Open(String strFilename, String vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)
at System.Data.SQLite.SQLiteConnection.Open()
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.<Open>b__2()
at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.DbContextTransaction.EnsureOpenConnection()
at System.Data.Entity.DbContextTransaction..ctor(EntityConnection connection)
at System.Data.Entity.Database.BeginTransaction()
at SQLite.CodeFirst.SqliteInitializerBase`1.InitializeDatabase(TContext context)
at SQLite.CodeFirst.SqliteCreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
at System.Data.Entity.DbSet`1.Add(TEntity entity)
at HelloSQLite.Form1.button1_Click(Object sender, EventArgs e) in d:\dev\helloSQLite\HelloSQLite\Form1.cs:line 29}
[System.Data.DataException]: {System.Data.DataException: An exception occurred while initializing the database. See the InnerException for details. ---> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SQLite.SQLiteException: unable to open database file
at System.Data.SQLite.SQLite3.Open(String strFilename, String vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)
at System.Data.SQLite.SQLiteConnection.Open()
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.<Open>b__2()
at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.DbContextTransaction.EnsureOpenConnection()
at System.Data.Entity.DbContextTransaction..ctor(EntityConnection connection)
at System.Data.Entity.Database.BeginTransaction()
at SQLite.CodeFirst.SqliteInitializerBase`1.InitializeDatabase(TContext context)
at SQLite.CodeFirst.SqliteCreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
at System.Data.Entity.DbSet`1.Add(TEntity entity)
at HelloSQLite.Form1.button1_Click(Object sender, EventArgs e) in d:\dev\helloSQLite\HelloSQLite\Form1.cs:line 29}
_className: "System.Data.DataException"
_data: null
_dynamicMethods: null
_exceptionMethod: null
_exceptionMethodString: null
_helpURL: null
_HResult: -2146233087
_innerException: {System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SQLite.SQLiteException: unable to open database file
at System.Data.SQLite.SQLite3.Open(String strFilename, String vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)
at System.Data.SQLite.SQLiteConnection.Open()
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.<Open>b__2()
at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.DbContextTransaction.EnsureOpenConnection()
at System.Data.Entity.DbContextTransaction..ctor(EntityConnection connection)
at System.Data.Entity.Database.BeginTransaction()
at SQLite.CodeFirst.SqliteInitializerBase`1.InitializeDatabase(TContext context)
at SQLite.CodeFirst.SqliteCreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)}
_ipForWatsonBuckets: 18474291
_message: "An exception occurred while initializing the database. See the InnerException for details."
_remoteStackIndex: 0
_remoteStackTraceString: null
_safeSerializationManager: {System.Runtime.Serialization.SafeSerializationManager}
_source: null
_stackTrace: {sbyte[384]}
_stackTraceString: null
_watsonBuckets: null
_xcode: -532462766
_xptrs: 0
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
HResult: -2146233087
InnerException: {System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SQLite.SQLiteException: unable to open database file
at System.Data.SQLite.SQLite3.Open(String strFilename, String vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)
at System.Data.SQLite.SQLiteConnection.Open()
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.<Open>b__2()
at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.DbContextTransaction.EnsureOpenConnection()
at System.Data.Entity.DbContextTransaction..ctor(EntityConnection connection)
at System.Data.Entity.Database.BeginTransaction()
at SQLite.CodeFirst.SqliteInitializerBase`1.InitializeDatabase(TContext context)
at SQLite.CodeFirst.SqliteCreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)}
IPForWatsonBuckets: 18474291
IsTransient: false
Message: "An exception occurred while initializing the database. See the InnerException for details."
RemoteStackTrace: null
Source: "EntityFramework"
StackTrace: " at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)\r\n at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()\r\n at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)\r\n at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)\r\n at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)\r\n at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()\r\n at System.Data.Entity.Internal.InternalContext.Initialize()\r\n at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)\r\n at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()\r\n at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()\r\n at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)\r\n at System.Data.En
tity.Internal.Linq.InternalSet`1.Add(Object entity)\r\n at System.Data.Entity.DbSet`1.Add(TEntity entity)\r\n at HelloSQLite.Form1.button1_Click(Object sender, EventArgs e) in d:\\dev\\helloSQLite\\HelloSQLite\\Form1.cs:line 29"
TargetSite: {Void PerformInitializationAction(System.Action)}
WatsonBuckets: null
Here are the references
This looks like a permission issue
System.Data.SQLite.SQLiteException: unable to open database file
The database-file is set to c:\mydb.sqlite in app.config connectionString
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=c:\mydb.sqlite" providerName="System.Data.SQLite"/>
</connectionStrings>
Windows is kinda weird at times with files in the system-disk root (try creating a text-file in on system-disk root c:\ with the rightclick-menu-thingy).
You could change the filepath for the connectionString in app.config to a newly created folder, say c:\testing-stuffs\mydb.sqlite (im wildy guessing there is nothing created at c:\mydb.sqlite so there should be no file to move).
Severity Code Description Project File Line Suppression State
Error MSB4018 The "XamlCTask" task failed unexpectedly.
System.Runtime.Serialization.SerializationException: Type 'Xamarin.Forms.Xaml.XamlParseException' in Assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
Server stack trace:
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeMessageParts(ArrayList argsToSerialize)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage..ctor(IMethodReturnMessage mrm)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.SmuggleIfPossible(IMessage msg)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
C:\Users\bgogia.nuget\packages\xamarin.forms\3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets 104
xamarin.forms version is lastest from nuget
cleaned solution, deleted bin/obj, restarted IDE but no resolution
I did use SQL Server Management Studio Express (free edition) to create my DB, Visual Studio Community (free edition) to create a web service SOAP through ASP.net (the WS just have 1 web method when you click it then show 5 empty fields), then i ran my WS in VS through option Debug in the Solution Configuration menu, after that the page open and i did check that my method insert the data in my DB and until here everything was correct, the data was inserted in the proper columns.
My problem start when i build the android app, the app have 5 empty fields that the user will fill and then send the info to the WS and put the data in the DB, but show me the next error:
org.ksoap2.transport.HttpResponseException: HTTP request failed, HTTP status: 400
at org.ksoap2.transport.HttpTransportSE.call
I read every thread about this problem, but none of that info solve my problem, i tried to make another project with 3 different variations but none of them work, i changed the localhost for my local ip, use 10.0.2.2:port, i add at the end "?wsdl", etc, etc.
I used SOAPUI to connect to test my WS, but when i try to connect from whatever location says me to did not found the page. Then i realized that maybe my App doesn't work because the WS only works for me and for nobody else, and need to put my WS in a real domain or something like that.
I'm very noob in this world, but the real objective that i have is that my app can get/add data in a database on the internet, for the purpose that the users can see/add data, i dont know if this way is the correct for that goal.
Any advice is welcome, please i'm searching info since 3 days ago and i cannot solve this.
Thanks in advance!
My android code is below:
package com.example.ejembd2;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import android.os.AsyncTask;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
private TextView txtResultado;
private Button btnins;
private EditText txtTit;
private EditText txtDes;
private EditText txtAco;
private EditText txtPal;
private EditText txtFec;
private TextView txtResultado2;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
txtCodigo = (EditText) findViewById(R.id.txtReg);
txtNombre = (EditText) findViewById(R.id.txtVal);
txtResultado = (TextView) findViewById(R.id.txtResultado);
btnInsertar = (Button) findViewById(R.id.btnInsertar);
btnActualizar = (Button) findViewById(R.id.btnActualizar);
btnEliminar = (Button) findViewById(R.id.btnEliminar);
btnConsultar = (Button) findViewById(R.id.btnConsultar);
btnins = (Button) findViewById(R.id.InsEnBD);
txtTit = (EditText) findViewById(R.id.T);
txtDes = (EditText) findViewById(R.id.D);
txtAco = (EditText) findViewById(R.id.A);
txtPal = (EditText) findViewById(R.id.P);
txtFec = (EditText) findViewById(R.id.F);
txtResultado2 = (TextView) findViewById(R.id.txtResultado2);
btnins.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
String a = txtTit.getText().toString();
String b = txtDes.getText().toString();
String c = txtAco.getText().toString();
String d = txtPal.getText().toString();
String f = txtFec.getText().toString();
new insercion1().execute(a, b, c, d, f);
}
});
}
private class insercion1 extends AsyncTask<String,Integer,Boolean> {
#Override
protected Boolean doInBackground(String... params) {
String a = params[0];
String b = params[1];
String c = params[2];
String d = params[3];
String f = params[4];
boolean resul = true;
final String NAMESPACE = "http://proof.net/";
/*final String URL = "http://10.0.2.2:50490/ServicioWebSoap/ServicioClientes.asmx"; //cambio*/
final String URL = "http://10.0.2.2:50490/ServicioClientes.asmx";
final String METHOD_NAME = "NuevoEvento";
final String SOAP_ACTION = "http://proof.net/NuevoEvento";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("Titulo",a);
request.addProperty("Descripcion",b);
request.addProperty("Compania",c);
request.addProperty("Palabras",d);
request.addProperty("Fecha",f);
SoapSerializationEnvelope envelope =
new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpTransportSE transporte = new HttpTransportSE(URL);
try
{
transporte.call(SOAP_ACTION, envelope);
Log.v("prueba1", ">>>>>>>>>");
SoapPrimitive resultado_xml = (SoapPrimitive) envelope.getResponse();
String res = resultado_xml.toString();
//My code in the .asmx return 1 if a row was added to the Table.
if (!res.equals("1"))
resul = false;
}
catch(
Exception e
)
{
e.printStackTrace();
resul = false;
}
return resul;
}
protected void onPostExecute(Boolean result) {
if (result)
txtResultado.setText("Insertado OK");
else
txtResultado.setText("Error!");
}
}
}
EDIT1: WSDL (im only using the WebMethod "NuevoEvento")
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://proof.net/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://proof.net/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://proof.net/">
<s:element name="NuevoEvento">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Titulo" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Descripcion" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Compania" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Palabras" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Fecha" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="NuevoEventoResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="NuevoEventoResult" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ListadoEventos">
<s:complexType/>
</s:element>
<s:element name="ListadoEventosResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ListadoEventosResult" type="tns:ArrayOfEventos"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfEventos">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="Eventos" nillable="true" type="tns:Eventos"/>
</s:sequence>
</s:complexType>
<s:complexType name="Eventos">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Id" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="Titulo" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Descripcion" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Compania" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Palabras" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Fecha" type="s:string"/>
</s:sequence>
</s:complexType>
<s:element name="NuevoEventoObjeto">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="evento" type="tns:Eventos"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="NuevoEventoObjetoResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="NuevoEventoObjetoResult" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="NuevoEventoSoapIn">
<wsdl:part name="parameters" element="tns:NuevoEvento"/>
</wsdl:message>
<wsdl:message name="NuevoEventoSoapOut">
<wsdl:part name="parameters" element="tns:NuevoEventoResponse"/>
</wsdl:message>
<wsdl:message name="ListadoEventosSoapIn">
<wsdl:part name="parameters" element="tns:ListadoEventos"/>
</wsdl:message>
<wsdl:message name="ListadoEventosSoapOut">
<wsdl:part name="parameters" element="tns:ListadoEventosResponse"/>
</wsdl:message>
<wsdl:message name="NuevoEventoObjetoSoapIn">
<wsdl:part name="parameters" element="tns:NuevoEventoObjeto"/>
</wsdl:message>
<wsdl:message name="NuevoEventoObjetoSoapOut">
<wsdl:part name="parameters" element="tns:NuevoEventoObjetoResponse"/>
</wsdl:message>
<wsdl:portType name="ServicioClientesSoap">
<wsdl:operation name="NuevoEvento">
<wsdl:input message="tns:NuevoEventoSoapIn"/>
<wsdl:output message="tns:NuevoEventoSoapOut"/>
</wsdl:operation>
<wsdl:operation name="ListadoEventos">
<wsdl:input message="tns:ListadoEventosSoapIn"/>
<wsdl:output message="tns:ListadoEventosSoapOut"/>
</wsdl:operation>
<wsdl:operation name="NuevoEventoObjeto">
<wsdl:input message="tns:NuevoEventoObjetoSoapIn"/>
<wsdl:output message="tns:NuevoEventoObjetoSoapOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServicioClientesSoap" type="tns:ServicioClientesSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="NuevoEvento">
<soap:operation soapAction="http://proof.net/NuevoEvento" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ListadoEventos">
<soap:operation soapAction="http://proof.net/ListadoEventos" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="NuevoEventoObjeto">
<soap:operation soapAction="http://proof.net/NuevoEventoObjeto" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ServicioClientesSoap12" type="tns:ServicioClientesSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="NuevoEvento">
<soap12:operation soapAction="http://proof.net/NuevoEvento" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ListadoEventos">
<soap12:operation soapAction="http://proof.net/ListadoEventos" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="NuevoEventoObjeto">
<soap12:operation soapAction="http://proof.net/NuevoEventoObjeto" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ServicioClientes">
<wsdl:port name="ServicioClientesSoap" binding="tns:ServicioClientesSoap">
<soap:address location="http://localhost:50490/ServicioClientes.asmx"/>
</wsdl:port>
<wsdl:port name="ServicioClientesSoap12" binding="tns:ServicioClientesSoap12">
<soap12:address location="http://localhost:50490/ServicioClientes.asmx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
EDIT1: The data i posted to the service (only using the first webmethod)
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Web.Services;
namespace ServicioWebSoap
{
/// <summary>
/// Descripción breve de ServicioClientes
/// </summary>
[WebService(Namespace = "http://proof.net/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// Para permitir que se llame a este servicio web desde un script, usando ASP.NET AJAX, quite la marca de comentario de la línea siguiente.
// [System.Web.Script.Services.ScriptService]
public class ServicioClientes : System.Web.Services.WebService
{
[WebMethod]
public int NuevoEvento(string Titulo, string Descripcion, string Compania, string Palabras, string Fecha)
{
SqlConnection con = new SqlConnection(#"Data Source=SRCOMPUTADOR\SQLEXPRESS01;Initial Catalog=DBEventos;Integrated Security=True");
con.Open();
string sql = "INSERT INTO Eventos (Titulo, Descripcion, Compania, Palabras, Fecha) VALUES (#Titulo, #Descripcion, #Compania, #Palabras, #Fecha)";
SqlCommand cmd = new SqlCommand(sql, con);
cmd.Parameters.Add("#Titulo", System.Data.SqlDbType.NVarChar).Value = Titulo;
cmd.Parameters.Add("#Descripcion", System.Data.SqlDbType.NVarChar).Value = Descripcion;
cmd.Parameters.Add("#Compania", System.Data.SqlDbType.NVarChar).Value = Compania;
cmd.Parameters.Add("#Palabras", System.Data.SqlDbType.NVarChar).Value = Palabras;
cmd.Parameters.Add("#Fecha", System.Data.SqlDbType.NVarChar).Value = Fecha;
int res = cmd.ExecuteNonQuery();
con.Close();
return res;
}
[WebMethod]
public Eventos[] ListadoEventos()
{
SqlConnection con = new SqlConnection(#"Data Source=SRCOMPUTADOR\SQLEXPRESS01;Initial Catalog=DBEventos;Integrated Security=True");
con.Open();
string sql = "SELECT id, Titulo, Descripcion, Compania, Palabras, Fecha FROM Eventos";
SqlCommand cmd = new SqlCommand(sql, con);
SqlDataReader reader = cmd.ExecuteReader();
List<Eventos> lista = new List<Eventos>();
while (reader.Read())
{
lista.Add(
new Eventos(reader.GetInt32(0),
reader.GetString(1),
reader.GetString(2),
reader.GetString(3),
reader.GetString(4),
reader.GetString(5)));
}
con.Close();
return lista.ToArray();
}
[WebMethod]
public int NuevoEventoObjeto(Eventos evento)
{
SqlConnection con = new SqlConnection(#"Data Source=SRCOMPUTADOR\SQLEXPRESS01;Initial Catalog=DBEventos;Integrated Security=True");
con.Open();
string sql = "INSERT INTO Eventos (Titulo, Descripcion, Compania, Palabras, Fecha) VALUES (#Titulo, #Descripcion, #Compania, #Palabras, #Fecha)";
SqlCommand cmd = new SqlCommand(sql, con);
cmd.Parameters.Add("#Titulo", System.Data.SqlDbType.NVarChar).Value = evento.Titulo;
cmd.Parameters.Add("#Descripcion", System.Data.SqlDbType.NVarChar).Value = evento.Descripcion;
cmd.Parameters.Add("#Compania", System.Data.SqlDbType.NVarChar).Value = evento.Compania;
cmd.Parameters.Add("#Palabras", System.Data.SqlDbType.NVarChar).Value = evento.Palabras;
cmd.Parameters.Add("#Fecha", System.Data.SqlDbType.NVarChar).Value = evento.Fecha;
int res = cmd.ExecuteNonQuery();
con.Close();
return res;
}
}
}
The answer was my suposition; the WS only was a emulation (doesnt exist in the web), the solution was solved following the next steps:
Publish it with VS and making use of IIS Manager.
If problems arise with the WS, follow the instructions that support.microsoft.com deliver really works (i searched for days and the key was there).
Then in the URL for the HttpTransportSE call use your local ip substituting "localhost".
I had developed portal on Asp.net mvc framework.I had hosted this site at godaddy hosting.I had a great problem on integrating third party dll i.e. NPOI (excel writer dll).It dispaly following error.
Security Exception
**Description**: *The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.*
**Exception Detail*s**:* System.Security.SecurityException: That assembly does not allow partially trusted callers.
**Source Error:**
*An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.*
Stack Trace:
[SecurityException: That assembly does not allow partially trusted callers.]
ETravel.Web.Modules.Travel.Controllers.Admin.ReportController.TravelTaxList() in ReportController.cs:853
lambda_method(ExecutionScope , ControllerBase , Object[] ) +39
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +52
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +192
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +399
System.Web.Mvc.Controller.ExecuteCore() +126
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +27
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +151
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +57
System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
To solve this problem i had added this code line in web.config file.
<compilation debug="true">
<assemblies>
..................... .............
<add assembly ="NPOI, Version=1.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1"/>
<add assembly="NPOI.POIFS, Version=1.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1"/>
<add assembly ="NPOI.HPSF, Version=1.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1"/>
<add assembly ="NPOI.Util, Version=1.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1"/>
</assemblies>
</compilation>
And [assembly: AllowPartiallyTrustedCallers()] to Assemblyinfo.cs.
But worn't work.what's the main problem and what is the solution???Pls help me...
No, it's NPOI that needs to allow partially trusted callers. It's probably doing something under-the-covers that won't work in a medium trust environment.
Looking at the NPOI website it looks like it was updated to run in medium trust environments towards the end of last year, but that was after the 1.2.1 release. You should try the latest version, 1.2.3 beta, to see if that update has made it in and if that will fix it for you.