Hi,

I'm working with JiBX (or any XML binding tool) for the first time.  My code
generates XML which is going to be passed to webservice hosted by another
company.  I received the xsd from the other company and generated classes
using xsd2jibx and compile them.  I ran the binding compiler on my class
files, and it created a bunch of new class files that look like
"JiBX_package_name_bindingOriginalClassName.class".  There's also a
JiBX_MungeAdapter.class.  Is this the expected results?

I have built a client class to make calls to the webservice and a junit test
class for this client class.  The client class has a createXML method which
uses the JiBX bindings.  I have tried to run the junit class to ensure that
the XML I need is being generated properly.  It looks like this:

    protected String createXMLString(ChangeProductRequest
changeProductRequest)
    throws JiBXException
    {
        String xml = null;

        // marshal object (with nice indentation, as UTF-8)
        IBindingFactory bfact =
BindingDirectory.getFactory(ChangeProductRequest.class);
        IMarshallingContext mctx = bfact.createMarshallingContext();

        mctx.setIndent(0);

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        mctx.marshalDocument(changeProductRequest, "UTF-8", null, out);

        xml = out.toString();

        return xml;
    }

The junit creates an instance of the client class.  However, when I run the
tests, the line:

    IBindingFactory bfact =
BindingDirectory.getFactory(ChangeProductRequest.class);

throws this exception:

(org.jibx.runtime.JiBXException) org.jibx.runtime.JiBXException: Unable to
access binding information for class com.rogers.wam.ChangeProductRequest
Make sure the binding has been compiled

My source files are in a src directory and my class files (including the
JiBX generated classes) are in a separate build directory.  Could this be
what is throwing the exception?  Have I done something else wrong?

Any help is greatly appreciated,
Shelli



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to