F # SOAP client with reserved word in parameter

I am using LanguageService (translation) from Bing. I generated the F # soap client code using svcutil (and modified it a bit to make it work), but got stuck in some methods that use words for in their parameters. And it is reserved in F #.

[<System.ServiceModel.OperationContractAttribute(Action="http://api.microsofttranslator.com/V2/LanguageService/Translate", ReplyAction="http://api.microsofttranslator.com/V2/LanguageService/TranslateResponse")>] abstract Translate :appId:string * text:string * from:string * to:string * contentType:string * category:string -> string 

I already tried without _to and __ before .

I don’t know if there is a way to cancel keywords or define a parameter in another way (something like this: SOAPpy is a reserved word in the list of named parameters ).

Thanks in advance!

+4
source share
1 answer
 abstract Translate :appId:string * text:string * from:string * ``to``:string * contentType:string * category:string -> string 

Double back ticks allow you to place almost any line (including spaces and punctuation marks and, obviously, reserved words).

+9
source

Source: https://habr.com/ru/post/1392182/


All Articles