4

I'm using the LanguageService (translation service) from Bing. I generated the F# soap client code with svcutil (and modified it a little to got it working) but got stuck with some methods that use the word to 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 with _to and __to without luck.

I don't know if there is any way to undefine keywords or define the parameter another way (something like this: SOAPpy - reserved word in named parameter list ).

Thanks in advance!

Community
  • 1
  • 1
k4cho
  • 65
  • 3

1 Answers1

9
abstract Translate :appId:string * text:string * from:string * ``to``:string * contentType:string * category:string -> string

Double back-ticks allow you to put almost any string (including spaces and punctuation, and obviously reserved words).

Ramon Snir
  • 7,520
  • 3
  • 43
  • 61