Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.78 KB | None | 0 0
  1. [OperationContract]
  2. [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, UriTemplate = "InsertDetail/")]
  3. bool InsertDetail(string jsonString);
  4.  
  5. <?xml version="1.0"?>
  6. <configuration>
  7. <configSections>
  8. <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>
  9. </configSections>
  10. <loggingConfiguration name="" tracingEnabled="true" defaultCategory="General">
  11. <listeners>
  12. <add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" source="Enterprise Library Logging" formatter="Text Formatter" log="" machineName="." traceOutputOptions="None"/>
  13. <add name="Email Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" toAddress="thejus@thejus.com" fromAddress="thejus.tv@thejus.com" subjectLineStarter="ERP Service Log" subjectLineEnder="Error" smtpServer="smtp.thejus.com" smtpPort="587" formatter="Text Formatter" authenticationMode="UserNameAndPassword" userName="thejus.tv@thejus.com" password="" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack" asynchronous="true"/>
  14. <add name="Rolling Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" fileName="G:ERP Log.log" footer="-------------Starting---------------------------" formatter="Text Formatter" header="-------------Ending---------------------------" rollInterval="Week" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack"/>
  15. </listeners>
  16. <formatters>
  17. <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" template="Timestamp: {timestamp}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Priority: {priority}{newline}&#xA;EventId: {eventid}{newline}&#xA;Severity: {severity}{newline}&#xA;Title:{title}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;ProcessId: {localProcessId}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Thread Name: {threadName}{newline}&#xA;Win32 ThreadId:{win32ThreadId}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}" name="Text Formatter"/>
  18. </formatters>
  19. <categorySources>
  20. <add switchValue="All" name="General">
  21. <listeners>
  22. <add name="Rolling Flat File Trace Listener"/>
  23. <add name="Email Trace Listener"/>
  24. </listeners>
  25. </add>
  26. </categorySources>
  27. <specialSources>
  28. <allEvents switchValue="All" name="All Events"/>
  29. <notProcessed switchValue="All" name="Unprocessed Category"/>
  30. <errors switchValue="All" name="Logging Errors & Warnings">
  31. <listeners>
  32. <add name="Event Log Listener"/>
  33. </listeners>
  34. </errors>
  35. </specialSources>
  36. </loggingConfiguration>
  37. <connectionStrings>
  38. <add name="DefaultConnection" connectionString="SQL|Data Source=DESKTOP;Initial Catalog=erp; User=sa; Password=;" providerName="System.Data.SqlClient"/>
  39. </connectionStrings>
  40. <appSettings>
  41. <add key="DefaultConnection" value="SQL|Data Source=DESKTOP;Initial Catalog=erp; User=sa; Password=;"/>
  42. <add key="CommandTimeOut" value="20"/>
  43. <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
  44. </appSettings>
  45. <system.web>
  46. <httpRuntime maxUrlLength="5000"/>
  47. <compilation targetFramework="4.0" debug="true"/>
  48. <customErrors mode="Off"/>
  49. </system.web>
  50. <system.serviceModel>
  51. <services>
  52. <service behaviorConfiguration="ServiceBehave" name="ERP.Hosting.RestService">
  53. <endpoint behaviorConfiguration="webHttpBehave" binding="webHttpBinding" bindingConfiguration="" contract="ERP.Hosting.IRestService"/>
  54. <host>
  55. <baseAddresses>
  56. <add baseAddress="http://localhost/grc"/>
  57. </baseAddresses>
  58. </host>
  59. </service>
  60. </services>
  61. <behaviors>
  62. <endpointBehaviors>
  63. <behavior name="webHttpBehave">
  64. <webHttp/>
  65. </behavior>
  66. </endpointBehaviors>
  67. <serviceBehaviors>
  68. <behavior name="">
  69. <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
  70. <serviceDebug includeExceptionDetailInFaults="false"/>
  71. </behavior>
  72. <behavior name="ServiceBehave">
  73. <serviceDebug/>
  74. <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
  75. </behavior>
  76. </serviceBehaviors>
  77. </behaviors>
  78. <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
  79. </system.serviceModel>
  80. <system.webServer>
  81. <modules runAllManagedModulesForAllRequests="true"/>
  82. </system.webServer>
  83. <runtime>
  84. <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  85. <dependentAssembly>
  86. <assemblyIdentity name="Microsoft.Practices.Unity" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
  87. <bindingRedirect oldVersion="0.0.0.0-2.0.414.0" newVersion="2.0.414.0"/>
  88. </dependentAssembly>
  89. <dependentAssembly>
  90. <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
  91. <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0"/>
  92. </dependentAssembly>
  93. </assemblyBinding>
  94. </runtime>
  95. </configuration>
  96.  
  97. $.ajax({
  98.  
  99. type: "POST",
  100. url: url,
  101. data: JSON.stringify(jsonString),
  102. datatype: "json",
  103. contentType: "application/json",
  104. success: function (data) {
  105.  
  106. alert('success');
  107.  
  108.  
  109. },
  110. erro: function (xhr, ajaxOptions, thrownError) {
  111. debugger;
  112. alert(thrownError);
  113. }
  114. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement