Skip to Content
avatar image
Former Member

Proxy Generator Throws Error

I'm trying to generate swift proxy files using the metadata from Service Layer with SAP Business One for HANA.

One of the scripts in the proxy generator is failing with the following error:

2017-06-08T11:21:59.304-07:00 TRACE [main] Importing package: xscript.http.2
2017-06-08T11:21:59.304-07:00 TRACE [main] Reading file: /Applications/SAP CP SDK for iOS/Tools/ProxyGenerator/sapcpsdk-resources/import/xscript.http.2.xs
2017-06-08T11:21:59.375-07:00 TRACE [main] Reading file: /var/folders/0d/ngncwb9j27q2zcy8c87cl3k40000gn/T/SAPService.xs
2017-06-08T11:22:20.413-07:00 ERROR [main] /var/folders/0d/ngncwb9j27q2zcy8c87cl3k40000gn/T/SAPService.xs:136174:21 SyntaxError: Duplicate property: already defined at: /var/folders/0d/ngncwb9j27q2zcy8c87cl3k40000gn/T/SAPService.xs:136165:21

The xml file is too large for me to upload as one xml so I've broken it up into 2 parts saved as text documents.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 28, 2017 at 07:08 AM


    Unfortunately this will require additional work on the proxy generator to handle such cases more gracefully. Until this is ready and releases, the only possible work-around for you would be to adjust the metadata to not have identical property names that only differ in case (or use of underscores).

    If you can't modify the backend itself, you could still modify the metadata locally, generate the proxy classes, and then (if you're actually using the problematic entity) hand-adjust the property names again back to the original values in the generated code.

    I understand this is not very convenient, we will deliver a better version of the proxy generator soon.


    Add comment
    10|10000 characters needed characters exceeded

  • Jun 27, 2017 at 09:37 AM


    The problem seems to be that you have two properties VatGroup and VATGroup that translate into the same Swift property `vatGroup` in the generated code. Let me get back to you on possible solutions - I'm assuming you won't be able to change the metadata for this service.


    Add comment
    10|10000 characters needed characters exceeded