Author |
Message
|
HOMETOWN47 |
Posted: Thu Apr 16, 2009 2:30 am Post subject: XML element padding - how to? |
|
|
Apprentice
Joined: 25 Mar 2003 Posts: 34
|
I've got a message set that has been created via the WSDL/XSD import wizard. This has by default set the Default message domain as SOAP and the supported message domains are SOAP and XMLNSC.
Within the message defn I have an element called productId that is defined as type xsd:string.
The logical properties are:
Simple type : xsd:string
Value Constraints: Length - blank, Min -1, Max -18, all other properties default.
How do I set the element so that the field is padded (with '0' character) to the max field length of 18. For example, the Web service call send in the XML element as '123' and I want to send an output message as '000000000000000123' from the message flow. I know that I can do the padding in a compute node the message flow but I'm assuming this can be done in the message set definition....
I've done searches on MQSeries.net to no avail and also trawled the toolkit help. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Apr 16, 2009 12:04 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
XMLNSC uses the facilities of XML schema. XML schema does not provide any such padding facility.
XMLNSC does not use the information in the message set. It only uses the XML schemas which are generated from the mxsd files, and which are deployed in the xsdzip file. So fiddling with message set properties would be a waste of time.
I suggest that you use a Compute node.
...or speak to the team which maintains the downstream application and persuade them not to be so picky about the format of their input XML  |
|
Back to top |
|
 |
Vitor |
Posted: Thu Apr 16, 2009 12:08 pm Post subject: Re: XML element padding - how to? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
HOMETOWN47 wrote: |
How do I set the element so that the field is padded (with '0' character) to the max field length of 18 |
Why? That's not what the schema defines. If it did, the min length would be 18 (and that's not even starting with this padding with zeros). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
HOMETOWN47 |
Posted: Fri Apr 17, 2009 2:11 am Post subject: |
|
|
Apprentice
Joined: 25 Mar 2003 Posts: 34
|
Vitor, schema should be min=18 and max=18 but SAP adapter incorrectly setit as min=1, max=18.
Agree with Kimbert and will do the padding in the ESQL. Is there a simple way of doing this ? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 17, 2009 2:22 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
HOMETOWN47 wrote: |
Vitor, schema should be min=18 and max=18 but SAP adapter incorrectly setit as min=1, max=18.
Agree with Kimbert and will do the padding in the ESQL. Is there a simple way of doing this ? |
Yes. There's a simple ESQL function. |
|
Back to top |
|
 |
|