Author |
Message
|
infotainment |
Posted: Wed Aug 17, 2016 3:50 am Post subject: IIB: Issue in Message Model Scheme Prefix |
|
|
Apprentice
Joined: 18 Apr 2016 Posts: 41
|
We need xsi:schemaLocation attribute in the parent tag of the xml generated from our message model. How can we modify our message model's xsd file, so that after modeling through the xsd file, the generated xml contains the xsi:schemaLocation attribute with a fixed value?
e.g.
Original XML:
<Operation>
<name>CustomerAccountsDetails</name>
<fieldName>CUSTOMER.NO</fieldName>
<value>2594878</value>
</Operation>
Required XML:
<T24 xsi:schemaLocation="http://www.temenos.com/T24/OFSML/130../../xsd/ofsml.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.temenos.com/T24/OFSML/130">
<serviceRequest>
<ofsExtendedEnquiry name="CustomerAccountsDetails">
<selectionCriteria>
<fieldName>CUSTOMER.NO</fieldName>
<value>2594878</value>
</selectionCriteria>
</ofsExtendedEnquiry>
</serviceRequest>
</T24>
We are able to create a xsd model file that can almost generate the above required xml except for the xsi:schemaLocation tag and that's where we need your help. |
|
Back to top |
|
 |
timber |
Posted: Wed Aug 17, 2016 4:02 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
In general, the schemaLocation attribute is just a hint. An XML validator is allowed to completely ignore it if it there is a better way to find the XSD definitions ( i.e. an entity resolver ).
Quote: |
We need xsi:schemaLocation attribute in the parent tag of the xml generated from our message model |
Are you sure that you really need this? What business problem are you trying to solve? |
|
Back to top |
|
 |
infotainment |
Posted: Wed Aug 17, 2016 4:22 am Post subject: |
|
|
Apprentice
Joined: 18 Apr 2016 Posts: 41
|
Target system is taking it as a mandatory attribute and rejecting our XML Request if it does not contain exact name as "xsi:schemaLocation" |
|
Back to top |
|
 |
Vitor |
Posted: Wed Aug 17, 2016 4:33 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
infotainment wrote: |
Target system is taking it as a mandatory attribute and rejecting our XML Request if it does not contain exact name as "xsi:schemaLocation" |
Ask your target system what they're using to parse the XML and when they explain it's something they wrote themselves, tell them to use a proper parser.
As my worthy associate points out, the W3C XML standard doesn't have schemaLocation as a mandatory field. As he also correctly points out, in many cases it's not actually that useful. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
infotainment |
Posted: Wed Aug 17, 2016 4:47 am Post subject: |
|
|
Apprentice
Joined: 18 Apr 2016 Posts: 41
|
Its Leading Banking System product. You are right, this should not be rejected.
Any workaround please? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Aug 17, 2016 5:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
infotainment wrote: |
Its Leading Banking System product. |
What measurement are they using for "leading"
Also I should point out that OFSML isn't a leading product, it's a commonly used message standard & none of the OFSML documentation I've seen refers to this being mandatory; indeed the way this stuff bounces round I'd be a bit nervous pointing to a specific location. How any given product implements this is their business.
infotainment wrote: |
You are right, this should not be rejected. |
Thank you.
infotainment wrote: |
Any workaround please? |
IIB won't add that attribute because it doesn't think you need it or want it. Even if it did, the location would be the location IIB knows; the local copy it's using on the broker file system.
So you need to add it as a fixed string literal pre-transmission. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Aug 17, 2016 5:04 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
An "xsi" field is simply an attribute of the root tag. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
timber |
Posted: Wed Aug 17, 2016 7:10 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
mqjeff is correct.
If you are trying to write some message flow logic to include an xsi:schemaLocation attribute in the output XML, then just do it. It's just an attribute that happens to have the xsi namespace. Look up the xsi namespace URL and write the code.
If you are trying to generate a test message using the IIB toolkit then
a) there are dozens of XML tools out there that could do this for you and
b) you could always add it manually after your chosen tool has generated the rest of the document.
We're somewhat in the dark about what you are trying to accomplish which makes it difficult to offer good advice. |
|
Back to top |
|
 |
