![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Service crashing!! Hi There, The Service interface ,datacontracts ,configs are as below: [ServiceContract] public interface IService1 { [OperationContract] CompositeType GetData(string name); [OperationContract] CompositeType GetDataUsingDataContract(CompositeType composite); } [DataContract] public class CompositeType { [DataMember]public string name; [DataMember]public IEnumerable<Property> properties; } [DataContract] public class Property { [DataMember] public string Name; [DataMember] public object Value; } Service implemention is as below : public class Service1 : IService1 { public CompositeType GetData(string name) { List<Property> lstProperty = new List<Property>(); lstProperty.Add(new Property { Name = "name", Value = "name1" }); lstProperty.Add(new Property { Name = "description", Value = "description" }); lstProperty.Add(new Property { Name = "createddate", Value = "createddate" }); lstProperty.Add(new Property { Name = "modifieddate", Value = "modifieddate;" }); return new CompositeType { name = "comp1", properties = lstProperty.ToArray() }; } public CompositeType GetDataUsingDataContract(CompositeType composite) { throw new NotImplementedException(); } } Server Config: <system.serviceModel> <services> <service behaviorConfiguration="WCFService1.Service1Behavior" name="WCFService1.Service1"> <endpoint address="" binding="wsHttpBinding" bindingConfiguration="" contract="WCFService1.IService1" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="WCFService1.Service1Behavior"> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> my client config looks like this: <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IService1" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://localhost:3841/Service1.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1" contract="ServiceReference.IService1" name="WSHttpBinding_IService1"> <identity> <userPrincipalName value="shivakd@xxxxxx" /> </identity> </endpoint> </client> </system.serviceModel> my Client Code: Service1Client client = new Service1Client(); CompositeType comp = client.GetData("name"); Console.WriteLine("comp.name"); Console.ReadKey(); The Problem: The composite type contains IEnumarable<Property> ,now if we call GetData on the client proxy ,which is suppose to return CompositeType , the Service will just exits ,without sending the response message. could any one throw some light on this. Thanks and Regards Dee |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Service crashing!! I don't think the value side of CompositeType can actually be IEnumerable. I could well, be wrong there but I would try turing it into: public class CompositeType { [DataMember]public string name; [DataMember]public List<Property> properties; } .... and see what happens. The List, of course, will just be turned into an array of Property as it crosses the wire (as defined by the WSDL) but the client side proxy should be smart enough to turn it back into a Generic List. The service is only crashing because you don't have an exception handler around the GetData call. Wrap the server side "GetData" call in a try/catch block, and see what the exception is. If you can't connect via a debugger, log the exception to disk, and then read the file. -- Chris Mullins "DEE" <tsdeepak@xxxxxx> wrote in message news:c382ec01-454b-4def-be22-219b47c7d26c@xxxxxx
| ||||||||||||
| |
| |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The Windows Firewall service terminated with service-specific erro | Kraig | Vista security | 1 | 3 Weeks Ago 05:51 PM |
| Error ! User Profile Service service failed the logon. | DavidinEdmond | Vista account administration | 14 | 07-10-2008 04:33 AM |
| The Windows Firewall service terminated with service-specific erro | DaMnIt | Vista security | 7 | 10-10-2007 12:34 PM |
| PDIHWCTL service failed, EventID: 7000, Source: Service Control Manager Eventlog Provider | ls [sb] | Vista General | 0 | 06-20-2007 10:20 PM |
| Security Service and Windows Wireless Service stopped working | Kolin Tregaskes | Vista General | 3 | 06-11-2007 12:34 PM |