This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello - I am trying to set up my services as IIS-hosted services on a Server 2008R2 machine. I am not using DTOs, and I am not using the DistributedUnitOfWork pattern. I copy the HawkModel.dll and Mindscape.Lightspeed.dll files to a shared folder and reference/copy local the files. I am using ChannelFactory and configuration files to declare the services, ie config files not code. I have been able to run this successfully as a self-hosted WCF console app on my local machine, but I run into trouble trying to goet them up and running as IIS-hosted services on the remote machine. I have been able to get the simpler services up and running, but the services that ship large collection of inter-related entities back and forth are giving me trouble. Here's the error I get when I try to browse the service in IIS Manager: An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: Mindscape.LightSpeed.ServiceModel.NetDataContractOperationBehavior contract: ProductionMonitor/2011/02:TestingContract ----> System.Runtime.Serialization.InvalidDataContractException: Type 'Mindscape.LightSpeed.EntityCollection`1[[HawkModel.TestRecord, HawkModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' is an invalid collection type since it has DataContractAttribute attribute. at System.Runtime.Serialization.CollectionDataContract.GetValidContract(SerializationMode mode) at System.Runtime.Serialization.DataContract.GetDataContract(Int32 id, RuntimeTypeHandle typeHandle, SerializationMode mode) at System.Runtime.Serialization.DataContractSet.AddClassDataContract(ClassDataContract classDataContract) at System.Runtime.Serialization.DataContractSet.InternalAdd(XmlQualifiedName name, DataContract dataContract) at System.Runtime.Serialization.DataContractSet.AddClassDataContract(ClassDataContract classDataContract) at System.Runtime.Serialization.DataContractSet.InternalAdd(XmlQualifiedName name, DataContract dataContract) at System.Runtime.Serialization.XsdDataContractExporter.Export(Type type) at System.ServiceModel.Description.MessageContractExporter.ExportType(Type type, String partName, String operationName, XmlSchemaType& xsdType) at System.ServiceModel.Description.DataContractSerializerMessageContractExporter.ExportBody(Int32 messageIndex, Object state) at System.ServiceModel.Description.MessageContractExporter.ExportMessage(Int32 messageIndex, Object state) at System.ServiceModel.Description.MessageContractExporter.ExportMessageContract() at System.ServiceModel.Description.WsdlExporter.CallExtension(WsdlContractConversionContext contractContext, IWsdlExportExtension extension) --- End of inner ExceptionDetail stack trace --- at System.ServiceModel.Description.WsdlExporter.CallExtension(WsdlContractConversionContext contractContext, IWsdlExportExtension extension) at System.ServiceModel.Description.WsdlExporter.CallExportContract(WsdlContractConversionContext contractContext) at System.ServiceModel.Description.WsdlExporter.ExportContract(ContractDescription contract) at System.ServiceModel.Description.WsdlExporter.ExportEndpoint(ServiceEndpoint endpoint, XmlQualifiedName wsdlServiceQName) at System.ServiceModel.Description.WsdlExporter.ExportEndpoints(IEnumerable`1 endpoints, XmlQualifiedName wsdlServiceQName) at System.ServiceModel.Description.ServiceMetadataBehavior.MetadataExtensionInitializer.GenerateMetadata() at System.ServiceModel.Description.ServiceMetadataExtension.EnsureInitialized() at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.InitializationData.InitializeFrom(ServiceMetadataExtension extension) at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.GetInitData() at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.TryHandleDocumentationRequest(Message httpGetRequest, String[] queries, Message& replyMessage) at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.ProcessHttpRequest(Message httpGetRequest) at SyncInvokeGet(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) I first thought this might be related to an earlier problem you addressed in this forum post (http://www.mindscapehq.com/forums/Post.aspx?ThreadID=3950&PostID=13520), where I had reverse associations marked with the DataMemberAttribute attribute. As far as I can tell, that is not the case here. The TestRecord entity is the "base" entity for just about everything else in the database schema. I'm thinking WCF is complaining about one or more of the one-to-many associations from my "master" tables to the the TestRecords table, as Lightspeed models these as EntityCollections, but I can't be sure. I verified that none of these are decorated with the DataMemberAttribute attribute, and now I'm looking for other ideas. I can ship you whatever you may need to help me troubleshoot this problem, but right now I'm just looking for ideas. Thanks for anything you can give me... Dave Newman
|
|
|
Hi Dave, Can you provide some detail about what the contract which you are exporting looks like? Presumably you are getting this error when hitting a metadata endpoint for your service (e.g. browsing to /YourService.svc where you have the documentation endpoint enabled for it). Also have you tried stripping out parts of your contract to see if its just a particular entity definition being opted in to the contract generation which is causing it to throw the issue?
Jeremy |
|
|
Sure, here's the contract, but it won't tell you much: using System.Runtime.Serialization; using System.ServiceModel; using Mindscape.LightSpeed.ServiceModel; using HawkModel; namespace Contracts { [DataContract] public struct OrderStatus { [DataMember] public int TotalItems { get; set; } [DataMember] public int ItemsBuilt { get; set; } } [ServiceContract(Name = "TestingContract", Namespace = "ProductionMonitor/2011/02")] public interface ITesting { [OperationContract] Tester VerifyTester(string empID); [OperationContract] [UseNetDataContractSerializer] void SaveTestResults(TestRecord incomingTestRecord); [OperationContract] OrderStatus GetOrderStatus(string orderNbr, string itemNbr); } } |
|
|
Did you ever solve this? I'm getting a very similar issue. |
|
|
I did resolve the issue but it's been 5 years since I posted this and I don't have even the vaguest idea what the issue was, sorry. Apparently I figured it out on my own (no response from the Lightspeed crew) but then I was a bum and didn't post what my resolution was. I hate it when people do that. I hate it even more when I get caught doing the very thing I rant about. Grrr. We have been using Lightspeed successfully for these past 5 years so I might be able to remember if I download the model and poke around a bit. If I come up with anything I will post it here. Dave |
|
|
Sorry for the delay, I've been a tad busy. If I remember right I resolved the issue by increasing the size of the buffers in the TCP transport. Here's a snippet from the app.config file:
Increasing the buffer sizes seemed to do the trick, I believe. Dave |
|