| Author | 
		  Message
		 | 
		
		  | bdaoust | 
		  
		    
			  
				 Posted: Wed Dec 17, 2014 10:21 am    Post subject: Referencing Message Tree In Filter Node | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 23 Sep 2010 Posts: 130
  
  | 
		  
		    
			  
				Hello everyone: 
 
 
I'm calling a web service and getting a response back.  In a FILTER node, I want to be able to reference a field within that response, but having trouble doing so. 
 
 
The response looks somewhat like : 
 
 
   
	| Code: | 
   
  
	Message
 
  Properties
 
  HTTPReponseHeader
 
  HTTPRequestHeader
 
  SOAP
 
     Content
 
     Header
 
     Body
 
        ValidateForLineOffReponse 
 
           ValidateForLineOffResult 
 
              IsLineOffAvail (this is a boolvalue) 
 
 | 
   
 
 
So in the FILTER esql right after the SOAP Request node, I'm doing 
 
 
   
	| Code: | 
   
  
	IF Root.Message.SOAP.Body.ValidateForLineOffReponse.ValidateForLineOffResult.IsLineOffAvail is TRUE THEN
 
    RETURN TRUE; 
 
ELSE 
 
    RETURN FALSE; 
 
END IF;  | 
   
 
 
 
Doesn't seem I'm picking up the IsLineOffAvailvalue, it's null, but I know by using the debugger, it does have a value. 
 
 
Any idea?
 
 
Thanks,
 
Brian | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Wed Dec 17, 2014 10:30 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				| You're not using namespaces. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Wed Dec 17, 2014 10:30 am    Post subject: Re: Referencing Message Tree In Filter Node | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
 
 
Is the element in a namespace the debugger isn't showing but the ESQL is honouring? _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bdaoust | 
		  
		    
			  
				 Posted: Wed Dec 17, 2014 10:48 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 23 Sep 2010 Posts: 130
  
  | 
		  
		    
			  
				
   
	| Code: | 
   
  
	Message 
 
  Properties 
 
  HTTPReponseHeader 
 
  HTTPRequestHeader 
 
  SOAP 
 
     Content 
 
     Header 
 
     Body 
 
        ValidateForLineOffReponse 
 
           ValidateForLineOffResult 
 
              IsLineOffAvail (this is a boolvalue)  | 
   
 
 
 
Under ValidateForLineOffResponse there is 
 
      xmlns  with a value of http://abc.com | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Wed Dec 17, 2014 11:03 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| bdaoust wrote: | 
   
  
	Under ValidateForLineOffResponse there is 
 
      xmlns  with a value of http://abc.com | 
   
 
 
 
Exactly. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bdaoust | 
		  
		    
			  
				 Posted: Wed Dec 17, 2014 1:10 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 23 Sep 2010 Posts: 130
  
  | 
		  
		    
			  
				Thank you.  I was able to get the correct syntax after doing a trace. 
 
 
I can't get my head around why you have to explicitly refer to the namespace for each element you are going after.  I would think if they are all siblings, you shouldn't have to.  
 
 
Have a great night. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Wed Dec 17, 2014 1:11 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				
   
	| bdaoust wrote: | 
   
  
	| I can't get my head around why you have to explicitly refer to the namespace for each element you are going after.  I would think if they are all siblings, you shouldn't have to.   | 
   
 
 
Because that's how Broker builds the message tree, and how you have to access it... | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Wed Dec 17, 2014 1:28 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| bdaoust wrote: | 
   
  
	| I can't get my head around why you have to explicitly refer to the namespace for each element you are going after.  I would think if they are all siblings, you shouldn't have to.   | 
   
 
 
 
Each element of an XML document is in a namespace or not. If the element is not in a namespace (like ValidateForLineOfResponse) then it's called ValidateForLineOfResponse. If it's in a namespace, then it's called abc.com:IsLineOffAvail and that's the name you have to use. If it's a sibling of another element that happens to be in the same namespace, so what? You can mix and match namespaces in a document; they exist so you can have 2 distinct elements foo.com:jim & bar.com:jim in the same document.
 
 
This is W3C not broker. 
 
 
Also, the way you've written it, the 3 elements in the body are not siblings, but children of each other. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |