I was finally able to get past the WSDL2Java exception and managed to get a web service running that utilized nested objects, nested schema files and nested binding files. However, now I find that I can build a web service request using a parent object/type or its children, but never a parent AND one of its children.
Apparently the binding for a parameter must be set to abstract="true" for unwrapping to work properly. However, if another message accepts a child of that parameter, the child must also be declared abstract, which breaks the build for the parent. The following files (click to download) illustrate this issue: 1. http://www.nabble.com/file/p11221735/jibx-nested-1-parentOnly.ZIP jibx-nested-1-parentOnly.ZIP - contains a full build of a web service that assigns a Book to a Course. Both of these parameters are "parents", each containing a object, namely a Subject (unzip 1, then "ant" to build and "ant run" to execute the client). 2. http://www.nabble.com/file/p11221735/jibx-nested-2-childOnly.ZIP jibx-nested-2-childOnly.ZIP - contains deltas to the ZIP file #1 to create a web service that eliminate the message from #1 above, and provides a different message that allows a new Subject to be added (unzip #1 AND #2, then "ant" to build and "ant run" to execute the client). 3. http://www.nabble.com/file/p11221735/jibx-nested-3-parentAndChild-broken.ZIP jibx-nested-3-parentAndChild-broken.ZIP - contains deltas to the ZIP file #1 to create a web service that provides both of these messages. Unfortunately, the web service will not build, since the parent bindings (Book & Course) and the child binding (Subject) cannot both be declared abstract (unzip #1 AND #3, then "ant" to generate the exception). Is there any way to get messages with both "parent" and "child" object parameters to build and work? Also, there are some incompatible differences between binding that work for Axis2/WSDL2Java and those that work directly with JiBX examples. Why is this so? -David ========================================================= Exception generated: generate-client: [echo] Running WSDL2Java task [mkdir] Created dir: C:\backups\20070620-1426-jibx-nested-baseline\temp\client\gen [java] Retrieving schema at 'book.xsd', relative to 'file:/C:/backups/20070620-1426-jibx-nested-baseline/temp/./'. [java] Retrieving schema at 'subject.xsd', relative to 'file:/C:/backups/20070620-1426-jibx-nested-baseline/temp/book.xsd'. [java] Retrieving schema at 'course.xsd', relative to 'file:/C:/backups/20070620-1426-jibx-nested-baseline/temp/./'. [java] Retrieving schema at 'subject.xsd', relative to 'file:/C:/backups/20070620-1426-jibx-nested-baseline/temp/course.xsd'. [java] Retrieving schema at 'subject.xsd', relative to 'file:/C:/backups/20070620-1426-jibx-nested-baseline/temp/./'. [java] Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: Cannot unwrap element {http://ws.sosnoski.com/library/wsdl}addSubject: no abstract mapping definition found for type {http://ws.sosnoski.com/library/types}SubjectInformation (used by element {http://ws.sosnoski.com/library/wsdl}subject) [java] at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:256) [java] at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32) [java] at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21) [java] Caused by: java.lang.RuntimeException: Cannot unwrap element {http://ws.sosnoski.com/library/wsdl}addSubject: no abstract mapping definition found for type {http://ws.sosnoski.com/library/types}SubjectInformation (used by element {http://ws.sosnoski.com/library/wsdl}subject) [java] at org.apache.axis2.jibx.CodeGenerationUtility.unwrapMessage(CodeGenerationUtility.java:818) [java] at org.apache.axis2.jibx.CodeGenerationUtility.engage(CodeGenerationUtility.java:382) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:585) [java] at org.apache.axis2.wsdl.codegen.extension.JiBXExtension.engage(JiBXExtension.java:74) [java] at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:209) [java] ... 2 more BUILD FAILED -- View this message in context: http://www.nabble.com/WSDL2Java-Exception-with-nested-binding---schema-files-tf3947855.html#a11221735 Sent from the Axis - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
