Author |
Message
|
bobbee |
Posted: Thu Jul 09, 2015 7:56 am Post subject: namespace does not exist |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
I am trying to grab a complex type in my DFDL. It is named Header_01. I see it after the CREATE..PARSE and I se it after the SET. this is the error I am getting upon executing the 'SET vAcctNum '. I copied this from another post on isolating a complex type, but there were no namespaces in the example.
Text:CHARACTER:CTDU4001E: Root element 'Header_01' in namespace '' does not exist.
CODE:
DECLARE parseOptions INTEGER BITOR(ValidateContentAndValue, ValidateException, ValidateComplete);
DECLARE vAcctNum CHARACTER;
CREATE LASTCHILD OF Environment.Variables DOMAIN 'DFDL';
SET Environment.Variables.DFDL.Header_01 = Environment.DFDL.ns14:EDI_DC_COMPRESSED.HEADER_01;
SET vAcctNum = CAST(ASBITSTREAM(Environment.Variables.DFDL.Header_01
-- OPTIONS parseOptions
ENCODING InputRoot.MQMD.Encoding
CCSID InputRoot.MQMD.CodedCharSetId
TYPE '{}:HEADER_01')
AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId); |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 09, 2015 9:12 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Do you have a definition of Header_01 as a DFDL message without a namespace?
And I mean here Message, not Global Element or Structure / Group  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bobbee |
Posted: Thu Jul 09, 2015 12:43 pm Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
That was a good suggestion.
I looked and I certainly had XSD's with HEADER-01 defined without NAMESPACE. I had none of these deployed and was not using them I am a suspicious type of person So i deleted them from my workspace and I deleted all flow and resources from the EG. I the rebuilt and redeployed my bars.
The problem is still there.
I have no Global or Groups defined in any of the XSD's |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 09, 2015 2:40 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I am trying to grab a complex type in my DFDL. |
You cannot use a complex type as a root element. You *must* use a global element.
Create a global element based on your complex type, and use that instead. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 10, 2015 1:49 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
Hummm, gone but not forgotten!!!!!
So, first, I will look into the global suggestion, thanks. Maybe that is my issue.
Second, I did the following changes and lost the namespace issue, but I also lost the CHARACTERS. What ends up in headerCHAR is not NULL but is sez CHARACTER and nothing is there. I commented out CREATE DOMAIN and TYPE. I know it is not right, but we were attempting to get past the namespace error.
Just to say, I am an old programmer, 40 years. Been through alot of languages. In all those languages I have never seen such a simple thing be so difficult. This is a typical programming use case. 'MOVE Group to A.' I have been tempted many times to just redefine a new XSD removing the groups, but I always believe....do it right and don't bang the nail in with the screwdriver handle, get the hammer.' Thanks for your help. We are a team of three and the other two are developers. We all, are having issues with this. "There is a solution out there!"
CREATE LASTCHILD OF OutputRoot DOMAIN('BLOB');
DECLARE parseOptions INTEGER BITOR(ValidateContentAndValue, ValidateException, ValidateComplete);
DECLARE headerCHAR CHARACTER;
-- CREATE LASTCHILD OF Environment.Variables DOMAIN 'DFDL';
SET Environment.Variables.DFDL.Header_01 = Environment.DFDL.ns14:EDI_DC_COMPRESSED.EDI_DC_HEADER_01_COMP;
SET headerCHAR = CAST(ASBITSTREAM(Environment.Variables.DFDL.Header_01
-- OPTIONS parseOptions
CCSID InputRoot.Properties.CodedCharSetId
ENCODING InputRoot.Properties.Encoding)
-- TYPE '{}:EDI_DC_HEADER_01_COMP')
AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId
ENCODING InputRoot.Properties.Encoding); |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 10, 2015 2:25 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
I took EDI_DC_HEADER_01_COMP and mde it a global element by right clicking on it in the editor and clicking 'make local element Global' I saw it moved to the Global elements section. In the code assist I see it added a namespace to the front of the complex element. I got this again running the code below.
Text:CHARACTER:CTDU4001E: Root element 'Header_01' in namespace '' does not exist.
CREATE LASTCHILD OF OutputRoot DOMAIN('BLOB');
DECLARE parseOptions INTEGER BITOR(ValidateContentAndValue, ValidateException, ValidateComplete);
DECLARE headerCHAR CHARACTER;
CREATE LASTCHILD OF Environment.Variables DOMAIN 'DFDL';
SET Environment.Variables.DFDL.Header_01 = Environment.DFDL.ns14:EDI_DC_COMPRESSED.ns14:EDI_DC_HEADER_01_COMP;
SET headerCHAR = CAST(ASBITSTREAM(Environment.Variables.DFDL.Header_01
-- OPTIONS parseOptions
CCSID InputRoot.Properties.CodedCharSetId
ENCODING InputRoot.Properties.Encoding
TYPE '{}:EDI_DC_HEADER_01_COMP')
AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId
ENCODING InputRoot.Properties.Encoding); |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 10, 2015 2:27 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
It is interesting it is giving me the namespace
error on Environment.Variables.DFDL.Header_01. Do i need one here?????? |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 10, 2015 4:28 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
I changed some things around. This is the code I ran on my last test.
IF InputRoot.MQRFH2.usr.iDOCType = 'EDI_DC' THEN
CREATE LASTCHILD OF OutputRoot DOMAIN('DFDL')
PARSE(InputRoot.BLOB.BLOB CCSID 1208 ENCODING 273
TYPE '{http://www.ibm.com/dfdl/SAP/IDoc/ALE}:EDI_DC_COMPRESSED');
ELSE
CREATE LASTCHILD OF OutputRoot DOMAIN('DFDL')
PARSE(InputRoot.BLOB.BLOB CCSID 1208 ENCODING 273
TYPE '{http://www.ibm.com/dfdl/SAP/IDoc/ALE}:EDI_DC40_COMPRESSED');
END IF;
DECLARE parseOptions INTEGER BITOR(ValidateContentAndValue, ValidateException, ValidateComplete);
DECLARE headerBLOB BLOB;
DECLARE headerCHAR CHAR;
SET headerBLOB = ASBITSTREAM(OutputRoot.DFDL.ns14:EDI_DC_COMPRESSED.ns14:EDI_DC_HEADER_01_COMP
CCSID InputRoot.Properties.CodedCharSetId
ENCODING InputRoot.Properties.Encoding
TYPE '{}:EDI_DC_HEADER_01_COMP');
SET headerCHAR = CAST(headerBLOB AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId
ENCODING InputRoot.Properties.Encoding);
headerCHAR, after the final statement in that code block contains the following characters which basically contains the entire message, I am trying to just capture EDI_DC_HEADER_01_COMP.
---------------------------------------------------------------------------------------------
headerCHAR:CHARACTER:AP 43700000115 0304MEXTREC001000033699361 BZVCLNT100 ZHVRSP02ZHVRSP 0469DEDI_DC 1000000000227215567740 30ZHVRSP021Z000000156KU0033699361 E ZHVRSPCHG 2 SAPBZV LSBZVCLNT100 20150710121645ZHVRSPZHVRSP02ORDERS02AG 20150609211642 0282DE2EDK010051000000000227215567000001 00000001 004 KRW 1.00000 WCFI 2076081685 02Service Level 2 00554598790351DZ2FDK01 1000000000227215567000002 00000102 2076081685L J STD ??? ?? K0061DZ2FDK12 1000000000227215567000003 00000102 C0065DE2EDK14 1000000000227215567000004 00000002 006000064DE2EDK14 1000000000227215567000005 00000002 007J0067DE2EDK14 1000000000227215567000006 00000002 00800790067DE2EDK14 1000000000227215567000007 00000002 012ZGOR0067DE2EDK14 1000000000227215567000008 00000002 01600790071DE2EDK03 1000000000227215567000009 00000002 002201406190071DE2EDK03 1000000000227215567000010 00000002 012201406180071DE2EDK03 1000000000227215567000011 00000002 022201406180077DE2EDK03 1000000000227215567000012 00000002 025201406180757560071DE2EDK03 1000000000227215567000013 00000002 023201406191040DE2EDKA10031000000000227215567000014 00000002 AG 0055459879 ?? ??? ???? ???? 135010 KR 02-3781-7292 3 000000 11 KO0117DZ2FDKA1 1000000000227215567000015 00001403 992921 766L00 811040DE2EDKA10031000000000227215567000016 00000002 RE 0055459879 ¼¼°üâ°à °Â³²±¸¡¡³ÃÇöµ¿¡¡£·£± 135010 KR 02-3781-7292 3 000000 11 KO0117DZ2FDKA1 1000000000227215567000017 00001603 992921 766L00 811040DE2EDKA10031000000000227215567000018 00000002 RG 0055459879 ¼¼°üâ°à °Â³²±¸¡¡³ÃÇöµ¿¡¡£·£± 135010 KR 02-3781-7292 3 000000 11 KO0117DZ2FDKA1 1000000000227215567000019 00001803 992921 766L00 811040DE2EDKA10031000000000227215567000020 00000002 WE 0055459879 ???? ??? ??? 71 ??? 135010 KR 02-3781-7292 3 . 000000 11 KO0117DZ2FDKA1 1000000000227215567000021 00002003 992921 766L00 811040DE2EDKA10031000000000227215567000022 00000002 ZI 0055459879 ¼¼°üâ°à °Â³²±¸¡¡³ÃÇöµ¿¡¡£·£± 135010 KR 02-3781-7292 3 000000 11 KO0117DZ2FDKA1 1000000000227215567000023 00002203 992921 766L00 810112DE2EDK02 1000000000227215567000024 00000002 001SR2013-921 X14001 201406180112DE2EDK02 1000000000227215567000025 00000002 0022076081685 201406180073DE2EDK02 1000000000227215567000026 00000002 04300410065750085DE2EDK17 1000000000227215567000027 00000002 001DDPDelivered Duty Paid0076DE2EDK18 1000000000227215567000028 00000002 0010 0.0000451DE2EDP010041000000000227215567000029 00000002 0000100010 1.000 EA EA 2389 1 2389 KRW 000 9 ZHTA 102691Standard Y00004Standard - 4 days CN550524DZ2FDP01 1000000000227215567000030 00002903 000010 J ??? ?? 02-3781-7292 2.38 20150609 64.57 IO0105DZ2FDP12 1000000000227215567000031 00002903 A 0000000096DZ2FDPJST 1000000000227215567000032 00002903 SCHDScheduling response received0060DE2EDP020011000000000227215567000033 00002903 0073DE2EDP020011000000000227215567000034 00002903 00500410065750071DE2EDP03 1000000000227215567000035 00002903 002201406180071DE2EDP03 1000000000227215567000036 00002903 035201407040077DE2EDP03 100000000022... |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 10, 2015 4:30 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
The header contains this
AP 43700000115 0304MEXTREC001000033699361 BZVCLNT100 ZHVRSP02ZHVRSP, the rest is the Control Data followed by all the iDoc segments |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 10, 2015 6:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
hi Bobee,
Quote: |
So, first, I will look into the global suggestion, thanks. Maybe that is my issue |
You cannot use a complex type in the TYPE parameter of CREATE...PARSE. You *must* specify a global element. This has been true since v5.0.
For the rest...I cannot recommend strongly enough that you take a debug-level user trace and read it carefully. It does contain some really useful information, that will help you to understand what the DFDL parser is up to. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 10, 2015 7:00 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
I did create the GLOBAL element, I right click on EDI_DC_HEADER_01_COMP and selected 'Make Local Element Global' this did fix the namespace issue. I am still ending up with the whole message being selected and not the Header. Will try the trace. But it is working, just not the way I would have expected. So I am wondering what the trace will show. Thanks. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 10, 2015 7:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
bobbee wrote: |
I changed some things around. This is the code I ran on my last test.
Code: |
IF InputRoot.MQRFH2.usr.iDOCType = 'EDI_DC' THEN
CREATE LASTCHILD OF OutputRoot DOMAIN('DFDL')
PARSE(InputRoot.BLOB.BLOB CCSID 1208 ENCODING 273
TYPE '{http://www.ibm.com/dfdl/SAP/IDoc/ALE}:EDI_DC_COMPRESSED');
ELSE
CREATE LASTCHILD OF OutputRoot DOMAIN('DFDL')
PARSE(InputRoot.BLOB.BLOB CCSID 1208 ENCODING 273
TYPE '{http://www.ibm.com/dfdl/SAP/IDoc/ALE}:EDI_DC40_COMPRESSED');
END IF; |
|
If you only wanted header DC data and not segment data, can you please explain the ELSE branch there?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 10, 2015 8:12 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
There are two iDoc types hitting this flow in BLOB format. One is EDI_DC and the other is EDI_DC40. So this IF asks which one and rebuilds the BLOB back to the FULL DFDL structure. After the DFDL structure is rebuild I was trying to access the HEADER, DC and the the SEGMENTS. I want to access the HEADER and DC as groups. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 10, 2015 8:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Wrong.
On this IF you check for EDI_DC.
The assumption is that everything else is EDI_DC40.
Where are you filtering out EDI_DD and or EDI_DD40 ??
As Kimbert said, define all substructure of EDI_DC / EDI_DC40 that you may need as a message in DFDL.
This allows you to assign it correctly and get the expected output. You could even use a mapping node for that.
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 10, 2015 9:09 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
This is a three tier system of message flows. The first tier accepts messages from SAP, does verification and routs it to the proper mid-tier processing. In the validation step it sez,
If EDI_DC THEN
.
.
.
ELSEIF EDI_DC40 THEN
.
.
.
ELSE Throw exception
END IF.
We are pretty confident all the messages past the first tier are EDI_DC and EDI_DC40.
In fact, I know this message is EDI_DC because the rfc connector setup for my testing is v31h which is EDI_DC. When I get this piece of shit working I will expand and add the code for the EDI_DC40 message processing, what ever that may be.
Now, back to the matter at hand. I have defined structures for bot EDI_DC and EDI_DC40. These guys work in all the ESQL and Mapping nodes I have. This particular message is a custom format of an EDI_DC/EDI_DC40 message expected byt the application. the applications that are receiving this message, although written in BROKER (External system. Are treating the message which is in DBCS and MBCS(s) as bytes. This message is also compressed which means there are lenght modifiers embedded in the message. All this needs to be converted from CHAR to BYTE parsing. I did try to do this in a mapping node but it became tooo complicated. It is much easier in ESQL. So while the form may not be the suggested. It is the direction. I am sure if I was doing this in a mapping node the suggestion would be to do it in ESQL.
So, I need to be able to extract the header which has an explicit length which the DFDL parser certainly know about. Every attempt to get it to do this has failed. I could write a structure definition to define the particular groups to a single string and be done with it. Rather than take the easy, blunt method I am trying to use IIB features that one would expect there. So if ANYBODY has done this, let me know exactly what you did to get this to work. This is not something I have been working on for 30 minutes and game here to cry that I cannot get it to work. I and two other guys have been beating this for over a week. Something so simple is so complicated. Otherwise this is pure conjecture and I will have to revert to the BLUNT method. |
|
Back to top |
|
 |
|