2017-08-02 19 views
0

WCF Webサービスを開発中です。私はサービスを作成しました。サービスを実行すると、リストされたメソッドは表示されません。アプリケーションの実行中にWCFメソッド名が表示されない

私が付属しているスクリーンショットは:

Missing method name

これは私が作成したサービスとメソッドです:

XML要求

<?xml version="1.0"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> 
<SOAP-ENV:Body> 
<opportunityID>1-1DA7KN</opportunityID> 
<opportunityStatus>Created</opportunityStatus> 
<opportunityserviceType>LEASE_REQUEST</opportunityserviceType> 
</SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 
[ServiceContract] 
public interface IOpportunity 
{ 
    [OperationContract] 
    [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Xml, 
    UriTemplate = "postmethod/updateOpportunity")] 
    bool updateOpportunity(opportunityActivity obj); 
} 

[DataContract] 
public class opportunityActivity 
{ 
    [DataMember] 
    public string opportunityID { get; set; } 
    [DataMember] 
    public string opportunityStatus { get; set; } 
    [DataMember] 
    public string opportunityserviceType { get; set; } 
} 

これは私のweb.configファイルです:

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <configSections> 
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
    </configSections> 
    <appSettings> 
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> 
    </appSettings> 
    <system.web> 
    <compilation debug="true" targetFramework="4.5.2" /> 
    <httpRuntime targetFramework="4.5.2" /> 
    <httpModules> 
     <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" /> 
    </httpModules> 
    </system.web> 
    <system.serviceModel> 
    <services> 
     <service name="RayaSoapService.Opportunity"> 
     <endpoint address="" contract="RayaSoapService.IOpportunity" binding="basicHttpBinding"/> 
     <endpoint address="mex" contract="IMetadataExchange" binding="mexHttpBinding"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, set the values below to false before deployment --> 
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="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="false" /> 
     </behavior> 

     </serviceBehaviors> 

    </behaviors> 
    <protocolMapping> 
     <add binding="basicHttpsBinding" scheme="https" /> 
    </protocolMapping> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"> 
     <remove name="ApplicationInsightsWebTracking" /> 
     <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" /> 
    </modules> 
    <!-- 
     To browse web app root directory during debugging, set the value below to true. 
     Set to false before deployment to avoid disclosing web app folder information. 
     --> 
    <directoryBrowse enabled="true" /> 
    <validation validateIntegratedModeConfiguration="false" /> 
    </system.webServer> 
    <connectionStrings> 
    <add name="Test_ROLSP_DB_V1Entities" connectionString="metadata=res://*/Model.ModelModel.csdl|res://*/Model.ModelModel.ssdl|res://*/Model.ModelModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.0.210;initial catalog=Test_ROLSP_DB_V1;user id=sa;[email protected];MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /> 
    </connectionStrings> 
    <entityFramework> 
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> 
    <providers> 
     <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> 
    </providers> 
    </entityFramework> 
</configuration> 

上記のコードは正常に動作します。 Webクライアントを使ってテストしました。今私はいくつかの第三者にこれを公開したいので、私はそれらにxml形式を与えるべきです。私は上記のサービスのXML形式を取得する方法を把握できませんか?私がサービスを実行するたびに、ページに記載された方法も見ることができません。誰かが上記の要求に対してxmlを得るのを助けることができますか?どんな助けでも大歓迎です。ありがとう

+0

app.configエンドポイントを投稿できる場合は、十分にクリアされます。 –

答えて

1

MEXエンドポイントの動作設定を追加する必要があります。私はあなたがそれを逃したと思います。

<services> 
     <service name="RayaSoapService.Opportunity" 
behaviorConfiguration="mexBehaviour"> 
     <endpoint address="" contract="RayaSoapService.IOpportunity" binding="basicHttpBinding"/> 
     <endpoint address="mex" contract="IMetadataExchange" binding="mexHttpBinding"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="mexBehaviour"> 
      <!-- To avoid disclosing metadata information, set the values below to false 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="false" /> 
     </behavior> 

     </serviceBehaviors> 
+0

ありがとうございます。私はweb.configファイルを投稿しました。私は上記のコードで何が分かりませんか知っていてもいいですか? –

+0

@ NiranjanGodboleがweb.configファイルに従って変更されました。 –

+0

Hameedありがとうございます。私は追加して、それはエラーなしで実行されています。しかし、私はどのメソッド名もリストされていません。 –

関連する問題