2013-03-02 129 views
0

我创建了两个WCF Web服务。第一个服务是返回JSON字符串的get服务,第二个服务是接受此JSON字符串作为Input的post服务并将这些数据存储在数据库中。发布Web服务在本地正常工作,但不在服务器上

两个工作在当地罚款,但是当我上传我的代码在服务器1服务继续做工精细,但第2层服务,如邮政服务,该服务将返回一个错误:

Error 400 Bad Request.

按我的知识,我我在Web.config文件中丢失了一些东西。

<?xml version="1.0"?> 
<configuration> 
    <connectionStrings> 
    <!-- 
    <add name="Conn" connectionString="Data Source=*.*.*.*;Initial Catalog=*;User ID=*;Password=*" providerName="System.Data.SqlClient" /> 
    <add name="connString" connectionString="Data Source=*.*.*.*;Initial Catalog=*;User ID=*;Password=*" providerName="System.Data.SqlClient" /> 
    --> 
    <add name="Conn" connectionString="Data Source=*;Initial Catalog=SunshineDB;Integrated Security=True"/> 
    </connectionStrings> 
    <system.serviceModel> 
    <bindings> 
    <webHttpBinding> 
    <binding name="NetTcpBinding_IClaims" 
         closeTimeout="00:01:00" 
         openTimeout="00:01:00" 
         receiveTimeout="00:10:00" 
         sendTimeout="00:01:00" 
         transferMode="Buffered" 
         hostNameComparisonMode="StrongWildcard" 
         maxBufferPoolSize="2147483647" 
         maxBufferSize="2147483647" 
         maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxDepth="32" 
         maxStringContentLength="2147483647" 
         maxArrayLength="2147483647" 
         maxBytesPerRead="2147483647" 
         maxNameTableCharCount="16384"/> 
      <security mode="None"> 
      <transport clientCredentialType="None" /> 
      </security> 
     </binding> 
     </webHttpBinding> 
     <wsHttpBinding> 
     <binding name="wsBufferedHttpsBinding" 
       messageEncoding="Mtom" 
       maxReceivedMessageSize="11534336" 
       maxBufferPoolSize="524288" 
       sendTimeout="00:05:00" 
       receiveTimeout="00:05:00" 
       openTimeout="00:05:00" 
       closeTimeout="00:05:00" > 
      <readerQuotas maxDepth="64" 
         maxStringContentLength="11534336" 
         maxArrayLength="11534336" 
         maxBytesPerRead="11534336" 
         maxNameTableCharCount="16384" /> 
     </binding> 
     </wsHttpBinding> 
     <customBinding> 
     <binding name="basicConfig"> 
      <binaryMessageEncoding/> 
      <httpTransport transferMode="Streamed" 
         maxReceivedMessageSize="67108864"/> 
     </binding> 
     </customBinding> 
    </bindings> 
    <services> 
     <service name="SunShineServices.Service1"> 
     <endpoint address="" 
        binding="webHttpBinding" 
        behaviorConfiguration="EndBehave" 
        contract="SunShineServices.ISunShineServices"> 
      <identity> 
      <dns value="localhost" /> 
      </identity> 
     </endpoint> 
     </service> 
    </services> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="EndBehave"> 
      <webHttp/> 
     </behavior> 
     </endpointBehaviors> 
     <serviceBehaviors> 
     <behavior> 
      <serviceMetadata httpGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="true"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 
</configuration> 
+0

你''的服务的身份......会是它? – Tim 2013-03-02 09:32:37

+0

我试图通过替换localhost与我的服务器IP地址too.I得到相同的错误。 – 2013-03-02 09:37:30

回答

相关问题