Good day.
Please excuse what I feel to be a very rudimentary post.
I am working on a wireless project to be ran on a PDA.
Therefore I need something small and lightweight.
I have XML data and am using Java and thus need to be able to go back
and forth easily between the two.
Thus JIBX seems to be right up my alley.
The documentation is straight forward and very easy to follow.
However, I can't seem to get the following to work and produce a xml
file.
Any thoughts and help would be more than greatly appreciated.
Java Code:
public void writeTempData(OutboundJob currentJob) {
String technicianNumber = currentJob.getTechnicianID();
try
{
IMarshallingContext mctx =
BindingDirectory.getFactory(OutboundJob.class).createMarshallingContext(
);
mctx.setIndent(4);
java.io.FileOutputStream os = new
java.io.FileOutputStream(RDCCProperties.TEMP_DATA_STORE +
technicianNumber);
mctx.marshalDocument(currentJob, "UTF-8", null, os);
os.close();
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
Xml binding file:
<binding>
<mapping name="currentJob"
class="com.jbhunt.rdcc.application.OutboundJob">
<value name="jobStatus" field="_jobStatus"/>
<value name="jobID" field="_jobID"/>
<value name="jobType" field="_jobType"/>
<value name="technicianID" field="_technicianID"/>
<value name="inventoryLocation" field="_inventoryLocation"
usage="optional"/>
<value name="inspectionRepairLocation"
field="_inspectionRepairLocation" usage="optional"/>
<value name="accountCode" field="_accountCode" usage="optional"/>
<value name="jobCode" field="_jobCode" usage="optional"/>
<value name="cause" field="_cause" usage="optional"/>
<value name="jobPosition" field="_jobPosition" usage="optional"/>
<value name="damagePosition" field="_damagePosition"
usage="optional"/>
<value name="damagedArea" field="_damagedArea" usage="optional"/>
<value name="correctionCode" field="_correctionCode"
usage="optional"/>
<value name="condition" field="_condition" usage="optional"/>
<value name="workPerformed" field="_workPerformed"
usage="optional"/>
</mapping>
</binding>
After compiling with the binding compiler there are no errors.
However, when I run the following:
OutboundJob myJob = new OutboundJob("new", "EDRInspection", "10234523");
System.out.println("current tech id is " + myJob.getTechnicianID());
myData.writeTempData(myJob);
There is no xml file generated at the specified location.
Thank everyone in advance for the help.
Cheers,
Damon
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id040&op=click
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users