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
<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>
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