Error while reading XML records from MQ connector stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
svga
Participant
Posts: 73
Joined: Thu Aug 07, 2008 6:31 am
Location: Syracuse

Error while reading XML records from MQ connector stage

Post by svga »

Hi -

I'm getting the below error message while reading XML records from MQ connector stage. This happens when I set the data element in MQ property as XML.

MQ_Connector_ReadXML: ?? (IIS-CONN-WSMQ-000003; Argument uszDataElementName has invalid value XML; CC_WSMQUtil; buildWSMQDataElement(); CC_WSMQUtil.cpp; 1,267)
----------------------

If I dont specify anything in data element, then I can able to read the XML records, but I can't parse it XML input stage and getting the below error.

APT_CombinedOperatorController,0: Fatal Error: Fatal: XML input document parsing failed. Reason: Xalan fatal error (publicId: , systemId: , line: 1, column: 2): Expected an element name

Can you please tell me the root cause for this issue?
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

don't put anything in that data element for the output link, unless it is one of the WMQ type of data elements.

The xml data element has very special purpose, usually for use in an xmlOutput Stage, and is beyond the scope of this discussion. Leave it blank. The message from MQ at this point is nothing more than a long "string".

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
svga
Participant
Posts: 73
Joined: Thu Aug 07, 2008 6:31 am
Location: Syracuse

Post by svga »

Hi -

If I don't specify anything on the data element, I can be able to read the XML records but it doesn't seems to be a valid one. I'm getting the below error message on the XML input stage.

APT_CombinedOperatorController,0: Fatal Error: Fatal: XML input document parsing failed. Reason: Xalan fatal error (publicId: , systemId: , line: 1, column: 2): Expected an element name

Can you please let me know how to save the XML records into the file which comes from queue and make it valid one?
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Sounds like a perfectly normal message --- it possibly has nothing to do with the queue......but it could be getting truncated or something.

Do this:

Write the single message from the MQ Connector to a Sequential Stage. Use Format options of Delimiter=NONE and Quote Character= NONE. Be sure that your single message column from the Connector has a longvarchar type and very long length (say....99999 or bigger).

Find that file. Name it xml and open it in Firefox. Open it in IE or any other browser. Does it work? Can you see it? Is it nicely formatted? If not, or you get an error, then the xml is bad (speak to whoever put it on the queue), or the way you specified the metadata in the Connector is wrong, and the xml content is getting damaged.

If you can see it just fine, then write a Job that reads it. WITHOUT MQ Connector. Make sure that works before you combine things.

Finally, another possibility would be if the document has an xsd, and the document is pointing to that xsd, and the document is truly invalid and "missing" some element.

If so, turn off validation, try a test where you remove the SchemaLocation attribute from the document you saved to disk, and/or speak to the sender.

Ernie
Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Naren12345babu
Premium Member
Premium Member
Posts: 76
Joined: Wed Jan 06, 2016 9:40 am
Location: Bangalore

Post by Naren12345babu »

Hi eostic,

I am trying to implement above method. but I have a problem. Here I cannot save every txt file to xml manually. How can I save the txt to xml automatically.
Thanks
Naren Babu Ch
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

...not sure what you mean. Can you provide more details?
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This conversation should probably be taken over into their actual post on the XML processing they are trying to do: viewtopic.php?t=155792
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply