Dennis,
One other thing: after I successfully ran the web service generated by the
library example, I added a simple unmarshall/marshall target to the
build.xml. However, I can't get an XML file containing a Type element to
successfully marshall or unmarshall.
This is the ant target I am using to marshall/unmarshall (based upon your
run target, and added to your existing build.xml):
<target name="run-jibx">
<java classname="test.JiBXTest"
fork="true">
<classpath path="${build-client}/bin"/>
<classpath refid="axis-classpath"/>
<classpath refid="jibx-classpath"/>
<classpath path="${build-client}/lib/shared.jar"/>
<arg value="${build-client}\data.xml"/>
<arg value="${build-client}\out.xml"/>
</java>
</target>
Here is the XML file to be unmarshalled (data.xml):
<?xml version="1.0" encoding="UTF-8"?>
<Type name="java" count="5">About Java</Type>
The test client I am using (based upon an existing JiBX example) is as
follows:
package test;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import org.jibx.runtime.BindingDirectory;
import org.jibx.runtime.IBindingFactory;
import org.jibx.runtime.IMarshallingContext;
import org.jibx.runtime.IUnmarshallingContext;
import com.sosnoski.ws.library.jibx.Type;
public class JiBXTest {
public static void main(String[] args) throws Exception {
IBindingFactory bfact = BindingDirectory.getFactory(Type.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
FileInputStream in = new FileInputStream(args[0]);
Type object = (Type) uctx.unmarshalDocument(in, null);
IMarshallingContext mctx = bfact.createMarshallingContext();
mctx.setIndent(2);
FileOutputStream out = new FileOutputStream(args[1]);
mctx.marshalDocument(object, "UTF-8", null, out);
}
}
and the error generated is:
C:\development\Axis2\jibx-library>ant run-jibx
Buildfile: build.xml
run-jibx:
[java] unmarshalling file:
C:\development\Axis2\jibx-library\client\data.xml
[java] Exception in thread "main" org.jibx.runtime.JiBXException:
No unmarshaller for element "Type" (line 2, col 29)
[java] at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2535)
[java] at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2681)
[java] at test.JiBXTest.main(JiBXTest.java:24)
[java] Java Result: 1
I have successfully run similar tests on some of my other bindings. Any
idea why it may be failing on Type?
-David
--
View this message in context:
http://www.nabble.com/-Axis2--JiBX-unwrapped-with-Fault-example-tf3017807.html#a9939598
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]