|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Error creating Message Set from XSD's |
« View previous topic :: View next topic » |
Author |
Message
|
Gideon |
Posted: Fri Feb 12, 2010 10:39 am Post subject: Error creating Message Set from XSD's |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
I am using WMB 7 on Windows
My requirement is to load in an XSD to validate the incoming XML structure.
I actually have 2 XSD's that define a single XML structure, because the use of Namespaces requires that the XSD is broken up into 2 separate schema files.
I load in the first one using the following path:
Code: |
File -> New -> Message Definition From |
I choose the "XML Schema", enter a preexisting Message Set, and the following file from the file system named c:\patient.xsd
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:app="http://namespacetest.com/app">
<xs:import namespace="http://namespacetest.com/app" schemaLocation="app.xsd"/>
<xs:element name="info">
<xs:complexType>
<xs:sequence>
<xs:element ref="name"/>
<xs:element ref="statementsAddress"/>
<xs:element ref="comment"/>
<xs:element ref="relationshipDate"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="statementsAddress">
<xs:complexType>
<xs:sequence>
<xs:element ref="name"/>
<xs:element ref="street"/>
<xs:element ref="city"/>
<xs:element ref="state"/>
<xs:element ref="zip"/>
<xs:element ref="country"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="street" type="xs:NCName"/>
<xs:element name="city" type="xs:NCName"/>
<xs:element name="state" type="xs:NCName"/>
<xs:element name="zip" type="xs:integer"/>
<xs:element name="country" type="xs:NCName"/>
<xs:element name="comment" type="xs:NCName"/>
<xs:element name="relationshipDate" type="xs:NMTOKEN"/>
<xs:element name="name" type="xs:NCName"/>
</xs:schema> |
The wizard then asks me to select global elements and complex types. THen I click "Finish", and it loads the schema in successfully
In the left hand panel I see the following:
Code: |
+ XSDProject
+ XSDSet
messageSet.mset
+ Message Definitions
+ (default namespace)
+ patient.mxsd |
The patient.mxsd has a red error sign indicating that "The schema directive failed to resolve 'com/namespaceset/app/app.mxsd", but this is to be expected, as I have not yet imported this particular file.
Next I attempt to load the app.xsd file.
I load in the second xsd one using the following path:
Code: |
File -> New -> Message Definition From |
I choose the "XML Schema", enter a preexisting Message Set, and the following file from the file system named c:\app.xsd
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://namespacetest.com/app" xmlns:app="http://namespacetest.com/app">
<xs:import schemaLocation="patient.xsd"/>
<xs:element name="patient">
<xs:complexType>
<xs:sequence>
<xs:element ref="info"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema> |
The wizard then asks me to select global elements and complex types. THen I click "Finish", and I receive the following error:
Code: |
BIP0116E Error creating Message Definition file
Reason:
An error occurred while creating
\XSDSetProject\XSDSet\com\namespaceset\app\app.mxsd
Unable to write to the local file system.
\XSDSetProject\XSDSet\com\namespaceset\app\app.mxsd
Refresh the workspace
Details:
javalang.MullPointerException |
I then see the following in the left hand panel:
Code: |
+ XSDProject
+ XSDSet
messageSet.mset
+ Message Definitions
+ (default namespace)
+ patient.mxsd
+ com.namespacetest.app
+ app.mxsd (red error mark) |
I get 2 errors in the Problems panel:
Code: |
1> Element reference "#info" can not be resolved
2> The schema directive failed to resolve "patient.mxsd" |
I delete the app.mxsd, refresh the workspace and import again in the same manner, but I get the same results
Any ideas ?
Thanks |
|
Back to top |
|
 |
