Results 1 to 1 of 1
  1. #1
    Buglish is offline Member
    Join Date
    Jun 2008
    Posts
    2
    Rep Power
    0

    Default JAXB unmarshall not responding (help needed)

    Hi,
    I have mannually generated the java classes used in marshalling.
    The package file :
    www
    .
    yourfilelink.com/get.php?fid=464413

    (copy from www to 464413)
    When running the marhsalling section it stoppes processing when unmarshalling (JAXBElement)without any errors or notifications.

    XML to be parsed can be
    Java Code:
    <icb_ws>
        <register>
            <userdata>
                    <username>n00b</username>
                    <password>1234</password>
                    <firstname>n00b</firstname>
                    <lastname>kiddy</lastname>
                    <email>noob( at )yahoo.com</email>
                    <country>South Africa</country>
                    <mobile>+27820000000</mobile>                
            </userdata>    
        </register>    
    </icb_ws>
    OR
    <icb_ws>
        <login>
            <username>n00b</username>
            <password>n00b</password>
        </login>
    </icb_ws>
    OR
    <icb_ws>
        <msg user_id="101">
            <data>Hello, how are you?</data>        
        </msg>    
    </icb_ws>
    Java Code:
     				
    import icbxml.*;
    				..................
    							   try 
    				{
    				
    					
    					JAXBContext jc = JAXBContext.newInstance( "icbxml" );
    				
    					// create an Unmarshaller
    					Unmarshaller u = jc.createUnmarshaller();
    					outputPipe.connect(inputPipe);						
    						byte[] bytes = xmlData.getBytes();						
    				outputPipe.write(bytes);
    		
    		
    		
    					JAXBElement<?> poElement = 	(JAXBElement<?>)u.unmarshal( inputPipe );
    
    				
    					System.out.println(poElement);
    					ICBXML po = (ICBXML)poElement.getValue();
    					System.out.println(po);
    				
    					Login login = po.getLogin();					
    					displayLogin( login );
    					
    				} 
    				catch( JAXBException je ) 
    				{
    					je.printStackTrace();
    				} 
    				catch( Exception ioe ) 
    				{
    					ioe.printStackTrace();
    				} 
    ...
    
    		 public void displayLogin( Login login ) 
    		 {
    			// display the Login
    			 System.out.println( "I am here??????" );
    			System.out.println( "\t" + login.getUserName() );
    			System.out.println( "\t" + login.getPassword() );				
    			System.out.println( "\t" + login.getLanguage() );
    			 
    		}
    Any help will be appreciated.

    Thanks
    Last edited by Buglish; 06-04-2008 at 12:39 AM.

Similar Threads

  1. help needed!!! :S
    By mark-mlt in forum Networking
    Replies: 1
    Last Post: 04-14-2008, 10:27 AM
  2. Help needed.
    By necro-1000 in forum AWT / Swing
    Replies: 2
    Last Post: 01-12-2008, 12:37 PM
  3. Help Needed
    By pks in forum New To Java
    Replies: 1
    Last Post: 01-09-2008, 01:07 AM
  4. help needed.
    By dirtycash in forum New To Java
    Replies: 3
    Last Post: 12-03-2007, 10:17 PM
  5. How to clone a JAXB object ?
    By simon in forum Advanced Java
    Replies: 1
    Last Post: 07-15-2007, 12:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •