ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » using namespace definitions from library across ESQL schema

Post new topic  Reply to topic
 using namespace definitions from library across ESQL schema « View previous topic :: View next topic » 
Author Message
touchofcrypticthunder
PostPosted: Sat Aug 11, 2012 7:12 am    Post subject: using namespace definitions from library across ESQL schema Reply with quote

Apprentice

Joined: 08 Jul 2009
Posts: 30

I am working on Message Broker V7. I am facing an issue to access namespace definitions from common library across ESQL schema.

Let us assume, we have all the namespace definitions in Namespace.esql defined under schema 'common'. I would like to access these namespace definitions in message flow ESQL modules defined under different schemas say for ex, default schema. I tried using PATH clause which did not help.

I would like to know if there is a way to access namespace definitions across schema OR if this is not supported in Message Broker at all. Your help is greatly appreciated.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Aug 11, 2012 8:43 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20703
Location: LI,NY

It should be possible in a kind of roundabout way.

Store all the namespace declarations as CHAR with a nickname
Have a simple function that returns the value when called for the nickname


Then in your code
Code:
DECLARE myns CHARACTER CALL getns('myns');
DECLARE nsmyns NAMESPACE myns;


This is the same kind of workaround I used with the ns declared in a UDP.

Hope this helps some
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
touchofcrypticthunder
PostPosted: Sat Aug 11, 2012 10:38 am    Post subject: Reply with quote

Apprentice

Joined: 08 Jul 2009
Posts: 30

Thanks for the workaround solution. Below is the solution which I have implemented.

Following is the code to declare and return namespace as character:

BROKER SCHEMA common

CREATE FUNCTION getNamespace(IN inVal CHARACTER) RETURNS CHARACTER
BEGIN
DECLARE namespaceStorage ROW;
SET namespaceStorage.List[] = LIST { ROW('nsSoapEnv' AS nsName, 'http://schemas.xmlsoap.org/soap/envelope/' AS nsValue),
ROW('nsWorkOrd' AS nsName, 'http://tbccorp.com/Services/WorkOrderMgt/v1/' AS nsValue)
};

RETURN (THE(SELECT ITEM NS.nsValue FROM namespaceStorage.List[] AS NS WHERE NS.nsName = inVal));
END;

Following is the code to get namespace as CHARACTER and use for constructing output message:

DECLARE nsSoapChar CHARACTER common.getNamespace('nsSoapEnv');
DECLARE nsWorkOrdChar CHARACTER common.getNamespace('nsWorkOrd');
DECLARE nsSoap NAMESPACE nsSoapChar;
DECLARE nsWorkOrd NAMESPACE nsWorkOrdChar;

SET OutputRoot.XMLNSC.nsSoap:Envelope.nsSoap:Body.nsWorkOrd:Employee.Name = 'x';
Back to top
View user's profile Send private message
touchofcrypticthunder
PostPosted: Sat Aug 11, 2012 10:42 am    Post subject: Reply with quote

Apprentice

Joined: 08 Jul 2009
Posts: 30

Please suggest if your solution is different from the one mentioned below.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Sat Aug 11, 2012 11:27 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I'd think yo could refer to the namespace directly using
Code:
common.nsSoapCharacter
.

i.e. something like
Code:

SET OutputRoot.XMLNSC.{common.nsSoap}:Envelope.{common.nsSoap}:Body.{common.nsWorkOrd}:Employee.Name = 'x';


but I've not run experiments.
Back to top
View user's profile Send private message
touchofcrypticthunder
PostPosted: Sat Aug 11, 2012 7:44 pm    Post subject: Reply with quote

Apprentice

Joined: 08 Jul 2009
Posts: 30

I have tried this option before. It does not work and it throws exception during deployment saying the reference to the namespace is not defined.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » using namespace definitions from library across ESQL schema
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.