jaxb2-maven-plugin

How to generate JAVA classes from XSD hierarchy without namespace

旧时模样 提交于 2021-01-29 06:05:27
问题 I have a set of XSD files from a client. I need to generate java classes from those. One of the XSDs imports another without namespace. That fails the mvn generate-sources with an error: src-resolve: Cannot resolve the name 'faultstring' to a(n) 'element declaration' component. org.xml.sax.SAXParseException; systemId: file:/src/main/resources/Common/SOAP_Fault_v4_0_0.xsd I am using openjdk 11 with version 3.3.0 of cxf-xjc-plugin to generate classes. Attached is the project. I have tried to

Spring boot - Server did not recognize the value of HTTP Header SOAPAction

折月煮酒 提交于 2020-04-17 20:04:47
问题 I want to consume soap service using jaxb. The generated request from jaxb is <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <ns2:Add xmlns:ns2="http://tempuri.org/"> <ns2:intA>10</ns2:intA><ns2:intB>20</ns2:intB> </ns2:Add> </SOAP-ENV:Body> </SOAP-ENV:Envelope> But the response is a soap exception as stated in the title. Caused by: org.springframework.ws.soap.client.SoapFaultClientException: System.Web.Services.Protocols

jaxb2 simplify plugin for xs:choice having same types

空扰寡人 提交于 2020-01-07 05:27:18
问题 I'm trying to use jaxb2 basics simplify plugin for my schema to JAXB conversion. It works fine for the complex types like below. Each element is defined inside the xs:choice has different types ( type1 and type2 ). sample.xsd (complex choice type with different type) <xs:complexType name="doclist"> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:annotation> <xs:appinfo> <simplify:as-element-property /> </xs:appinfo> </xs:annotation> <xs:element name="document1" type="type1"

Is there a JAXB Plugin which generates Builders?

混江龙づ霸主 提交于 2019-12-30 06:08:21
问题 Are you aware of any good JAXB Plugin which generated Builder pattern classes for the generated JAXB classes? Composing domain using JAXB generated classes is really nasty. I saw a plugin someone wrote back in 2010 but it doesn't use the newest maven plugin jaxb2-maven-plugin, and it also requires you to specify bindings for each schema type which is not robust. 回答1: Yes, there is now a plugin to generate fluent builders for JAXB-generated classes. There is a github project on https://github

maven-jaxb2-plugin VS jaxb2-maven-plugin for multiple schemas

和自甴很熟 提交于 2019-12-19 08:05:07
问题 I have multiple xsd schemas that I want to unmarshall into different packages under the same folder target/generated-sources/xjc . I tried both plugins and both seem to work fine with these 2 configurations but in case of maven-jaxb2-plugin the eclipse plugin keeps generating classes indefinitely (because of the forceRegenerate = true) but if I don't specify forceRegenerate it won't generate the second and third set of classes at all when I run mvn clean package Are there any issues with my

Generate classes with jaxb2-maven-plugin from WSDL

随声附和 提交于 2019-12-17 11:44:33
问题 I am having trouble configuring the jaxb2-maven-plugin to generate Java classes from a WSDL and multiple XSD files that all exist in the same standard directory src/main/xsd . how to use jaxb2 maven plugin with inline XSD? is related only in that the answers correctly suggest using the wsdl parameter in the plugin config but that question is really concerned with inline XSDs and my XSDs are external. The plugin goal parameters are listed here. My plugin configuration is: <plugin> <groupId>org

Generate classes with jaxb2-maven-plugin from WSDL

邮差的信 提交于 2019-12-17 11:44:12
问题 I am having trouble configuring the jaxb2-maven-plugin to generate Java classes from a WSDL and multiple XSD files that all exist in the same standard directory src/main/xsd . how to use jaxb2 maven plugin with inline XSD? is related only in that the answers correctly suggest using the wsdl parameter in the plugin config but that question is really concerned with inline XSDs and my XSDs are external. The plugin goal parameters are listed here. My plugin configuration is: <plugin> <groupId>org

Generate classes with jaxb2-maven-plugin from WSDL

可紊 提交于 2019-12-17 11:44:04
问题 I am having trouble configuring the jaxb2-maven-plugin to generate Java classes from a WSDL and multiple XSD files that all exist in the same standard directory src/main/xsd . how to use jaxb2 maven plugin with inline XSD? is related only in that the answers correctly suggest using the wsdl parameter in the plugin config but that question is really concerned with inline XSDs and my XSDs are external. The plugin goal parameters are listed here. My plugin configuration is: <plugin> <groupId>org

JAXB bindings - set typesafeEnumBase to empty (convert enumerations to strings)

别来无恙 提交于 2019-12-12 21:14:33
问题 According to the link If typesafeEnumBase is set to xsd:string, it would be a global way to specify that all simple type definitions deriving directly or indirectly from xsd:string and having enumeration facets should be bound by default to a typesafe enum. If typesafeEnumBase is set to an empty string, "" , no simple type definitions would ever be bound to a typesafe enum class by default. The value of typesafeEnumBase can be any atomic simple type definition except xsd:boolean and both

remove xmlns attribute from the root element while marshalling jaxb

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 08:09:28
问题 This might be a related to JAXB Marshaller - How do I suppress xmlns namespace attributes? But my problem is a little different. I do the regular java marshalling and my xsd has no namespaces.The generated xml is without namespaces as well, except for the root element. <?xml version="1.0" encoding="UTF-8"?><rootElement xmlns:ns2="unwanted namespace"> The unwanted namespace is from another schema from the same project and I am not sure why that is being picked up at this stage. My rootElement