Clickatell SOAP wsdl for JAXB java classes

I am trying to create JAXB classes from Clickatell wsdl: Here the definition of wsdl is quite large: http://api.clickatell.com/soap/webservice.php?WSDL

When I tried to create Java classes from this Wsdl, I got the following errors: [ERROR] undefined simple or complex type "SOAP-ENC: Array" [ERROR] undefined attribute 'SOAP-ENC: arrayType'

Hope someone can help me. Hooray, Tim

+7
java web-services
source share
4 answers

Your schema is of the SOAP-ENC: Array type defined in the xmlns: SOAP-ENC = "http://schemas.xmlsoap.org/soap/encoding/" schema, but this schema is not included in wsdl.

I had a similar problem and I had to use a directory to tell jaxb / xjc where to find the schema.

Go to http://schemas.xmlsoap.org/soap/encoding/ and save as soapenc.xsd

Then create a text file with the following contents

PUBLIC "http://schemas.xmlsoap.org/soap/encoding/" "soapenc.xsd" 

Then pass this file to xjc as a directory file


Update: if you are on maven, this is how it will all be with you.

put the schema, soapenc.xsd and catalog.cat (plain text file) in src / main / resources

Then tell the jaxb plugin to pass the directory to xjc

 <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <executions> <execution> <id>wsdl-generate</id> <configuration> <schemaIncludes> <include>*.wsdl</include> </schemaIncludes> <catalog>${project.basedir}/src/main/resources/catalog.cat</catalog> </configuration> <goals> <goal>generate</goal> </goals> </execution> </executions> </plugin> 
+16
source share

check the WS-I BasicProfile-1.1 specification at http://www.ws-i.org/Profiles/BasicProfile-1.1.html#soapenc_Array

It says:

R2110 IN THE DESCRIPTION, declarations SHOULD NOT extend or limit the type of soapenc: Array.

R2111 In the declaration DESCRIPTION, SHOULD NOT use the wsdl: arrayType attribute in a type declaration.

R2112 IN THE DESCRIPTION, elements MUST NOT be named using the ArrayOfXXX convention.

R2113 ENVELOPE SHOULD NOT include the soapenc: arrayType attribute.

yo!

+1
source share

JAXB does not support RPC / Encoding. Use JAX-RPC to solve this problem.

0
source share

I think the best way is to use the good old 1.4 axis. It was designed to work with rpc services and usually does its job. The main problem is that this library is very, very old (the jar was loaded into the central system in 2006) and is no longer supported.

If you decide to try it, just add the following dependency to your pom:

 <dependency> <groupId>axis</groupId> <artifactId>axis</artifactId> <version>1.4</version> </dependency> 

add the following plugin:

 <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>axistools-maven-plugin</artifactId> <version>1.4</version> <executions> <execution> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>javax.activation</groupId> <artifactId>javax.activation-api</artifactId> <version>1.2.0</version> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4.7</version> </dependency> </dependencies> <configuration> <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory> <wsdlFiles> <wsdlFile>my_service.wsdl</wsdlFile> </wsdlFiles> </configuration> </plugin> 

put your wsdl file in src/main/resources/my_service.wsdl and src/main/resources/my_service.wsdl application using mvn clean package .

Details about the plugin can be found here.

0
source share

All Articles