axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tibor Strausz <Ti...@rapidsugar.nl>
Subject RE: SOAP encoding for Axis2: Is XMLBeans the only solution?
Date Thu, 14 Apr 2011 07:41:45 GMT
Generating with xmlbeans options should work but you need more jar files on your class path.

I use maven and have this (not sure that they are all needed but it works ;) ):

  <!--START WSDL to JAVA -->
            <plugin>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2-wsdl2code-maven-plugin
             </artifactId>
                <version>1.5.4</version>
                <configuration>
                    <packageName>nl.rapidsugar.kar.bulkimporter.core
             </packageName>
                    <wsdlFile>http://www.karwei.nl/ODS/BouwmarktService?WSDL
             </wsdlFile>
                    <databindingName>xmlbeans</databindingName>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsdl2code</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2</artifactId>
                        <version>1.5.4</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-transport-local</artifactId>
                        <version>1.5.4</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-xmlbeans</artifactId>
                        <version>1.5.4</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-transport-http</artifactId>
                        <version>1.5.4</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.xmlbeans</groupId>
                        <artifactId>xmlbeans</artifactId>
                        <version>2.4.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.ws.commons.axiom</groupId>
                        <artifactId>axiom</artifactId>
                        <version>1.2.11</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.ws.commons.axiom</groupId>
                        <artifactId>axiom-api</artifactId>
                        <version>1.2.11</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.ws.commons.axiom</groupId>
                        <artifactId>axiom-impl</artifactId>
                        <version>1.2.11</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!--END WSDL to JAVA -->

From: fire fox [mailto:fyr3fox@gmail.com]
Sent: donderdag 14 april 2011 9:37
To: java-user@axis.apache.org
Subject: Re: SOAP encoding for Axis2: Is XMLBeans the only solution?

Thanks for the reply Strausz.

       I'm not able to create Stubs using -d xmlbeans option. I could create stubs for the
same WSDL with out xmlbeans option.

Here is the stack trace.

Retrieving document at 'Sugar\Sugar_V1_2.xml'.
Retrieving schema at 'http://schemas.xmlsoap.org/soap/encoding/', relative to 'file:/D:/Temp/axis2/bin/Sugar/Sugar_V1_2.xml'.
Retrieving schema at 'http://schemas.xmlsoap.org/soap/encoding/', relative to 'file:/D:/Temp/axis2/bin/Sugar/Sugar_V1_2.xml'.
[INFO] Resolving schema with publicId [http://schemas.xmlsoap.org/soap/encoding/] and systemId
[http://schemas.xmlsoap.org/soap/encoding/]
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException:
java.lang.reflect.InvocationTargetException
       at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
       at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
       at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
       at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:126)
       at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
       ... 2 more
Caused by: java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:115)
       ... 3 more
Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: http://schemas.xmlsoap.org/soap/encoding/:48:1:
error: sch-props-correct.2: Duplicate global type: Array@http://schemas.xmlsoap.org/soap/encoding/
(Original global type found in file: null)
       at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:325)
       ... 8 more
Caused by: org.apache.xmlbeans.XmlException: http://schemas.xmlsoap.org/soap/encoding/:48:1:
error: sch-props-correct.2: Duplicate global type: Array@http://schemas.xmlsoap.org/soap/encoding/
(Original global type found in file: null)
       at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)
       at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:189)
       ... 8 more


I'm wondering if there is any chance to edit WSDL file, or set some tricky option,  so that
everything works fine without going back to Axis(1).

Thanks.


On Wed, Apr 13, 2011 at 12:19 PM, Tibor Strausz <Tibor@rapidsugar.nl<mailto:Tibor@rapidsugar.nl>>
wrote:
> The diff between adb and xmlbeans for your code is small (as far is a can see)
> I was just playing with it. Here is my code. The first one is adb the one in comment
is xmlbeans:
>
>        log.info<http://log.info>("starting");
>        final Ifundsmw2_111Stub stub = new Ifundsmw2_111Stub();
>
>        Ifundsmw2_111Stub.OpenConnection2Mw2 req = new Ifundsmw2_111Stub.OpenConnection2Mw2();
>
>        req.setCClientLogin("ABC");
>        req.setCClientPwd("ABC");
>
>        Ifundsmw2_111Stub.OpenConnection2Mw2Response result = stub.openConnection2Mw2(req);
>
>        // OpenConnection2Mw2Document openConnection2Mw2Document = OpenConnection2Mw2Document.Factory.newInstance();
>        // openConnection2Mw2Document.addNewOpenConnection2Mw2();
>        // openConnection2Mw2Document.getOpenConnection2Mw2().setCClientLogin("XXXXXX");
>        // openConnection2Mw2Document.getOpenConnection2Mw2().setCClientPwd("DDDDD");
>        // OpenConnection2Mw2ResponseDocument result = stub.openConnection2Mw2(openConnection2Mw2Document);
>        // String result = result.getOpenConnection2Mw2Response().getResult();
>        log.debug(result);
>
>
>
>
>
>
>
> -----Original Message-----
> From: fire fox [mailto:fyr3fox@gmail.com<mailto:fyr3fox@gmail.com>]
> Sent: woensdag 13 april 2011 8:45
> To: axis-dev@ws.apache.org<mailto:axis-dev@ws.apache.org>; java-user@axis.apache.org<mailto:java-user@axis.apache.org>
> Subject: SOAP encoding for Axis2: Is XMLBeans the only solution?
>
> Hi All,
>       When I tried to contact a web-service (SugarCRM) using Axis2, I
> was getting following exception - Unsupported type
> http://schemas.xmlsoap.org/soap/encoding/ Array.
>
> After an exhaustive exploration, I came to know that the only solution
> is to generate stubs using XMLBeans option, or step back to old -
> Axis.
>
> -> I'm just wondering whether that's the only solution or is there any
> tricky setting?
>
> -> I'm worried of it's effect on performance and complexity of implementation.
>
> Reference : http://thiamteck.blogspot.com/2008/12/axis2-wsdl2java-error-for-soap-encoding.html
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org<mailto:java-user-unsubscribe@axis.apache.org>
> For additional commands, e-mail: java-user-help@axis.apache.org<mailto:java-user-help@axis.apache.org>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org<mailto:java-user-unsubscribe@axis.apache.org>
> For additional commands, e-mail: java-user-help@axis.apache.org<mailto:java-user-help@axis.apache.org>
>
>

Mime
View raw message