Author |
Message
|
junzi88 |
Posted: Wed Sep 25, 2013 4:46 pm Post subject: Strange Namespace after JAXB mashing in Java node |
|
|
Novice
Joined: 25 Sep 2013 Posts: 16
|
I use Toolkit 8.0.0.2 to general JAXB classes by feeding the schema. It does generate package-info.java. After java node I got following message. After SHRCBILL, there is no namespace declaration. If I added another computer node to add, i got
The namespace prefix "xmlns" must not be declared.
I am not sure why "xmlns" becomes prefix in this message. What is my problem? how to fix it?
Code: |
<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/">
<NS1:Body>
<xmlns:SHRCBILL>
<xmlns:SHRCBILLInput>
<xmlns:Shrcbill_type>P</xmlns:Shrcbill_type>
<xmlns:Shrcbill_system>CCC</xmlns:Shrcbill_system>
<xmlns:Shrcbill_company>88</xmlns:Shrcbill_company>
<xmlns:Shrcbill_id>3333333</xmlns:Shrcbill_id>
<xmlns:Shrcbill_bill_type>BILL UPD</xmlns:Shrcbill_bill_type>
<xmlns:Shrcbill_bill_method>EFT</xmlns:Shrcbill_bill_method>
<xmlns:Shrcbill_acct_name>CHASE</xmlns:Shrcbill_acct_name>
</xmlns:SHRCBILLInput>
</xmlns:SHRCBILL>
</NS1:Body>
</NS1:Envelope> |
In the computer node after Java node, I did
SET OutputRoot.SOAP.Body = InputRoot.XMLNSC; It maybe a kind unsafe copy?
But I did same in computer node after Mapping node and it works fine.
Without looping through the message, how can copy InputRoot.XMLNSC message to SOAP domain SOAP.Body? |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 26, 2013 12:23 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
junzi88 |
Posted: Mon Sep 30, 2013 6:02 am Post subject: |
|
|
Novice
Joined: 25 Sep 2013 Posts: 16
|
According to the suggestion, I changed the configuration in the schema elementFormDefault="qualified" to elementFormDefault="unqualified". JAXB portion worked.
However, same schema failed on SOAP Request node itself. I reported the problem with title "problem creating SOAP tree from bitstream" in http://www.mqseries.net/phpBB2/viewtopic.php?p=363642#363642 .
After I changed back schema. SOAP request node is happy now. So I can not change schema and can not use JAXB. The problem for me is that mapping node is very hard to accomplish complicated business logic. What is your suggestion? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Sep 30, 2013 6:05 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
junzi88 wrote: |
The problem for me is that mapping node is very hard to accomplish complicated business logic. What is your suggestion? |
Most people use Compute node. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
junzi88 |
Posted: Mon Sep 30, 2013 6:13 am Post subject: |
|
|
Novice
Joined: 25 Sep 2013 Posts: 16
|
I noticed that computer node either via ESQL or maybe java to compose the message does NOT follow schema. for example, the schema define <sequence>, if I assign fields value order not follow sequence definition, the output is not in the right sequence, which could result error in Client application that use JAXB. However, the schema is complicated, it is hard to make sure the code follow the schema exactly. That's the reason I chose JAXB to insure my response is good bound with schema. Mapping node is good but really hard to map and put logic for over many fields.
Anyway, thanks for the quick reply. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 30, 2013 6:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
lancelotlinc wrote: |
junzi88 wrote: |
The problem for me is that mapping node is very hard to accomplish complicated business logic. What is your suggestion? |
Most people use Compute node. |
Or a Java node, or a .NET node (if on Windows), ...
If your business logic is not a good fit for the Mapping node, fit it somewhere else. This is why IBM have provided a number of options. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 30, 2013 6:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
junzi88 wrote: |
I noticed that computer node either via ESQL or maybe java to compose the message does NOT follow schema. |
Only if you do it wrong in the code. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Sep 30, 2013 6:36 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
junzi88 wrote: |
I noticed that computer node either via ESQL or maybe java to compose the message does NOT follow schema. for example, the schema define <sequence>, if I assign fields value order not follow sequence definition, the output is not in the right sequence, which could result error in Client application that use JAXB. However, the schema is complicated, it is hard to make sure the code follow the schema exactly. That's the reason I chose JAXB to insure my response is good bound with schema. Mapping node is good but really hard to map and put logic for over many fields.
Anyway, thanks for the quick reply. |
The order in which you write the ESQL is the order in which the parser serializes the output. You are the developer. You must write the code in the correct order. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|