Symptoms
Error encountered when attempting to publish service object:
ServiceObjectModel AutoCompiler error
CS1519: Invalid token '2' in class, struct, or interface member declaration
ServiceObjectModel AutoCompiler error
CS1519: Invalid token '{' in class, struct, or interface member declaration
ServiceObjectModel AutoCompiler error
CS1519: Invalid token '{' in class, struct, or interface member declaration
ServiceObjectModel AutoCompiler error
CS1519: Invalid token '' in class, struct, or interface member declaration
ServiceObjectModel AutoCompiler error
CS0116: A namespace cannot directly contain members such as fields or methods
ServiceObjectModel AutoCompiler error
CS1022: Type or namespace definition, or end-of-file expected
ServiceObjectModel AutoCompiler error
CS1022: Type or namespace definition, or end-of-file expected
Diagnoses
Under the BAPI_MLGN_GA structure, it contains a property called 2STEP_PICK. When K2 connect tries to translate it to code, it will end up with the following proxy code.
public virtual string 2STEP_PICK {
get {
return _2STEP_PICK
}
set {
_2STEP_PICK = value
}
}
As properties cannot start with a number, this throws an error when it tries to compile.
Resolution
As properties cannot start with a number, this throws an error when it tries to compile. To resolve the issue, change the 2STEP_PICK Friendly name to something else (e.g. _2STEP_PICK or TWOSTEP_PICK).