kimbert |
Posted: Fri Feb 12, 2010 11:58 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
This is a documented restriction in the toolkit.
If you are importing two or more 'connected' xsds then you are advised to use the command-line tool 'mqsicreatemsgsets'.
Alternatively, as you only have two xsds, you can open the 'parent' mxsd ( the one which contains the xs:import) and click on the .mxsd file in the Outline view ( it's the root node of the tree view ). In the main editor pane the imports should be displayed. Delete the incorrect import and add a new, correct one.
I've done this many times myself, so I know it works.
The reason, if you're interested, is that the RAD-based xsd tools create a folder structure for the imported xsds which reflects their namespace parts.
If your xsds don't follow the exact same convention, the xs:imports need to be 'fixed up' as they are imported into the toolkit. The command-line tool can do this fix-up, but the single-xsd-at-a-time menu option cannot. |
|
Back to top |
|
 |
Gideon |
Posted: Fri Feb 12, 2010 1:48 pm Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
I am attempting the toolkit fix method.
Both XSD's have an xs:import statement, but I assume the
parent is the app.xsd described previously.
I have the following in the left hand panel:
Code: |
+ XSDProject
+ XSDSet
messageSet.mset
+ Message Definitions
+ (default namespace)
+ patient.mxsd
+ com.namespacetest.app
+ app.mxsd |
I double click on the patient.mxsd, under (default namespace), and see the following:
Code: |
Schema Location: com/amespacetest/app.mxsd
Prefix: app
Namespace: http://namespacetest.com/app |
No errors are shown in this panel, it looks good
Then I go to the parent, app.mxsd, under com.namespace.app
and I see the following:
Code: |
Schema Location: patient.xsd
Prefix: <blank>
Namespace: <blank> |
This one has errors:, so I attempt to fix it as you indicated in your last post.
I click on the "Select" button to the right of the schema location, and I see the following tree:
Code: |
+ XSDSetProject
+ XSDSet
+ com
+ namespacetest
+ app (this is an empty folder)
patient.mxsd (this is a doc,not a folder, at the )
(same level as namespace test )
(under the "com" folder ) |
When I attempt to double clik on the "patient.mxsd", I get
the error: "patient.mxsd is in the same namespace".
Since app.mxsd is in the namespace called
"http://namespacetest.com/app", and patient.mxsd is in the
(default namespace), the toolkit appears to be having
difficulty finding the correct folder.
How do I delete the old import and add the new correct one ?
Thanks |
|
Back to top |
|
 |
kimbert |
Posted: Fri Feb 12, 2010 2:13 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Sorry - I was assuming that the schemas were linked by an xs:import. It must be an xs:include. So add the other xsd as an include, and all should be well. |
|
Back to top |
|
 |
Gideon |
Posted: Mon Feb 15, 2010 8:10 am Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
I am not having any luck with the include statement, so I am trying to use the command line utilities:
I looked them up in the documentation, and found the following utilities:
Code: |
mqsicreatemsgdefs
mqsicreatemsgdefsfromwsdl |
However, when I go to the path "Program Files\IBM\mqsi\7.0\bin", I can not find these utilities
Just for fun, I performed an mqsiprofile, and tried to run the command, but the command can not be found.
How can I get these command line utilities ?
Thanks |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Feb 15, 2010 10:31 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Gideon wrote: |
Code: |
mqsicreatemsgdefs
mqsicreatemsgdefsfromwsdl |
However, when I go to the path "Program Files\IBM\mqsi\7.0\bin", I can not find these utilities |
There are three kinds of mqsi* commands. Runtime, Toolkit, and shared. |
|
Back to top |
|
 |
Gideon |
Posted: Mon Feb 15, 2010 1:24 pm Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
I found the command under the toolkit directory, thanks.
I ran the following command, and received the following output:
Code: |
C:\Program Files\IBM\WMBT700>mqsicreatemsgdefs -p XSDSet -d c:\app -data c:\newflows -rmp -rmd -ns
BIP0116E Error creating Message Definition File.
An error occured while creating \XSDSet\XSDSet\com\namespacetest\app\app.mxsd.
Unable to write to the local file system: \XSDSet\XSDSet\com\namespacetest\app\a
pp.mxsd
Refresh the workspace.
Feb 15, 2010 3:53:40 PM com.ibm.ws.al.ALConfig load()
WARNING: The Artifact Loader cannot load the configuration file META-INF/config.
al.
BIP0225I Command completed.
Refer to file "mqsicreatemsgdefs.report.txt" for details of what was imported. |
I opened the toolkit, refreshed the workspace, closed the toolkit, and performed the command again, but got the same results.
The report.txt file contained the following:
Code: |
Parameter -data (workspace) is "C:\newflows"
Parameter -p (message set project) is "\XSDSet\XSDSet"
Parameter -d (directory of source files) is "c:\app"
Parameter -opt (options file) is "\C:\Program Files\IBM\SDPShared\plugins\com.ibm.etools.msg.importer.cmdline_7.0.0.v20091022_2100\mqsicreatemsgdefs.xml"
Option -rmd (replace existing message definitions of same names) selected
Option -rmp (replace existing project of the same name) selected
Option -ns (namespace aware if creating new message set) selected
Importing file c:\app\app.xsd
BIP0224W The message set has no XML Wire Format layer defined. Only the logical information will appear in the model.
File "c:\app\app.xsd" imported successfully.
Elapsed time processing this message definition file: 2.156 seconds
Number of warnings for this message definition file: 1
Importing file c:\app\patient.xsd
BIP0224W The message set has no XML Wire Format layer defined. Only the logical information will appear in the model.
Changing schema location for import statement "com/namespacetest/app/app.mxsd".
File "c:\app\patient.xsd" imported successfully.
Elapsed time processing this message definition file: 1.032 seconds
Number of warnings for this message definition file: 1
Number of files imported: 2 |
When the command completes, I bring up the toolkit, and it reports that XSDSet folder (Project level), but the folder is empty, and has no items underneath it.
I have 2 questions:
1> I assume that the tool is trying to create a message Set (named XSDSet) on top of the folder. Is that correct
2> What appears to be the issue at this point with getting the command to complete ?
BTW, the 2 XSD's have been valided by other tools. The incoming XML is successfully validated by both XSD's by other tool sets.
Thanks |
|
Back to top |
|
 |
Gideon |
Posted: Tue Feb 16, 2010 7:54 am Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
I changed the mqsicreatemsgdefs.xml file and got slightly better results, but I am still having problems creating the Message set definitions.
I refresh the workspace, and bring down the toolkit.
I perform the following command:
Code: |
C:\Program Files\IBM\WMBT700>mqsicreatemsgdefs -p ZPatSet -d c:\app -data c:\new
flows -rmp -rmd -ns
BIP0116E Error creating Message Definition File.
An error occured while creating \ZPatSet\ZPatSet\com\namespacetest\app\app.mxsd.
Unable to write to the local file system: \ZPatSet\ZPatSet\com\namespacetest\app
\app.mxsd
Refresh the workspace.
Feb 16, 2010 10:17:17 AM com.ibm.ws.al.ALConfig load()
WARNING: The Artifact Loader cannot load the configuration file META-INF/config.
al.
BIP0225I Command completed.
Refer to file "mqsicreatemsgdefs.report.txt" for details of what was imported. |
It seems to be having a problem writing to \ZPatSet\ZPatSet\com\namespacetest\app\app.mxsd
Just for fun, I check the mqsicreatemsgdefs.report.txt and it seems fine, it reports the following:
Code: |
Parameter -data (workspace) is "C:\newflows"
Parameter -p (message set project) is "\ZPatSet\ZPatSet"
Parameter -d (directory of source files) is "c:\app"
Parameter -opt (options file) is "\C:\Program Files\IBM\SDPShared\plugins\com.ibm.etools.msg.importer.cmdline_7.0.0.v20091022_2100\mqsicreatemsgdefs.xml"
Option -rmd (replace existing message definitions of same names) selected
Option -rmp (replace existing project of the same name) selected
Option -ns (namespace aware if creating new message set) selected
Importing file c:\app\app.xsd
BIP0224W The message set has no XML Wire Format layer defined. Only the logical information will appear in the model.
File "c:\app\app.xsd" imported successfully.
Elapsed time processing this message definition file: 3.187 seconds
Number of warnings for this message definition file: 1
Importing file c:\app\patient.xsd
BIP0224W The message set has no XML Wire Format layer defined. Only the logical information will appear in the model.
Changing schema location for import statement "com/namespacetest/app/app.mxsd".
File "c:\app\patient.xsd" imported successfully.
Elapsed time processing this message definition file: 3.64 seconds
Number of warnings for this message definition file: 1
Number of files imported: 2 |
I bring up the toolkit, and the ZPatSet folder is there, but it appears corrupted somehow. The folder is blue, and does not contain any sub-folders. or items.
I look in the workspace using the explorer and I see the following:
Code: |
+ newflows
+ ZPatSet
+ importFiles
. app.xsd
. patient.xsd
+ ZPatSet
+ com
+ namespacetest
+ app
. app.mxsd
. .wmpi21.mxsd
. messageSet.mset
. patient.mxsd
. .project |
The file \ZPatSet\ZPatSet\com\namespacetest\app\app.mxsd seems to be there as a relative path off of the workspace (named newflows).
I use notepad to examine the app.mxsd, and see the following:
Code: |
<?xml version="1.0" encoding="UTF-8"?><xs:schema elementFormDefault="qualified" targetNamespace="http://namespacetest.com/app" xmlns:app="http://namespacetest.com/app" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation="patient.xsd"/>
<xs:element name="patient">
<xs:complexType>
<xs:sequence>
<xs:element ref="info"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
|
Any ideas ?
Thanks |
|
Back to top |
|
 |
Gideon |
Posted: Tue Feb 16, 2010 12:45 pm Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
kimbert wrote: |
This is a documented restriction in the toolkit.
If you are importing two or more 'connected' xsds then you are advised to use the command-line tool 'mqsicreatemsgsets'.
|
Could someone please post a link to this documented restriction, it may help me solve my problem
Thanks |
|
Back to top |
|
 |
kimbert |
Posted: Tue Feb 16, 2010 12:51 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
OK - 'documented' might be the wrong word here.
Regardless, I don't think your problem is in any way connected to the import/include issue. It sounds much more like a problem with the toolkit installation or a defect in the command-line utility.
I stand by my diagnosis of the original problem, by the way. The imports/includes really do need to be manually fixed up if you don't import using the command-line tool. And if your schemas are valid, it should be very simple to do that using the toolkit. |
|
Back to top |
|
 |
Gideon |
Posted: Tue Feb 16, 2010 1:14 pm Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
Is there any documentation that may help me understand how WMB requires the import/include statements need to be coded in oder to satisfy the tool ?
Thanks |
|
Back to top |
|
 |
kimbert |
Posted: Tue Feb 16, 2010 1:17 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Seriously, there's no need for documentation. It's a simple matter of deleting the existing, broken import/include and then adding a correct one. I can tell from your posts that you're easily competent enough to do this - it's a matter of a couple of clicks and the use of the Browse button to locate the imported/included xsd.
If it's not trivial for you, then I suspect that you have a broken toolkit install. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|