infotainment |
Posted: Wed Aug 17, 2016 7:30 am Post subject: |
|
|
Apprentice
Joined: 18 Apr 2016 Posts: 41
|
OFSML is really a native format. Though its XML but not giving XML benefits.
Can you please suggest how to manipulate XML Schema Attributes in IIB so that we may manipulate schema location attribute. |
|
Back to top |
|
 |
infotainment |
Posted: Wed Aug 17, 2016 7:42 am Post subject: |
|
|
Apprentice
Joined: 18 Apr 2016 Posts: 41
|
I just missed last update by timber before i added my query.
Let me share whole case with you guys so that you can suggest accordingly. |
|
Back to top |
|
 |
infotainment |
Posted: Wed Aug 17, 2016 8:13 am Post subject: |
|
|
Apprentice
Joined: 18 Apr 2016 Posts: 41
|
Quote: |
We're somewhat in the dark about what you are trying to accomplish which makes it difficult to offer good advice. |
Ok, So here's the complete flow detail:
our message flow would take an xml as input from MQ and then after modeling it to the OFSML format, would pass it on to the T24 which is the next system maintained by the bank itself.
The problem we are facing is that the bank acquired the services of a vendor to build that T24 system and those vendors did not do a really good job and that's why even if our generated message does not have even the optional parameters, the T24 system rejects our message.
Now as already mentioned on this thread, that T24 system cannot be changed now by the bank and so we have to send the schemaLocation field like it's mandatory.
Quote: |
If you are trying to write some message flow logic to include an xsi:schemaLocation attribute in the output XML, then just do it. It's just an attribute that happens to have the xsi namespace. Look up the xsi namespace URL and write the code. |
We have tried to do that. That model generates the response the same as before. schemaLocation attribute does not become part of the response.
Here's my schema tag for better understanding:
<xsd:schema xsi:schemaLocation="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" id="OFSML-1.3.0-Revision-02" targetNamespace="http://www.temenos.com/T24/OFSML/130" version="OFSML-1.3.0-Revision-02" xml:lang="en" xmlns:xsi="http://www.temenos.com/T24/OFSML/130"> |
|
Back to top |
|
 |
timber |
Posted: Thu Aug 18, 2016 1:03 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Thanks - that's the information that we were missing.
Quote: |
our message flow would take an xml as input from MQ and then after modeling it to the OFSML format |
Actually that's mapping, not modelling. Modelling is creating a model (a schema) for a structure. Mapping is transforming one structure into another structure.
Quote: |
That model generates the response the same as before. schemaLocation attribute does not become part of the response.
Here's my schema tag for better understanding: |
What makes you think that changing the schema will change the message that IIB outputs?
Are you using the Mapping node to create your OFSML output XML? Or are you using ESQL? |
|
Back to top |
|
 |
infotainment |
Posted: Thu Aug 18, 2016 2:10 am Post subject: |
|
|
Apprentice
Joined: 18 Apr 2016 Posts: 41
|
Quote: |
Are you using the Mapping node to create your OFSML output XML? Or are you using ESQL? |
We are using Mapping node for OFSML creation.
Quote: |
What makes you think that changing the schema will change the message that IIB outputs? |
because the message is getting mapped using the schema file and any changes in it would obviously have an effect on the resultant xml.
At this point, we would take any solution that would help us in adding that schemaLocation field in the resultant XML, let it be through Mapping or ESQL or Java |
|
Back to top |
|
 |
timber |
Posted: Thu Aug 18, 2016 2:49 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Thanks. It would have been helpful to have mentioned in your first post that you are using the Mapping node. IIB offers 4 different ways to transform between an input structure and an output structure.
The Mapping node only works with elements and attributes that are declared in the XSD. But you are not allowed to declare attributes from the xsi namepsace in an XSD.
To add this attribute into your output XML, you will need to
- Add a Compute node after your Mapping node
- Write some ESQL to create the xsi:schemaLocation attribute as the last child of OutputRoot.XMLNSC. You will probably want to declare a namespace prefix for the xsi namespace as well, in case the receiving system is picky about prefixes ( it shouldn't care, but it might ).
Post again if you need help with that. |
|
Back to top |
|
 |
|