org.xml.sax.SAXException: WSWS3084E: Error: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. Message being parsed:
Several threads on the topic of "ISD Input with arbitrary XML structure" say to create a single varchar (or longnvarchar) input field, then pass that field to an XML stage.
I'm trying to do the same with an ISD Input based job, and it is does not do what I expected.
I am attempting to write an ISD job that handles input requests like following XML:
Code: Select all
--- begin input XML ---
<Alpha a="RED" requestid="BLUE100">
<List1>
<Beta b="1">red</Beta>
<Beta b="2">blue</Beta>
<Beta b="3">green</Beta>
</List1>
<List2>
<Gamma b="x">orange</Gamma>
<Gamma b="y">cyan</Gamma>
<Gamma b="z">lime</Gamma>
</List2>
</Alpha>
--- end input XML ---
Code: Select all
+--------+-------+--------+
| source | param | color |
+--------+-------+--------+
| beta | 1 | red |
| beta | 2 | blue |
| beta | 3 | green |
| gamma | x | orange |
| gamma | y | cyan |
| gamma | z | lime |
+--------+-------+--------+
Here is the ISD job definition: compiles ok - more details on this job below.
I started out with a file-based version of the job (no ISD stages), which runs fine - more details below.
Code: Select all
ISDinput --> XMLstage ---> xform1----> Funnel---> Sort --> ISDoutput
| /|\
+---> xform2-------------+
John G.
Environment details:
DataStage 8.7.1
$ uname -a
Linux sitdwapp1w106m7 2.6.18-308.4.1.el5 #1 SMP Wed Mar 28 01:54:56 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/*release*
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
test job: this does what I expect; it splits an xml file into two different kinds of records.
I started with a simple read-from-file write-to-file job.
The XMLstage's parser is using an XSD created by the trang utility; that workes just fine.
Code: Select all
ExternalSource
source program: ls "#$data_files#/nested02.xml"
|
\|/
XMLstage
| |
\|/ \|/
xform1 xform2
| |
\|/ \|/
Funnel
|
\|/
Sort
key: source
key: param
|
\|/
SeqFile
TargetFile: #$data_files#/nested02.txt
--- begin file dump ---
$ cat nested02.xml
<Alpha a="RED" requestid="BLUE100">
<List1><Beta b="1">red</Beta><Beta b="2">blue</Beta><Beta b="3">green</Beta></List1>
<List2><Gamma b="x">orange</Gamma><Gamma b="y">cyan</Gamma><Gamma b="z">lime</Gamma></List2>
</Alpha>
</Alpha>
$
$ cat nested02.txt
source param color
beta 1 red
beta 2 blue
beta 3 green
gamma x orange
gamma y cyan
gamma z lime
$
--- end file dump ---
Here is the ISD job definition: compiles ok.
Code: Select all
ISDinput --> XMLstage ---> xform1----> Funnel---> Sort --> ISDoutput
| /|\
+---> xform2-------------+
ISD Input:
xml longnvarchar(4096) // also tried with varchar(4096), same result
ISD deployment: deploys ok. Note that I set the output to array grouping.
I'm coming up empty when I search on "SimpleDeserializer" and the error message in general.
Note that the ISD web service correctly returns an empty result set (or at least it doesn't blow up) if the <xml> payload is an empty string.
--- begin empty payload example (works ok) ---
Code: Select all
REQUEST:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://NestedService.GreetingApplication.isd.ibm.com/soapoverhttp/">
<soapenv:Header/>
<soapenv:Body>
<soap:nestedOperation>
<arg1>
<xml></xml>
</arg1>
</soap:nestedOperation>
</soapenv:Body>
</soapenv:Envelope>
RESPONSE:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<p139:nestedOperationResponse xmlns:p139="http://NestedService.GreetingApplication.isd.ibm.com/soapoverhttp/">
<nestedOperationReturn xsi:nil="true"/>
</p139:nestedOperationResponse>
</soapenv:Body>
</soapenv:Envelope>
--- begin non-empty payload example (fails) ---
Code: Select all
REQUEST:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://NestedService.GreetingApplication.isd.ibm.com/soapoverhttp/">
<soapenv:Header/>
<soapenv:Body>
<soap:nestedOperation>
<arg1>
<xml>
<Alpha a="RED" requestid="BLUE100">
<List1>
<Beta b="1">red</Beta>
<Beta b="2">blue</Beta>
<Beta b="3">green</Beta>
</List1>
<List2>
<Gamma b="x">orange</Gamma>
<Gamma b="y">cyan</Gamma>
<Gamma b="z">lime</Gamma>
</List2>
</Alpha>
</xml>
</arg1>
</soap:nestedOperation>
</soapenv:Body>
</soapenv:Envelope>
RESPONSE:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring>[b]org.xml.sax.SAXException: WSWS3084E: Error: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. Message being parsed:[/b]</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>