xjc

How to have Java classes generated from WSDL implement an interface

喜欢而已 提交于 2019-12-10 11:02:38
问题 Our main wsdl has a series of wsdl imports. Each sub-wsdl imports common.xsd and defines the request and reply objects for a particular operation. I want the request objects in each of the sub-wsdl documents to implement a common interface. First, I tried using xsd:extension and extracted the common elements to a base class. This works, but changes the publicly exposed wsdl and I don't want to do that. It has been stable and unchanged for a while now. This change should be completely

generate Go structs from XSD

自闭症网瘾萝莉.ら 提交于 2019-12-08 16:10:23
问题 recently I am planing to do a project using Go. My problem is : given a XSD file, how to auto-generate structs in Go to represent the XML elements. It is similar to using 'xjc' to generate java classes from XSD. So is there any tools or packages to do this in Go? Thanks in advance. 回答1: Looks like it might need some TLC for 1.2 support, but there's: https://github.com/metaleap/go-xsd Which has a set of example packages that have been generated for different common XML formats: https://github

XJC multiple XSD -> Class generation using “episode”

自古美人都是妖i 提交于 2019-12-08 06:35:35
问题 I have two most simple xsd files. a.xsd: <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:a="A" targetNamespace="A"> <complexType name="myType"/> <element name="root" type="a:myType"/> </schema> b.xsd: <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="B" xmlns:a="A"> <import namespace="A"/> <complexType name="extendedType"> <complexContent> <extension base="a:myType"/> </complexContent> <

XJC javaType adapter in complexType

我们两清 提交于 2019-12-08 03:52:51
问题 I want to get XJC to use the javaType tag in a complexType when generation beans. Is this not allowed? I'm really missing good documentation and some understandable error message. Here is what I am trying which fails with the errors: compiler was unable to honor this conversion customization. It is attached to a wrong place, or its inconsistent with other bindings. (the above customization is attached to the following location in the schema) Here is the XSD: <xs:complexType name="MyMap"> <xs

Intellij IDEA doesn't recognized XJC task attributes

耗尽温柔 提交于 2019-12-07 18:03:14
问题 I have an ant build.xml file with XJC task definition: <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask"> <classpath> <fileset dir="jaxb" includes="*.jar" /> </classpath> </taskdef> jaxb dir cotnains jaxb-xjc.jar with XJCTask class inside. Then I call xjc task in some target: <target name="mytarget"> <xjc target="src" package="com.p1.Person" header="false"> <schema dir="src/com/p1" includes="Person.xsd"/> </xjc> </target> Intellij IDEA doesn't recognize the structure/schema of the xjc

How do I rename top level Classname during JAXB code generation using XJC?

核能气质少年 提交于 2019-12-07 14:49:26
问题 I am trying to generate some beans from several xsd's. Unfortunately they all have the same root element. I have successfully created a xjc bindings file for renaming sub-elements but cannot find a way to select the root node to change that. I tried the following but get the error: [ERROR] XPath evaluation of "/" needs to result in an element. <jxb:bindings version="1.0" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org

XmlAdapter not working correctly with newer version of JAXB

狂风中的少年 提交于 2019-12-07 11:43:55
问题 I'm executing a Maven Project with the below source package com.coderplus.jaxb; import java.util.HashMap; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @XmlJavaTypeAdapter(PropertiesMapAdapter.class) public class PropertiesMap<K,V> extends HashMap<String,String> { } .. package com.coderplus.jaxb; import java.util.Map.Entry; import javax.xml.bind.annotation.adapters.XmlAdapter; public class PropertiesMapAdapter extends XmlAdapter<Properties, PropertiesMap<String, String>> {

xjc, maven-jaxb2-plugin: cryptic java.lang.NoSuchMethodException: javax.xml.bind.annotation.XmlElementRef.required()

扶醉桌前 提交于 2019-12-07 04:10:20
问题 I'm attempting to use maven-jaxb2-plugin to compile the XSDs at http://www.aptatcip.com/APTA-TCIP-S-01%204.0_files/Schema%20Set.zip Using this pom.xml , and the command line below (run from the parent folder), the compilation fails with a fairly cryptic error message (also given below): pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

JAXB edit List getter?

让人想犯罪 __ 提交于 2019-12-06 21:36:36
问题 I have my data model in the form of XSD files from which I then generate the corresponding Java files from xjc using command line. When I generate JAXB classes from an XSD, List type elements gets a getter method generated for them (with no corresponding setter method), as follows: public List<Type> getElement3() { if (element3 == null) { element3 = new ArrayList<Type>(); } return this.element3; } I have lot of fields in almost every file generated from XSD of List type. USE case: Now, I don

Why does wsimport have trouble with server object having @XmlRootElement annotation?

天大地大妈咪最大 提交于 2019-12-06 15:02:56
问题 I was completing work on a web service using JAX-WS on the server side. In many of the domain objects I used @XmlRootElement to help facilitate the unmarshaling of XML files into the service using JAXB. All went well and the output was what I expected to see using SoapUI. However, when I used wsimport to create the client (as a convenience DAO for other developers), I started encountering NullPointerExceptions in my client integration-test class. The call to the webservice worked correctly,