ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SOAP Decimal output

Post new topic  Reply to topic
 SOAP Decimal output « View previous topic :: View next topic » 
Author Message
6FA
PostPosted: Thu Mar 03, 2016 9:35 pm    Post subject: SOAP Decimal output Reply with quote

Novice

Joined: 08 Jan 2016
Posts: 21

Hi guys,

I have an input XML value like 16.60. After passing it through SOAP request I'm getting this value as 16.6.
But my output should be 16.60.
How I cal get it?

I'm converting this XML to CSV. It is fine if I can do it while converting. Let me know if it is possible to do it with XSD. But while converting input is 16.6 and my output should be 16.60

Thanks
Back to top
View user's profile Send private message
Simbu
PostPosted: Thu Mar 03, 2016 10:26 pm    Post subject: Reply with quote

Master

Joined: 17 Jun 2011
Posts: 289
Location: Tamil Nadu, India

Hi, please provide more information.
1. what is the version of IIB(WMB) you are using?
2. are you using Message Model for CSV conversion(MRM or DFDL)?
Back to top
View user's profile Send private message
6FA
PostPosted: Thu Mar 03, 2016 10:42 pm    Post subject: Reply with quote

Novice

Joined: 08 Jan 2016
Posts: 21

Hi Simbu,

1. I'm using IIB 9.0.0.3
2. I'm using DFDL
Back to top
View user's profile Send private message
Simbu
PostPosted: Thu Mar 03, 2016 11:53 pm    Post subject: Reply with quote

Master

Joined: 17 Jun 2011
Posts: 289
Location: Tamil Nadu, India

you have to apply decimal pattern to this field in DFDL. please refer the DFDL specification document. https://www-01.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.dfdl.spec.doc/dfdl_index.htm?lang=en
Back to top
View user's profile Send private message
6FA
PostPosted: Fri Mar 04, 2016 12:27 am    Post subject: Reply with quote

Novice

Joined: 08 Jan 2016
Posts: 21

Hi simbu,

Thanks for the help.

I resolved it by adding ".00" to the input value
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Mar 04, 2016 5:24 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

6FA wrote:
Hi simbu,

Thanks for the help.

I resolved it by adding ".00" to the input value

That's the wrong way to resolve it. DFDL has a template for this, use it!
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
6FA
PostPosted: Fri Mar 04, 2016 5:30 am    Post subject: Reply with quote

Novice

Joined: 08 Jan 2016
Posts: 21

Hi...,

Quote:
That's the wrong way to resolve it. DFDL has a template for this, use it!


How can I do it with DFDL?

can you suggest me the scenario.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Mar 04, 2016 5:38 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

6FA wrote:
Hi...,

Quote:
That's the wrong way to resolve it. DFDL has a template for this, use it!


How can I do it with DFDL?

can you suggest me the scenario.

When you define a number, there are templates on how that number should be formatted. Use them.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Fri Mar 04, 2016 6:00 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

Quote:
I have an input XML value like 16.60. After passing it through SOAP request I'm getting this value as 16.6
That's what you *should* get. 16.60 is one of an infinite number of ways in which the value 16.6 could be represented. The message tree holds logical values, not physical representations of values.
Quote:
I resolved it by adding ".00" to the input value
That's a hack, not a resolution of your problem. You should not try to control the physical representation using the logical message tree. As others have said, the DFDL model describes the physical representation of your CSV format.

Look in the DFDL editor and find the definition of this number. Set the Number Pattern property to #0.00.
Back to top
View user's profile Send private message
6FA
PostPosted: Fri Mar 04, 2016 7:05 am    Post subject: Reply with quote

Novice

Joined: 08 Jan 2016
Posts: 21

Hi Timber,

Quote:
Set the Number Pattern property to #0.00

Thank you. It is working.
Actually This morning I tried this also, but in message tree it didn't showed as 16.60, It showed as 16.6

Now I checked in file after completion of the flow. Now I saw 16.60


So is this wrong way? I fixed this prob with below code.
DECLARE PriceAmount1 DECIMAL;
SET PriceAmount1 = '.00';
SET PriceAmount = CAST(PartsInventoryLine.ns:UnitPriceAmount AS DECIMAL) + PriceAmount1;


Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Mar 04, 2016 7:43 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

6FA wrote:
Actually This morning I tried this also, but in message tree it didn't showed as 16.60, It showed as 16.6

Now I checked in file after completion of the flow. Now I saw 16.60


Exactly. As my worthy associate pointed out, the message tree always holds the logical value not the physical representation. The logical value of 16.60 is 16.6.

The number pattern property is invoked during serialization to create the physical representation of the message tree. So at this point 16.6 becomes 16.60 as defined by the DFDL.

6FA wrote:
So is this wrong way? I fixed this prob with below code.


IMHO it's certainly not the best way. The DFDL is designed to handle this and if I was the guy 1 year from now who was tasked with making 16.60 look like 16.600 then I'd look in the DFDL first to make the change. I certainly wouldn't thank you for making me trawl through the code for every point you've formatted the output in ESQL.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SOAP Decimal output
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.