Author |
Message
|
Galichet |
Posted: Mon Dec 04, 2006 2:44 am Post subject: ESQL Problem using namespace |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 69 Location: Paris - France
|
Hi all,
I'm using WBI V5 and I've a problem trying to generate the following message :
<Parametre>
...<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
......<soapenv:Body>
.........<validerFluxProspect soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
............<arg0 xsi:type="xsd:string">Something</arg0>
.........</validerFluxProspect>
......</soapenv:Body>
...</soapenv:Envelope>
</Parametre>
Someone could help me ? (I'm not used with namespace) _________________ Eric Galichet
SMABTP
France |
|
Back to top |
|
 |
Vitor |
Posted: Mon Dec 04, 2006 2:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
If you could elaborate on the nature of your problem.....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Dec 04, 2006 3:00 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi Galichet,
Please look for code on this forum, you'll find snippets to help you out...
Regards. |
|
Back to top |
|
 |
Galichet |
Posted: Mon Dec 04, 2006 4:38 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 69 Location: Paris - France
|
In fact, my problem is with the esql code ...
I've coded this :
DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE xsd NAMESPACE 'http://www.w3.org/2001/XMLSchema';
DECLARE xsi NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';
DECLARE encodingStyle NAMESPACE 'http://schemas.xmlsoap.org/soap/encoding/';
SET OutputRoot.XMLNS.Parametre.soapenv:Envelope.(XML.NamespaceDecl)xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/';
SET OutputRoot.XMLNS.Parametre.soapenv:Envelope.(XML.NamespaceDecl)xmlns:xsd = 'http://www.w3.org/2001/XMLSchema';
SET OutputRoot.XMLNS.Parametre.soapenv:Envelope.(XML.NamespaceDecl)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance';
SET OutputRoot.XMLNS.Parametre.soapenv:Body.encodingStyle:ValiderFluxProspect.(XML.NamespaceDecl)soapenv:encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
SET OutputRoot.XMLNS.Parametre.soapenv:Body.encodingStyle:ValiderFluxProspect.arg0.(XML.NamespaceDecl)xsi:type = 'xsd.string';
SET OutputRoot.XMLNS.Parametre.soapenv:Body.encodingStyle:ValiderFluxProspect.arg0.(XML.Content) = InputRoot.XML.Msg;
SET OutputRoot.Properties.MessageDomain = 'XMLNS';
But the result is :
<Parametre>
...<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
......<NS1:Body xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/">
.........<NS2:ValiderFluxProspect xmlns:NS2="http://schemas.xmlsoap.org/soap/encoding/" NS1:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<arg0 xmlns:NS3="http://www.w3.org/2001/XMLSchema-instance" NS3:type="xsd.string"/>
.........</NS2:ValiderFluxProspect>
......</NS1:Body>
</Parametre>
I'm still trying to correct this... _________________ Eric Galichet
SMABTP
France |
|
Back to top |
|
 |
Galichet |
Posted: Mon Dec 04, 2006 5:04 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 69 Location: Paris - France
|
Ok, I've seen where was my problem. Now it's working well.
The code looks like this now :
DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE xsd NAMESPACE 'http://www.w3.org/2001/XMLSchema';
DECLARE xsi NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';
DECLARE encodingStyle NAMESPACE 'http://schemas.xmlsoap.org/soap/encoding/';
SET OutputRoot.XMLNS.Parametre.soapenv:Envelope.(XML.NamespaceDecl)xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/';
SET OutputRoot.XMLNS.Parametre.soapenv:Envelope.(XML.NamespaceDecl)xmlns:xsd = 'http://www.w3.org/2001/XMLSchema';
SET OutputRoot.XMLNS.Parametre.soapenv:Envelope.(XML.NamespaceDecl)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance';
SET OutputRoot.XMLNS.Parametre.soapenv:Envelope.soapenv:Body.validerFluxProspect.(XML.NamespaceDecl)soapenv:encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
SET OutputRoot.XMLNS.Parametre.soapenv:Envelope.soapenv:Body.validerFluxProspect.arg0.(XML.NamespaceDecl)xsi:type = 'xsd.string';
SET OutputRoot.XMLNS.Parametre.soapenv:Envelope.soapenv:Body.validerFluxProspect.arg0.(XML.Content) = CAST(InputRoot.BLOB.BLOB AS CHAR CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);
SET OutputRoot.Properties.MessageDomain = 'XMLNS';
However, the 3 firsts line starting with SET are in warning : namespace xmlns is not defined. What can I do correct that ? _________________ Eric Galichet
SMABTP
France |
|
Back to top |
|
 |
kimbert |
Posted: Mon Dec 04, 2006 5:08 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
1. You don't have to set MessageDomain explicitly.
2. Body should be a child of Envelope.
Code: |
SET OutputRoot.XMLNS.Parametre.soapenv:Envelope.soapenv:Body.encodingStyle:ValiderFluxProspect.(XML.NamespaceDecl)soapenv:encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; |
etc...
3. 'xsd:string' not 'xsd.string'
4. What are you trying to do with (XML.Content)? |
|
Back to top |
|
 |
fat_tony |
Posted: Mon Dec 04, 2006 5:23 am Post subject: |
|
|
Novice
Joined: 02 Dec 2006 Posts: 15
|
Quote: |
1. You don't have to set MessageDomain explicitly.
3. 'xsd:string' not 'xsd.string' |
1. Agreed, although to be fair the example in the Help that this ESQL is clearly based on sets this in exactly the same place!
3. Shouldn't xsi:type also be an attribute rather than a namespace declaration? |
|
Back to top |
|
 |
|