Re: Problems generating the client for the ClickandBuy API

Sagara Gunathunga <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <CANzUfzdebnJP84MJ6WB38Hc5UH=C91HFcsv=UaF87zciA-df_g@mail.gmail.com>
As you can see in the error log this is a Xmlbeans specific issue
issue, you can use default ADB or JAXB data binding without any issue.

axis2-1.6.2/bin/wsdl2java.sh -uri
https://api.clickandbuy.com/webservices/pay_1_1_0.wsdl -p
com.clickandbuy.api

axis2-1.6.2/bin/wsdl2java.sh -uri
https://api.clickandbuy.com/webservices/pay_1_1_0.wsdl -p
com.clickandbuy.api -d jaxbri

Thanks !

On Fri, Nov 30, 2012 at 1:55 PM, Christian Kaps
<[email protected]> wrote:
> Hi,
>
> I have problems to generate the client for the ClickandBuy API using
> xmlbeans. The WSDL is located online under the address:
> https://api.clickandbuy.com/webservices/pay_1_1_0.wsdl.
> The command that I use is as follows:
> $AXIS2_HOME/bin/wsdl2java.sh -o clickandbuy-src -uri
> https://api.clickandbuy.com/webservices/pay_1_1_0.wsdl -p
> com.clickandbuy.api -d xmlbeans -s
>
> The output is as follows:
> Using AXIS2_HOME: /data/development/bin/java/axis2/latest
>  Using JAVA_HOME:  /etc/java-config-2/current-system-vm
> Retrieving document at
> 'https://api.clickandbuy.com/webservices/pay_1_1_0.wsdl'.
> Retrieving schema at
> 'https://api.clickandbuy.com/webservices/pay_1_1_0.xsd', relative to
> 'https://api.clickandbuy.com/webservices/pay_1_1_0.wsdl'.
> Retrieving schema at
> 'https://api.clickandbuy.com/webservices/PayTypes_1_1_0.xsd', relative to
> 'https://api.clickandbuy.com/webservices/pay_1_1_0.xsd'.
> Retrieving schema at
> 'https://api.clickandbuy.com/webservices/SOAPTypes_1_1_0.xsd', relative to
> 'https://api.clickandbuy.com/webservices/PayTypes_1_1_0.xsd'.
> [INFO] Resolving schema with publicId
> [http://api.clickandbuy.com/webservices/pay_1_1_0/] and systemId
> [https:/api.clickandbuy.com/webservices/pay_1_1_0.xsd]
> [INFO] Resolving schema with publicId [null] and systemId
> [https:/api.clickandbuy.com/webservices/PayTypes_1_1_0.xsd]
> 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:293)
>         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:50)
>         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:246)
>         ... 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:
> https://api.clickandbuy.com/webservices/pay_1_1_0.xsd:2:1: error: Problem
> parsing referenced XML resource -
> https://api.clickandbuy.com/webservices/PayTypes_1_1_0.xsd:1:1: error:
> Unexpected end of file after null
>         at
> org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:325)
>         ... 8 more
> Caused by: org.apache.xmlbeans.XmlException:
> https://api.clickandbuy.com/webservices/pay_1_1_0.xsd:2:1: error: Problem
> parsing referenced XML resource -
> https://api.clickandbuy.com/webservices/PayTypes_1_1_0.xsd:1:1: error:
> Unexpected end of file after null
>         at
> org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:226)
>         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
>
> If I download the WSDL and the XSD files then I can create the client(after
> fixing an other error; see below). It seems that Axis appends arbitrary data
> to the XSD files during download!? Can this be the case?
>
> The other problem is that Axis stumbled upon a invalid regular expression
> which I think isn't invalid.
> The regular expression 'GMT[+-][012]?\d(:[0-5]\d)?' is malformed: '-' is an
> invalid character range. Write '\-'.
>
> I think the hyphen needn't be escaped in a character set. If you look at the
> http://www.regular-expressions.info/charclass.html under the point
> "Metacharacters Inside Character Classes" there exists an example for this
> case. Both [-x] and [x-] match an x or a hyphen.
>
> I have tested this with 1.6.2 and with trunk.
>
> Best regards,
> Christian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>



-- 
Sagara Gunathunga

Blog      - http://ssagara.blogspot.com
Web      - http://people.apache.org/~sagara/
LinkedIn - http://www.linkedin.com/in/ssagara
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.