Re: Problems generating the client for the ClickandBuy API

Sagara Gunathunga <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <CANzUfzdZjKDVHw-xLGwKTf+KNn6ftJT1MiMKxFhx3ACh7U7kow@mail.gmail.com>
On Mon, Dec 3, 2012 at 8:34 PM, andrei <[email protected]> wrote:
> Hi Christian,
>
> I never tried to generate client classes with axis2 before, because I
> successfully used Apache CXF for this purpose. For now I tried the
> generation with axis2 and run into the same troubles described by you.

Well how do you claim the issue with  Axis2 :)

For Axis2 you have used "xmlbeans" as the data binding but for CXF you
tried with "JAXB"[1] not  "xmlbeans" if you use  "xmlbeans" with  CXF
you will end up with same result.

apache-cxf-2.6.2/bin/wsdl2java -db xmlbeans
https://api.clickandbuy.com/webservices/pay_1_1_0.wsdl

WSDLToJava Error: Error generating XMLBeans types
https://api.clickandbuy.com/webservices/PayTypes_1_1_0.xsd:1985:7:
error: pattern-regex: The regular expression
'GMT[+-][012]?\d(:[0-5]\d)?' is malformed: '-' is an invalid character
range. Write '\-'.:
https://api.clickandbuy.com/webservices/PayTypes_1_1_0.xsd[1985,7]


In fact if someone pay little more attention on axis2 error log it is
very straightforward to identify the actual issue with Xmlbeans
itself.

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: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)


If you used Axis2 default databinding (ADB) or jaxbri (which used by
CXF by default) you can generate Axis2 codes successfully.

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


Next time you need to do more home works before you suggest
alternatives on a project specific mailing list.

[1] - https://raw.github.com/martchouk/clickandbuy.api.java/master/clickandbuy.api.java/clickandbuy.api.soap.cfx/pom.xml


Thanks !

>
> Here you can find a working example using Maven, Apache CXF and Spring WS to
> generate and use a SOAP client for ClickandBuy payment API:
> https://github.com/martchouk/clickandbuy.api.java
>
> Maybe you can use this way until the axis way will be fixed.
> Just checkout the whole project and run "mvn clean test", it will generate
> the client stub classes and run the test client against the ClickandBuy
> sandbox environment, the generated classes you'll find in
> clickandbuy.api.soap.cfx/src/main/generated/ .
>
> In case you want only to generate the client classes, run "mvn clean
> install", then go into clickandbuy.api.soap.cfx and run "mvn clean
> cxf-codegen:wsdl2java" there.
>
> The only piece of java coded manualy is the test class where you can see how
> to call the generated client classes:
> https://github.com/martchouk/clickandbuy.api.java/blob/master/clickandbuy.api.java/clickandbuy.api.soap.cfx/src/test/java/clickandbuy/api/soap/cxf/ClickandbuyApiSoapCfxClientTest.java
> ,  in the test class only one API call is implemented(payRequest call), the
> rest you have to add yourself in the same way.
>
> The test data you can change in the property file, and of course you need
> your own secretKey and further auth data from your ClickandBuy merchant
> (sandbox)account:
> https://github.com/martchouk/clickandbuy.api.java/blob/master/clickandbuy.api.java/clickandbuy.api.soap.cfx/src/test/resources/clickandbuy.api.SANDBOX.properties
>
> Enjoy
> Andrei
>
>
>
>
>
> --
> View this message in context: http://axis.8716.n7.nabble.com/Problems-generating-the-client-for-the-ClickandBuy-API-tp110807p110813.html
> Sent from the Axis Java - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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.