Android SOAP端点WCF Webservice的错误请求

Android SOAP端点WCF Webservice的错误请求,android,wcf,web-services,windows-phone-7,soap,Android,Wcf,Web Services,Windows Phone 7,Soap,我有一个WCF服务,它需要有多个端点(特别是json和SOAP),才能与Android和WP7设备兼容 通过以下文件中的配置,我可以使用json端点通过Google Chrome访问服务,但是如果我尝试使用soap端点,我就无法访问。使用Fiddler,我得到了地址的404错误,而通过使用相同的地址,但最后使用soap,我得到了一个400错误的错误请求 我尝试使用所指示的配置,但无效 为什么我在这里做错了?我怎样才能解决这个问题 任何帮助都将不胜感激。谢谢你抽出时间!:D 下面是我正在使用的we

我有一个WCF服务,它需要有多个端点(特别是json和SOAP),才能与Android和WP7设备兼容

通过以下文件中的配置,我可以使用json端点通过Google Chrome访问服务,但是如果我尝试使用soap端点,我就无法访问。使用Fiddler,我得到了地址的404错误,而通过使用相同的地址,但最后使用soap,我得到了一个400错误的错误请求

我尝试使用所指示的配置,但无效

为什么我在这里做错了?我怎样才能解决这个问题

任何帮助都将不胜感激。谢谢你抽出时间!:D

下面是我正在使用的web.config文件:

<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <!--Deploy-->

    <add name="LiveAndesWCF" connectionString="data source=tcp:sql2k802.discountasp.net;Initial Catalog=SQL2008_832326_liveandes;User ID=SQL2008_832326_liveandes_user;Password=******; MultipleActiveResultSets=true" providerName="System.Data.SqlClient"/>
    <add name="LiveAndes" connectionString="data source=tcp:sql2k802.discountasp.net;Initial Catalog=SQL2008_832326_liveandes;User ID=SQL2008_832326_liveandes_user;Password=****; MultipleActiveResultSets=true" providerName="System.Data.SqlClient"/>

  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LiveAndes" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
      </providers>
    </membership>
  </system.web>
  <appSettings>
    <!-- Deploy -->

    <add key="mainPathDeployWCF" value="http://liveandesor.web711.discountasp.net/"/>
    <add key="mainMachPathDeployWCF" value="e:\web\liveandesor\htdocs"/>
    <add key="serverPath" value="e:\\web\\liveandesor\\htdocs"/>
    <add key="imageBaseUrl" value="http://liveandesor.web711.discountasp.net/Content/UploadedImages/"/>

    <!--<add key="mainMachPath" value="C:\Users\Rul\Documents\Universidad\2011'1\Taller de Especialidad\svn\Desarrollo\WEB\LiveAndesMVC\LiveAndesMVC"/>-->
  </appSettings>

  <system.serviceModel>
    <protocolMapping>
      <add scheme="http" binding="wsHttpBinding" />
    </protocolMapping>


    <services>
      <service name="LiveAndesWCF.SightingService">
        <endpoint address="soap"
                  bindingConfiguration="soapBinding"
                  binding="basicHttpBinding"
                  contract="LiveAndesWCF.ISightingService"/>
        <endpoint address="json"
                  binding="webHttpBinding" 
                  behaviorConfiguration="jsonBehavior"
                  contract="LiveAndesWCF.ISightingService"/>
      </service>
      <service name="LiveAndesWCF.UserService">
        <endpoint address="soap"
                  bindingConfiguration="soapBinding"
                  binding="basicHttpBinding"
                  contract="LiveAndesWCF.IUserService"/>
        <endpoint address="json" 
                  binding="webHttpBinding" 
                  behaviorConfiguration="jsonBehavior" 
                  contract="LiveAndesWCF.IUserService"/>
      </service>
      <service name="LiveAndesWCF.UserServiceRest" behaviorConfiguration="MetadataBehavior">
        <endpoint address="json" 
                  behaviorConfiguration="WebBehavior" 
                  binding="webHttpBinding" 
                  contract="LiveAndesWCF.IUserServiceRest"/>
      </service>
      <service name="LiveAndesWCF.SightingServiceRest" behaviorConfiguration="MetadataBehavior">
        <endpoint address="soap" 
                  binding="basicHttpBinding"
                  bindingConfiguration="soapBinding"
                  contract="LiveAndesWCF.ISightingServiceRest"/>
        <endpoint address="json" 
                  behaviorConfiguration="WebBehavior" 
                  binding="webHttpBinding" 
                  contract="LiveAndesWCF.ISightingServiceRest"/>
      </service>
      <service name="LiveAndesWCF.TestService">
        <endpoint address="soap" 
                  binding="basicHttpBinding"
                  bindingConfiguration="soapBinding"
                  contract="LiveAndesWCF.ITestService"/>
        <endpoint address="json" 
                  binding="webHttpBinding" 
                  behaviorConfiguration="jsonBehavior" 
                  contract="LiveAndesWCF.ITestService"/>
      </service>
    </services>


    <bindings>
      <basicHttpBinding>
        <binding name="soapBinding" maxReceivedMessageSize="99999999" closeTimeout="00:02:00" openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:02:00">
          <readerQuotas maxArrayLength="76384000" maxStringContentLength="2147483647"/>
          <security mode="None"/>
        </binding>
      </basicHttpBinding>
      <webHttpBinding>
        <binding maxReceivedMessageSize="99999999" closeTimeout="00:02:00" openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:02:00">
          <readerQuotas maxArrayLength="76384000" maxStringContentLength="2147483647"/>
        </binding>
      </webHttpBinding>
    </bindings>


    <behaviors>
      <endpointBehaviors>
        <behavior name="jsonBehavior">
          <enableWebScript/>
          <!--<webHttp/>-->
        </behavior>
        <behavior name="WebBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>



      <serviceBehaviors>
        <behavior>
          <!-- 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="true"/>
        </behavior>
        <behavior name="MetadataBehavior">
          <serviceMetadata httpGetEnabled="true" httpGetUrl="" />
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

您可以自己回答,然后将其标记为答案,也可以将其标记为答案

“因为当我尝试使用slsvcutil工具仅使用json端点创建引用时,它所说的只是“没有与Silverlight 3兼容的端点。”

看看这个问题,知道我在说什么:
您可以自己回答,然后将其标记为答案,也可以将其标记为答案

“因为当我尝试使用slsvcutil工具仅使用json端点创建引用时,它所说的只是“没有与Silverlight 3兼容的端点。”

看看这个问题,知道我在说什么:

WP7可以非常轻松地使用json。除非它是一个已经编写的手机应用程序,需要WCF。感谢德里克的回答!我如何使用json呢?因为当我尝试使用slsvcutil工具仅使用json端点创建引用时,它所说的只是“没有与Silverlight 3兼容的端点”。看看这个问题就知道我在说什么:WP7可以非常容易地使用json。除非它是一个已经编写的手机应用程序,需要WCF。感谢德里克的回答!我如何使用json呢?因为当我尝试使用slsvcutil工具仅使用json端点创建引用时,它所说的只是“没有与Silverlight 3兼容的端点”。看看这个问题,知道我在说什么: