XML Output  Topic is solved

Discussions relating to the REST API of Jiwa 7.

XML Output

Postby SBarnes » Sun Nov 03, 2019 1:16 pm

The call to the API

https://api.jiwa.com.au/Queries/DB_Main ... uE-M8gBlA8

produces XML like

Code: Select all
  <d2p1:DB_Main>
            <d2p1:_x003C_ABN_x003E_k__BackingField>__-___-___-___</d2p1:_x003C_ABN_x003E_k__BackingField>
            <d2p1:_x003C_ACN_x003E_k__BackingField>008 745 985</d2p1:_x003C_ACN_x003E_k__BackingField>
            <d2p1:_x003C_AccountName_x003E_k__BackingField>Arthur Creams Pty Ltd</d2p1:_x003C_AccountName_x003E_k__BackingField>
            <d2p1:_x003C_AccountNo_x003E_k__BackingField>1002</d2p1:_x003C_AccountNo_x003E_k__BackingField>
            <d2p1:_x003C_AccountOnHold_x003E_k__BackingField>false</d2p1:_x003C_AccountOnHold_x003E_k__BackingField>
            <d2p1:_x003C_Address1_x003E_k__BackingField>Unit 2, Technology Park</d2p1:_x003C_Address1_x003E_k__BackingField>
            <d2p1:_x003C_Address2_x003E_k__BackingField>18 Pine Road</d2p1:_x003C_Address2_x003E_k__BackingField>
            <d2p1:_x003C_Address3_x003E_k__BackingField>ROSEHILL</d2p1:_x003C_Address3_x003E_k__BackingField>


is there a way to produce the tags as their real filed names such as Address3
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: XML Output  Topic is solved

Postby Mike.Sheen » Sun Nov 03, 2019 1:44 pm

From what I can tell, we would need to decorate our DTO's in the JiwaServiceModel namespace with DataContract attributes - as per this response from the ServiceStack author.

I admit what is produced right now is fairly ugly, but the solution of decorating all our DTO's manually isn't an appealing option to us either.

I'll have a look when I have a bit of time to see what can be done to improve this.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: XML Output

Postby SBarnes » Sun Nov 03, 2019 5:19 pm

Thanks Mike,

But don't get too carried away on a solution for the standard DTOs the example I gave has nothing to do with the the task I have to achieve that will be for non standard views and stored procs I need to write for a customer, I was just using DB_Main to ask the question on how to do it.

If the link you have provided works as advertised I'll let you know so that you can look at it for the standard DTOs.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: XML Output

Postby SBarnes » Wed Jan 15, 2020 11:26 am

Hi Mike,

Just to let you know the link you provided does clean up the XML in your annotate the response classes as described.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to REST API

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron