Skip to Content
0

Proxy Generator Throws Error

Jun 08, 2017 at 06:42 PM

124

avatar image

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.

servicelayermetadatapart1.txtservicelayermetadatapart2.txt

Thanks!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Andreas Schlosser Jun 28, 2017 at 07:08 AM
1

Grant,

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.

Thanks
Andreas

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Andreas,

I'll give this work around a try.

0
Andreas Schlosser Jun 27, 2017 at 09:37 AM
0

Grant

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.

Thanks
Andreas

Share
10 |10000 characters needed characters left characters exceeded