简体   繁体   中英

WCF Service configuration in Azure

I have SOAP service in Azure and I have trouble make it work. It uses port 30001. When trying to access the service it produces 500 Internal error. What am I doing wrong, please? Thank you very much. Here is part of ServiceDefinition.csdef:

<WebRole name="xxx.SettingsIface" vmsize="Small">
<Sites>
  <Site name="Web">
    <Bindings>
      <Binding name="SettingsEndpoint" endpointName="SettingsEndpoint" />
    </Bindings>
  </Site>
</Sites>
<Endpoints>
  <InputEndpoint name="SettingsEndpoint" protocol="http" port="30001" />
</Endpoints>
</WebRole>

I tried to set service with this Web.config file:

<?xml version="1.0"?>
<configuration>
  <system.diagnostics>
    <trace>
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
          <filter type=""/>
        </add>
      </listeners>
    </trace>
  </system.diagnostics>
  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
  </system.web>
  <system.ServiceModel>
    <services>
      <service name="xxx.SettingsInterfaceImpl">
        <endpoint address="" behaviorConfiguration="myBehavior" binding="basicHttpBinding" contract="xxx.ISettingsInterface"  />
      </service>
    </services>
    <!--xxxxxxxxx-->
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpBinding">
        </binding>
      </basicHttpBinding>
    </bindings>
    <!--xxxxxxxxx-->
    <behaviors>
      <endpointBehaviors>
        <behavior name="myBehavior">
          <callbackDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
  </system.ServiceModel>
</configuration>

The problem is not necesseraly in the endpoint config file. The next step is not remote debug your SOAP service with Visual Studio so that you can put breakpoints on the code handling requests and go step by step in the code execution path.

Here is how to remote debug on azure: https://azure.microsoft.com/en-us/documentation/articles/vs-azure-tools-debug-cloud-services-virtual-machines/ .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM