JavaScript “missing name after . operator” Error
Why is a "missing name after . operator" error being thrown - the accessor path looks ok?
Some WSDL definitions use a <return> element to indicate a return value or data set from an operation (often generated from a Java method signature). Unfortunately if the access path for an element or attribute contains a JavaScript keyword such as ‘return’ e.g.searchByCountryResponse.soapenv::Body.xsd1::searchByCountryResponse. return.xsd1::station.length();Then you will obtain an error such as
“Script Failed - missing name after. operator”This is because return is a keyword in JavaScript and cannot be used as object, function, variable or method names. To workaround this, use the ‘*’ wildcard i.e.
searchByCountryResponse.soapenv::Body.xsd1::searchByCountryResponse. *.xsd1::station.length();A list of JavaScript keywords which are likely to cause problems if encountered as element or attribute names are listed below – replace these with ‘*’ as required.
| abstract | else | instanceof | switch |
| boolean | enum | int | synchronized |
| break | export | interface | this |
| byte | extends | long | throw |
| case | false | native | throws |
| catch | final | new | transient |
| char | finally | null | true |
| class | float | package | try |
| const | for | private | typeof |
| continue | function | protected | var |
| debugger | goto | public | void |
| default | if | return | volatile |
| delete | implements | short | while |
| do | import | static | with |
| double | in | super |
Note: MagooClient will automatically substitute wildcard (‘*’) accessors for elements and attributes with names matching JavaScript keywords when dragging a node from a MagooClient editor XML tree into the Scripframe editor.