public void ReceiveXML() {

	              
		try {
			
			// TODO Auto-generated method stub
			Properties env = new Properties( );
			
			 // ... specify the JNDI properties specific to the vendor
	        InitialContext jndi;
	        
	        
			jndi = new InitialContext(env);
			
			QueueConnectionFactory queueConnectionFactory =
	    			(QueueConnectionFactory) jndi.lookup("jms/__defaultConnectionFactory");
	    			
	    	// Look up a JMS Queue
	        Queue textqueue = (Queue) jndi.lookup("textqueue");
	        Queue bytequeue = (Queue) jndi.lookup("bytequeue");
	        
	        
	        // Create a JMS connection
	     		QueueConnection queueConnection = queueConnectionFactory.createQueueConnection();
	     		Session session =  queueConnection.createSession(false,
	     				Session.AUTO_ACKNOWLEDGE);
	     		
	     		queueConnection.start();
	     		while (true)
	     	      {
	     			MessageConsumer TextmessageConsumer = session.createConsumer(textqueue);
	     			MessageConsumer BytemessageConsumer =  session.createConsumer(bytequeue);
	     			
	     			System.out.println(":JMS: In Queue for Messages...");
	     			
	     	        TextMessage textMessage = (TextMessage) TextmessageConsumer.receive();
	     	        BytesMessage byteMessage = (BytesMessage) BytemessageConsumer.receive();
	     	        
	     	        
	     	        if (textMessage != null)
	     	        {
	     	        	s = textMessage.getText();
	    	     		
	    	     		System.out.println(":JMS: Received order: " + s);
	    	  
	     	        }
	     	        if(byteMessage != null){
	     	       	System.out.println(":JMS: Received message with: " + byteMessage.getBodyLength() + 
    	     				" bytes. Now streaming to file on disk.");
    	     		     		
    	     		
    	     		File file = new File(s);
    	     		FileOutputStream fos = new FileOutputStream(file);
    	     		
    	     		BufferedOutputStream outBuf = new BufferedOutputStream(fos);
    	     		
    	     		int i;
    	     		while((i=byteMessage.readInt())!=-1){
    	     		   outBuf.write(i);
    	     		   
    	     		  	     		 	     		  	     		 	     		  
    	     		}
    	     		
    	     		 
    	     		outBuf.close();
    	     		fos.close();
    	     		
    	     		System.out.println(":JMS: File streamed to disk. Size of received file on disk is " + byteMessage.getBodyLength());
    	     		
    	     		System.out.println(":JMS: Sending file over to XML Importer");
	     			
    	    		new XMLOrderImporter(file);

//    	     		mes.processXML(file);
    	     		
    	     		file.delete();
	     	        }
	     	        
	     	      }
	     		    

		} catch (NamingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (JMSException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    		}