Click here to Skip to main content
13,297,547 members (48,503 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I developed an Wep api and it works fine when i run it from Visual studio.

But when i publish it to my hosting ,functions which i send my models dont work.But functions

which i directly send string work fine.Just get errors from functions which i send a class

that i created.What is the problem ?


This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Message>An error has occurred.</Message>
Schema specified is not valid. Errors: Models.Model.csdl(2,9) : warning 0005: Could not find schema information for the attribute 'Namespace'. Models.Model.csdl(2,36) : warning 0005: Could not find schema information for the attribute 'Alias'. Models.Model.csdl(2,49) : error 0005: The '' attribute is not declared. Models.Model.csdl(2,2) : error 0010: The element Schema in namespace was unexpected for the root element. The expected Schema in one of the following namespaces:,,
at System.Data.Metadata.Edm.EdmItemCollection.LoadItems(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModelOption, DbProviderManifest providerManifest, ItemCollection itemCollection, Boolean throwOnError) at System.Data.Metadata.Edm.EdmItemCollection.Init(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths, Boolean throwOnError) at System.Data.Metadata.Edm.EdmItemCollection..ctor(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths) at System.Data.Metadata.Edm.MetadataCache.EdmMetadataEntry.LoadEdmItemCollection(MetadataArtifactLoader loader) at System.Data.Metadata.Edm.MetadataCache.EdmItemCollectionLoader.LoadItemCollection(EdmMetadataEntry entry) at System.Data.Metadata.Edm.MetadataCache.LoadItemCollection[T](IItemCollectionLoader`1 itemCollectionLoader, T entry) at System.Data.Metadata.Edm.MetadataCache.GetOrCreateEdmItemCollection(String cacheKey, MetadataArtifactLoader loader, Object& entryToken) at System.Data.EntityClient.EntityConnection.LoadEdmItemCollection(MetadataWorkspace workspace, MetadataArtifactLoader artifactLoader) at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections) at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection() at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor) at System.Data.Objects.ObjectContext..ctor(EntityConnection connection) at System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel() at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() 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.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() at System.Linq.Queryable.Select[TSource,TResult](IQueryable`1 source, Expression`1 selector) at ModaGuest.Models.Provider.GuestProvider.GetAllItems() at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.<ExecuteAsync>b__4() at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
Posted 13-Oct-12 13:45pm
Updated 14-Oct-12 0:40am
Wes Aday 13-Oct-12 18:49pm
What errors do you get? What exceptions are thrown? What did you find when you examined your log files?
emrebeysungu 13-Oct-12 18:51pm
It gives a xml output like this
<message>An error has occurred.

i am new to webapi and i cant understand why it gives that.
Wes Aday 13-Oct-12 19:11pm
Well it gives you that because an error occurred. The very first thing to realize is that other people in the forums cannot see your code, your project, your hosting company or anything else. All we know is what you tell us. You need to start debugging. Add some exception handling. Create some log files. Examine the error messages that you are getting.
emrebeysungu 13-Oct-12 19:16pm
it doesnt give an exeption when i debug it from vs.İt works fine on visual studio.But not work well on hosting.
Wes Aday 13-Oct-12 19:23pm
That is exactly why you need to do some exception handling, create some log files, debug your code. No one else but you can do that. "not work well" does not mean anything to anyone but you because only you can see what is going on with your code.
emrebeysungu 14-Oct-12 5:41am
I updated question and put the exception there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171207.1 | Last Updated 14 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100