On Mon, Mar 10, 2008 at 6:14 AM, Jonathan Joseph <[EMAIL PROTECTED]> wrote:
> Thanks Amila for pointing out the missing 'parts' attribute in the > soap:body of my wsdl:binding. > > 7 out of 9 of my tests are now working. Here are my results thus far > using wsdl2java for ADB, JIBX, XMLBeans data bindings: > > ADB Binding: All my test cases are working for ADB. > ------------ > > > XMLBeans Binding: still have a problem with circular imports. > ------------------ > Amila, I don't quite understand how to proceed. What is the -Ewdc > option? I tried the -Ewdc wsdl2java option using the same import > declaration for the xmlschema that causes circular references, and got > the same error for circular imports (Duplicate global type). > Sorry I forgot to mention. This feature only available with the nightly builds. I added this feature after Axis2 1.3. There were > no classes, under the build/service/classes directory due to the error. > I've compiled the xmlschemas via scomp, but am not sure on how to proceed. if you use a nightly build then when you use the -Ewdc with wsdl2java tool it would generate the code with some dummy classes for XMLbeans data binding. Then you can replace these classes with the above generated code. thanks, Amila. > Results: > java.lang.RuntimeException: org.apache.xmlbeans.XmlException: > project://local/StockQuoteA.xsd:17:5: error: sch-props-correct.2: > Duplicate global type: [EMAIL PROTECTED] > (Original global type found in file: null) > > > JIBX Binding: still have problem with the 2 part message declartion > (which works with ADB binding) > --------------------- > Test Case 1: soap header declaration, using a <wsdl:part> element from > a <wsdl:message> element that contains 2 <wsdl:part> elements. > Results: > Exception in thread "main" > org.apache.axis2.wsdl.codegen.CodeGenerationException: > java.lang.RuntimeException: No mapping defined for element > {http://quickstart.samples/xsd}myHeader<http://quickstart.samples/xsd%7DmyHeader> > > Relevant parts of the WSDL: > <wsdl:definitions xmlns:axis2="http://quickstart.samples/" > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" > xmlns:ns="http://quickstart.samples/xsd" > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > targetNamespace="http://quickstart.samples/"> > <wsdl:types> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > attributeFormDefault="qualified" > elementFormDefault="qualified" > targetNamespace="http://quickstart.samples/xsd"> > > <xs:element name="myHeader" type="xs:string"/> > etc. > </wsdl:types> > > <wsdl:message name="getPriceMessage"> > <wsdl:part name="myHeaderMessagePart" element="ns:myHeader"/> > <wsdl:part name="part1" element="ns:getPrice"/> > </wsdl:message> > > <wsdl:binding name="StockQuoteServiceSOAP11Binding" > type="axis2:StockQuoteServicePortType"> > <soap:binding transport="http://schemas.xmlsoap.org/soap/http" > style="document"/> > <wsdl:operation name="getPrice"> > <soap:operation soapAction="urn:getPrice" style="document"/> > <wsdl:input> > <soap:header message="axis2:getPriceMessage" > part="myHeaderMessagePart" use="literal"/> > <soap:body use="literal" parts="part1" > namespace="http://quickstart.samples/"/> > </wsdl:input> > etc > </wsdl:binding> > > > Amila Suriarachchi wrote: > > > > > > On Sat, Mar 8, 2008 at 3:39 AM, <[EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]>> wrote: > > > > I'm trying to use wsdl2java from the Axis2 v1.3 distribution to > > generate soap headers, and import xml schemas via either jibx or > > xmlbeans databinding. I've run into some limitations using > wsdl2java > > and wanted to confirm my findings. All my tests used the > > StockQuoteService wsdl provided in the quickstartjibx and > > quickstartxmlbeans examples. > > > > 1) Test Results for more than one <part> element per <message> > > element: > > -jibx: obtained the following error. > > Caused by: org.apache.axis2.AxisFault: message > > > > {http://quickstart.samples/}myHeaderMessage<http://quickstart.samples/%7DmyHeaderMessage> > > <http://quickstart.samples/%7DmyHeaderMessage> not found in the WSDL > > -xmlbeans: obtained the following error. > > Caused by: > > > org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException: > > More than one part for message > > getPriceMessage > > > > > > This is because of the problem I mentioned earlier. > > > > > > > > > > 2) Test Results for Cirular imports in a wsdl, where xml schema A > > imports schema B, which imports the original schema A: > > -jibx: didn't try. xml schema is complicated. > > -xmlbeans: Get 'Duplicate global element' Error. > > Caused by: org.apache.xmlbeans.XmlException: > > project://local/AlertInfrastructureTransactions.xsd:14:5: error: > > sch-props-correct.2: Duplicate global element: > > [EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]> (Original > > global > > element found in file: null) > > > > > > Try this. > > When generating the code with wsdl2java tool use -Ewdc option. This > > would generate some dummy classes for Xml beans. > > > > Then generate the Xmlbeans classes with the scomp tool comes with the > > Xmlbeans distribution. > > > > Then replace the above dummy classes with the latter generated data > > bind classes. > > > > > > > > > > > > 3) Test Results for soap headers added to binding. > > -jibx: Get mapping error when <soap:header ...> is added to > binding. > > Exception in thread "main" > > org.apache.axis2.wsdl.codegen.CodeGenerationException: > > java.lang.RuntimeException: No mapping defined for element > > > > {http://quickstart.samples/xsd}myHeader<http://quickstart.samples/xsd%7DmyHeader> > > <http://quickstart.samples/xsd%7DmyHeader> > > -xmlbeans: works, as long as there is a separate 1 part message > for > > the header. > > > > > > even for headers you have to specify the part of the message to be used > > <wsdl:operation name="Test"> > > <soap:operation soapAction="Test"/> > > <wsdl:input> > > <soap:body use="literal" parts="RequestMsg"/> > > <soap:header use="literal" part="HeaderMsg" > > message="tns:HeaderMsg"/> > > </wsdl:input> > > <wsdl:output> > > <soap:body use="literal"/> > > </wsdl:output> > > </wsdl:operation> > > > > thanks, > > Amila. > > > > > > > > Based on these findings, I plan to use xmlbeans databinding and pass > > the xml documents as string parameters, then use xmlbeans to create > > the binding objects in the invoked service method. > > > > Has anyone run into the issues cited above or had different > > experiences? > > > > Thanks, > > Jonathan > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: [EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]> > > > > > > > > > > -- > > Amila Suriarachchi, > > WSO2 Inc. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Amila Suriarachchi, WSO2 Inc.