Ich habe ein großes Problem. Ich versuche, einen Webdienst zu erstellen, der mit einer verteilten Transaktion arbeiten wird.
Der gesamte folgende Code befindet sich auf der Serverseite des Webdienstes (der Webdienst, der von einem Client aufgerufen wird).
schrieb ich in meinem Schnittstelle:Das TransactionFlowAttribute-Attribut ist auf Obligatorisch gesetzt, aber die Bindung des Kanals ist nicht mit einem TransactionFlowBindingElement konfiguriert.
[ServiceContract]
public interface IClientOperations
{
[OperationContract]
[ServiceKnownType(typeof(TriggerExecInput))]
[ServiceKnownType(typeof(TriggerExecOutput))]
[TransactionFlow(TransactionFlowOption.Mandatory)]
TriggerExecOutput TriggeredProfileDataUpdate(TriggerExecInput triggerInputData, bool isST3StatusActive);
Und dies in der Datei web.config:
<services>
<service name="ClientOperationsService" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="wsHttpBinding"
bindingConfiguration="wsHttpBinding_Common" contract="SL.STAdmin.Applications.WebAPI.IClientOperations"/>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding_Common" transactionFlow="true">
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<!-- 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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
Wenn ich Recht, die SVC-Datei klicken und klicken Sie auf "Ansicht im Browser" ich der folgende Fehler
Exception Details: System.InvalidOperationException: At least one operation on the 'ClientOperations' contract is configured with the TransactionFlowAttribute attribute set to Mandatory but the channel's binding 'BasicHttpBinding' is not configured with a TransactionFlowBindingElement. The TransactionFlowAttribute attribute set to Mandatory cannot be used without a TransactionFlowBindingElement.
Ich habe andere .svc-Dateien, die keine Transaktionen verwenden. Sie alle funktionieren gut. Ich verstehe nicht, warum es immer noch versucht, die BasicHttpTransaction zu verwenden, wenn ich es anweisen, den anderen Bindungstyp zu verwenden.
Hat jemand eine Idee, was ich falsch mache? Vielen Dank im Voraus.
'BasicHttpTransaction' ist keine Bindung, ich denke du meinst' BasicHttpBinding' –