मैंने एक सेवा लिखी है जिसे मैं आराम और साबुन के माध्यम से दोनों को बेनकाब करना चाहता हूं। डब्ल्यूसीएफ 4.0 के बारे में जो कुछ भी मैंने पढ़ा है, वह कहता है कि मुझे ऐसा करने के लिए अलग-अलग व्यवहारों के साथ 2 अंत बिंदुओं का पर्दाफाश करने की आवश्यकता है। लेकिन मैं इसे काम नहीं कर सकता।होस्टिंग डब्ल्यूसीएफ साबुन और बाकी अंतराल की तरफ
यहाँ मेरी सेवा अनुबंध है:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="MyService">
<endpoint name="mex" address="mex" binding="mexHttpBinding" contract="MyService"/>
<endpoint address="rest" behaviorConfiguration="restBehavior" binding="webHttpBinding" contract="MyService" />
<endpoint address="soap" behaviorConfiguration="soapBehavior" binding="basicHttpBinding" contract="MyService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="restBehavior">
<webHttp automaticFormatSelectionEnabled="true" helpEnabled="true" />
</behavior>
<behavior name="soapBehavior" />
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>
मैं मार्ग का उपयोग कर रहा मेरी सेवा यूआरएल को परिभाषित करने के:
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
RouteTable.Routes.Add(new ServiceRoute("dns", new ServiceHostFactory(), typeof(MyService)));
}
}
वहाँ है
[ServiceContract]
public interface MyService
{
[OperationContract]
[WebGet(UriTemplate="data/{value}")]
string GetData(string value);
}
यहाँ मेरी web.config है कुछ ऐसा है जो मैं यहाँ गलत कर रहा हूँ? मेरे द्वारा मदद का वाकई कुछ लाभ उठाया जा सकता था।
मैं भी इस अन्य [प्रश्न/उत्तर] (http://stackoverflow.com/questions/186631/rest-soap-endpoints-for-a-wcf पाया सेवा) सहायक। – SMB