| Author | 
		  Message
		 | 
		
		  | er_pankajgupta84 | 
		  
		    
			  
				 Posted: Fri Nov 14, 2008 3:59 am    Post subject: Blob to Meaning ful string conversion | 
				     | 
			   
			 
		   | 
		
		
		    Master
 
 Joined: 14 Nov 2008 Posts: 203 Location: charlotte,NC, USA 
  | 
		  
		    
			  
				I am having 3 nodes in my flow:
 
 
MQInput    -> Java compute  --> soap request.
 
 
I am accepting a message from a queue and then using the payload of that message i am creating another message which i need to send to a web service.
 
 
The problem here is that the message that i receive from MQInput node has blob as payload and when i copy paste this in the other message (SOAP) and send it to a web service. The webservice will treat this blob characters as string. 
 
 
I cannot use any RCD in the flow or do some parsing on the input queue.
 
 
The only option i can see is to convert blob payload back to readable and meaningful form so that i can send that message to soap request node.
 
 
I have tried the option of converting blob to Hex string using the below mentioned code:
 
 
byte[] b = inroot.getFirstElementByPath("BLOB/BLOB").getValue().getBytes();
 
String result = "";
 
  for (int i=0; i < b.length; i++) {
 
    result +=
 
          Integer.toString( ( b[i] & 0xff ) + 0x100, 16).substring( 1 );
 
  }
 
  
 
 but the variable "result" is again meaningless for a webservice.
 
 
Can someone guide... | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | m4c0 | 
		  
		    
			  
				 Posted: Fri Nov 14, 2008 5:11 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Novice
 
 Joined: 07 Nov 2008 Posts: 17
  
  | 
		  
		    
			  
				I think I didn't understand. You receive a BLOB message from MQ. Is this message binary? If so, you need to encode it to pass to a WS. Try using base64.
 
 
BTW, what does the Java compute node do? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kimbert | 
		  
		    
			  
				 Posted: Fri Nov 14, 2008 5:15 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 29 Jul 2003 Posts: 5543 Location: Southampton 
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	| I cannot use any RCD in the flow or do some parsing on the input queue. | 
   
 
Why not? Please explain what the message flow is trying to do. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | er_pankajgupta84 | 
		  
		    
			  
				 Posted: Fri Nov 14, 2008 5:33 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Master
 
 Joined: 14 Nov 2008 Posts: 203 Location: charlotte,NC, USA 
  | 
		  
		    
			  
				| I resolved the problem aniways thanks...for your reply | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | m4c0 | 
		  
		    
			  
				 Posted: Fri Nov 14, 2008 5:41 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Novice
 
 Joined: 07 Nov 2008 Posts: 17
  
  | 
		  
		    
			  
				
   
	| er_pankajgupta84 wrote: | 
   
  
	| I resolved the problem aniways thanks...for your reply | 
   
 
 
 
Ermm... Can you tell us how?    | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | rajeevreddy | 
		  
		    
			  
				 Posted: Tue Dec 02, 2008 5:16 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 07 Sep 2004 Posts: 39
  
  | 
		  
		    
			  
				Can u explain how you have resolved the issue.
 
thx sashi | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |