Importing xsd into wsdl

You have a couple of problems here. First, the XSD has an issue where an element is both named or referenced; in your case should be referenced. Change: <xsd:element name=”stock” ref=”Stock” minOccurs=”1″ maxOccurs=”unbounded”/> To: <xsd:element name=”stock” type=”Stock” minOccurs=”1″ maxOccurs=”unbounded”/> And: Remove the declaration of the global element Stock Create a complex type declaration for a … Read more

JAXB generating JAXBElement instead of String

What I had to do is to wrap jaxb:globalBindings with another jaxb:bindings. <jaxb:bindings version=”2.0″ xmlns:jaxb=”http://java.sun.com/xml/ns/jaxb”> <jaxb:bindings> <jaxb:globalBindings generateElementProperty=”false”/> </jaxb:bindings> </jaxb:bindings> Now everything is working, there is no JAXBElement<String> generated anymore.

How to avoid the need to specify the WSDL location in a CXF or JAX-WS generated webservice client?

I finally figured out the right answer to this question today. <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot> <wsdlOptions> <wsdlOption> <wsdl>${project.basedir}/src/main/resources/wsdl/FooService.wsdl</wsdl> <wsdlLocation>classpath:wsdl/FooService.wsdl</wsdlLocation> </wsdlOption> </wsdlOptions> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> </plugin> Notice that I have prefixed the value in wsdlLocation with classpath:. This tells the plugin that the wsdl will be on … Read more

Access restriction on class due to restriction on required library rt.jar?

There’s another solution that also works. Go to the Build Path settings in the project properties. Remove the JRE System Library Add it back; Select “Add Library” and select the JRE System Library. The default worked for me. This works because you have multiple classes in different jar files. Removing and re-adding the JRE lib … Read more

tech