diff --git a/Opc.Ua.ModelCompiler/StackGenerator/DataTypes/Templates/XmlSchema/Endpoint.wsdl b/Opc.Ua.ModelCompiler/StackGenerator/DataTypes/Templates/XmlSchema/Endpoint.wsdl index df9a0760..31524df1 100644 --- a/Opc.Ua.ModelCompiler/StackGenerator/DataTypes/Templates/XmlSchema/Endpoint.wsdl +++ b/Opc.Ua.ModelCompiler/StackGenerator/DataTypes/Templates/XmlSchema/Endpoint.wsdl @@ -93,4 +93,5 @@ + \ No newline at end of file diff --git a/Opc.Ua.ModelCompiler/StackGenerator/DataTypes/Templates/XmlSchema/Services.wsdl b/Opc.Ua.ModelCompiler/StackGenerator/DataTypes/Templates/XmlSchema/Services.wsdl index bd5f3d57..e3df943d 100644 --- a/Opc.Ua.ModelCompiler/StackGenerator/DataTypes/Templates/XmlSchema/Services.wsdl +++ b/Opc.Ua.ModelCompiler/StackGenerator/DataTypes/Templates/XmlSchema/Services.wsdl @@ -63,4 +63,5 @@ + \ No newline at end of file diff --git a/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/Channels/XmlMethodAsync.cs b/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/Channels/XmlMethodAsync.cs index c5bbb611..a9553cc1 100644 --- a/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/Channels/XmlMethodAsync.cs +++ b/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/Channels/XmlMethodAsync.cs @@ -58,9 +58,13 @@ public _NAME_ResponseMessage End_NAME_(IAsyncResult result) } } #else // NET_STANDARD +#if (!NET_STANDARD_NO_SYNC && !NET_STANDARD_NO_APM) /// /// The client side implementation of the _NAME_ service contract. /// +#if (NET_STANDARD_OBSOLETE_SYNC && NET_STANDARD_ASYNC) +[Obsolete("Sync methods are deprecated in this version. Use _NAME_Async instead.")] +#endif public _NAME_ResponseMessage _NAME_(_NAME_Message request) { IAsyncResult result = null; @@ -72,10 +76,14 @@ public _NAME_ResponseMessage _NAME_(_NAME_Message request) return this.Channel.End_NAME_(result); } - +#endif +#if (!NET_STANDARD_NO_APM) /// /// The client side implementation of the Begin_NAME_ service contract. /// +#if (NET_STANDARD_OBSOLETE_APM && NET_STANDARD_ASYNC) +[Obsolete("Begin/End methods are deprecated in this version. Use _NAME_Async instead.")] +#endif public IAsyncResult Begin_NAME_(_NAME_Message request, AsyncCallback callback, object asyncState) { UaChannelAsyncResult asyncResult = new UaChannelAsyncResult(Channel, callback, asyncState); @@ -91,12 +99,16 @@ public IAsyncResult Begin_NAME_(_NAME_Message request, AsyncCallback callback, o /// /// The client side implementation of the End_NAME_ service contract. /// +#if (NET_STANDARD_OBSOLETE_APM && NET_STANDARD_ASYNC) +[Obsolete("Begin/End methods are deprecated in this version. Use _NAME_Async instead.")] +#endif public _NAME_ResponseMessage End_NAME_(IAsyncResult result) { UaChannelAsyncResult asyncResult = UaChannelAsyncResult.WaitForComplete(result); return asyncResult.Channel.End_NAME_(asyncResult.InnerResult); } #endif +#endif #if (NET_STANDARD_ASYNC) /// diff --git a/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/ClientApi/Interface.cs b/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/ClientApi/Interface.cs index 0f45741e..4a8b017a 100644 --- a/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/ClientApi/Interface.cs +++ b/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/ClientApi/Interface.cs @@ -3,20 +3,33 @@ class Placeholder // ***START*** #region _NAME_ Methods #if (!OPCUA_EXCLUDE__NAME_) +#if (!NET_STANDARD_NO_SYNC && !NET_STANDARD_NO_APM) /// /// Invokes the _NAME_ service. /// +#if (NET_STANDARD_OBSOLETE_SYNC && NET_STANDARD_ASYNC) +[Obsolete("Sync methods are deprecated in this version. Use _NAME_Async instead.")] +#endif void SyncCall(); +#endif +#if (!NET_STANDARD_NO_APM) /// /// Begins an asynchronous invocation of the _NAME_ service. /// +#if (NET_STANDARD_OBSOLETE_APM && NET_STANDARD_ASYNC) +[Obsolete("Begin/End methods are deprecated in this version. Use _NAME_Async instead.")] +#endif void BeginAsyncCall(); /// /// Finishes an asynchronous invocation of the _NAME_ service. /// +#if (NET_STANDARD_OBSOLETE_APM && NET_STANDARD_ASYNC) +[Obsolete("Begin/End methods are deprecated in this version. Use _NAME_Async instead.")] +#endif void EndAsyncCall(); +#endif #if (NET_STANDARD_ASYNC) /// diff --git a/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/ClientApi/Method.cs b/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/ClientApi/Method.cs index 4c2c043c..a6f359d2 100644 --- a/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/ClientApi/Method.cs +++ b/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/ClientApi/Method.cs @@ -116,9 +116,13 @@ void EndAsyncCall() return response.ResponseHeader; } #else // NET_STANDARD +#if (!NET_STANDARD_NO_SYNC && !NET_STANDARD_NO_APM) /// /// Invokes the _NAME_ service. /// +#if (NET_STANDARD_OBSOLETE_SYNC && NET_STANDARD_ASYNC) +[Obsolete("Sync methods are deprecated in this version. Use _NAME_Async instead.")] +#endif void SyncCall() { _NAME_Request request = new _NAME_Request(); @@ -149,10 +153,15 @@ void SyncCall() return response.ResponseHeader; } +#endif +#if (!NET_STANDARD_NO_APM) /// /// Begins an asynchronous invocation of the _NAME_ service. /// +#if (NET_STANDARD_OBSOLETE_APM && NET_STANDARD_ASYNC) +[Obsolete("Begin/End methods are deprecated in this version. Use _NAME_Async instead.")] +#endif void BeginAsyncCall() { _NAME_Request request = new _NAME_Request(); @@ -167,6 +176,9 @@ void BeginAsyncCall() /// /// Finishes an asynchronous invocation of the _NAME_ service. /// +#if (NET_STANDARD_OBSOLETE_APM && NET_STANDARD_ASYNC) +[Obsolete("Begin/End methods are deprecated in this version. Use _NAME_Async instead.")] +#endif void EndAsyncCall() { _NAME_Response response = null; @@ -193,6 +205,7 @@ void EndAsyncCall() return response.ResponseHeader; } #endif +#endif #if (NET_STANDARD_ASYNC) /// diff --git a/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/Interfaces/OperationAsync.cs b/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/Interfaces/OperationAsync.cs index 9fe689eb..c7241337 100644 --- a/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/Interfaces/OperationAsync.cs +++ b/Opc.Ua.ModelCompiler/StackGenerator/DotNet/Templates/Interfaces/OperationAsync.cs @@ -5,24 +5,34 @@ class Placeholder /// /// The operation contract for the _NAME_ service. /// +#if (!NET_STANDARD_NO_SYNC && !NET_STANDARD_NO_APM) #if (!NET_STANDARD) [OperationContract(Action = Namespaces._ServicesNamespace_ + "/_NAME_", ReplyAction = Namespaces._ServicesNamespace_ + "/_NAME_Response")] [FaultContract(typeof(ServiceFault), Action = Namespaces._ServicesNamespace_ + "/_NAME_Fault", Name="ServiceFault", Namespace=Namespaces._TypesNamespace_)] #endif +#if (NET_STANDARD_OBSOLETE_SYNC && NET_STANDARD_ASYNC) +[Obsolete("Sync methods are deprecated in this version. Use _NAME_Async instead.")] +#endif _NAME_ResponseMessage _NAME_(_NAME_Message request); +#endif /// /// The operation contract for the _NAME_ service. /// +#if (!NET_STANDARD_NO_APM) #if (!NET_STANDARD) [OperationContractAttribute(AsyncPattern=true, Action=Namespaces._ServicesNamespace_ + "/_NAME_", ReplyAction = Namespaces._ServicesNamespace_ + "/_NAME_Response")] #endif +#if (NET_STANDARD_OBSOLETE_APM && NET_STANDARD_ASYNC) +[Obsolete("Begin/e methods are deprecated in this version. Use _NAME_Async instead.")] +#endif IAsyncResult Begin_NAME_(_NAME_Message request, AsyncCallback callback, object asyncState); /// /// The method used to retrieve the results of a _NAME_ service request. /// _NAME_ResponseMessage End_NAME_(IAsyncResult result); +#endif #if (NET_STANDARD_ASYNC) ///