1

我尝试实现相同的 wcf 合同类的 soap 和 json 方法。我的问题是当我在服务名称中删除名称空间前缀(XXXX)时,soap 方法工作正常,但 json 方法却没有。如果这次我保留了命名空间,json 方法工作正常,但soap 方法抛出错误。

我的配置是这样的;任何想法?

谢谢大家。

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"></serviceHostingEnvironment> 
            <behaviors>
                <serviceBehaviors>
                    <behavior name="ServiceBehavior">
                        <serviceMetadata  httpGetEnabled="true" />
                        <serviceDebug  includeExceptionDetailInFaults="true"  />
                    </behavior>        
                </serviceBehaviors>

          <endpointBehaviors >
                    <behavior name="JsonEndPointBehavior">
                        <webHttp />
                    </behavior>
            <behavior name="SoapEndPointBehavior">          
            </behavior>
                </endpointBehaviors>

            </behaviors>
            <services>
                <service behaviorConfiguration="ServiceBehavior" name="XXXX.ServerSide">

            <endpoint address=""                   
                      binding="webHttpBinding" 
                      contract="XXXX.service.IServerSide" 
                      behaviorConfiguration="JsonEndPointBehavior" />

            <endpoint address="soap"                    
                      binding="basicHttpBinding" 
                      contract="XXXX.IServerSide" 
                      behaviorConfiguration="SoapEndPointBehavior"/>
          </service>   
4

0 回答 0