Skip to content

A working example of calling TrueFiling - #440

Merged
BryceStevenWilley merged 1 commit into
mainfrom
truefiling
Aug 7, 2026
Merged

A working example of calling TrueFiling#440
BryceStevenWilley merged 1 commit into
mainfrom
truefiling

Conversation

@BryceStevenWilley

Copy link
Copy Markdown
Collaborator

Makes some changes to how WSDLs are generated:

  • uses the cxf-codegen-plugin to actually generate the XSD / WSDL Java objects. Runs automatically on mvn compile and can run individually with mvn generate-sources.
    • Doesn't have a prefixed namespace, since the codegen plugin can't handle that. At least it shouldn't confluct with the Tyler generated objects, with doe have the prefixed namespace.

This doesn't include the several attempts to improve this situation that didn't work at all.

  • Make all Niem related schemas a separate package, and just include them
    • ECF is often substituted / extended by implementors, but Niem isn't as much.
    • There's another plugin, called https://github.com/highsource/jaxb-tools that can generate 'episode' files, essentially binding files that when included in a build, will stop xjc from re-generating those files. This works with Niem in a separate package making the episode files, and then TrueFiling's ECF implementation using those episode files. However, it doesn't prevent codegen from re-generating ObjectFactories that override the Niem-generated ObjectFactories and have significantly fewer methods. That's annoying, but work-aroundable, but...
  • There are actually substitutions in Niem, and even if an ObjectFactory method is generated, it might return the wrong value (i.e. something JAXBElement wrapped instead of just the value)
    • Generating from multiple WSDL overwrites ObjectFactory ciscoo/cxf-codegen-gradle#40 (comment) is the best summary I've seen of this general issue. It comes down to the fact that this proxy server is made to call multiple WSDL endpoints (both with the same types but slightly different versions, or completely different implementations), and JAXB is not built to handle that, as it'll generate "invalid XML according to the schema". This in general caused me to give up most of my efforts to make this code generation sane.

Makes some changes to how WSDLs are generated:

* uses the cxf-codegen-plugin to actually generate the XSD / WSDL Java objects. Runs automatically
  on `mvn compile` and can run individually with `mvn generate-sources`.
  * Doesn't have a prefixed namespace, since the codegen plugin can't handle that. At least it shouldn't confluct with
    the Tyler generated objects, with doe have the prefixed namespace.

This doesn't include the several attempts to improve this situation that didn't work at all.

* Make all Niem related schemas a separate package, and just include them
    * ECF is often substituted / extended by implementors, but Niem isn't as much.
    * There's another plugin, called https://github.com/highsource/jaxb-tools that can generate 'episode' files,
      essentially binding files that when included in a build, will stop xjc from re-generating those files. This
      works with Niem in a separate package making the episode files, and then TrueFiling's ECF implementation using
      those episode files.
      However, it doesn't prevent codegen from re-generating ObjectFactories that override the Niem-generated
      ObjectFactories and have significantly fewer methods. That's annoying, but work-aroundable, but...
* There are actually substitutions in Niem, and even if an ObjectFactory method is generated, it might
  return the wrong value (i.e. something JAXBElement wrapped instead of just the value)
    * ciscoo/cxf-codegen-gradle#40 (comment) is the best summary I've
      seen of this general issue. It comes down to the fact that this proxy server is made to call multiple WSDL
      endpoints (both with the same types but slightly different versions, or completely different implementations),
      and JAXB is not built to handle that, as it'll generate "invalid XML according to the schema". 
      This in general caused me to give up most of my efforts to make this code generation sane.
@BryceStevenWilley
BryceStevenWilley merged commit c69a959 into main Aug 7, 2026
4 checks passed
@BryceStevenWilley
BryceStevenWilley deleted the truefiling branch August 7, 2026 16:34
@BryceStevenWilley

Copy link
Copy Markdown
Collaborator Author

Pulling out the chunk of pom.xml that worked, but ran into issues with XSD at runtime:

In NIEM:

<plugin>
  <groupId>org.jvnet.jaxb</groupId>
  <artifactId>jaxb-maven-plugin</artifactId>
  <version>3.0.1</version>
  <executions>
    <execution>
      <goals>
        <goal>generate</goal>
      </goals>
      <configuration>
        <schemaDirectory>target/classes/xsd/</schemaDirectory>
        <schemaIncludes>
        <include>constraint/niem/niem-core/2.0/niem-core.xsd</include> 
        <include>constraint/niem/domains/jxdm/4.0/jxdm.xsd</include> 
        <include>constraint/niem/domains/screening/2.0/screening.xsd</include>
        </schemaIncludes>
        <episode>true</episode>
      </configuration>
    </execution>
  </executions>
</plugin>

In TrueFilingEcf4:

<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>4.1.3</version>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
                <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
                <wsdlOptions>
                    <wsdlOption>
                        <wsdl>target/classes/wsdl/WebServices/ECF-4.0-FilingReviewMDEService.wsdl</wsdl> 
                        <bindingFiles>
                            <bindingFile>../Niem/target/generated-sources/xjc/META-INF/sun-jaxb.episode</bindingFile>
                        </bindingFiles>
                    </wsdlOption>
                    <wsdlOption>
                        <wsdl>target/classes/wsdl/WebServices/ECF-4.0-CourtRecordMDEService.wsdl</wsdl> 
                        <bindingFiles>
                            <bindingFile>../Niem/target/generated-sources/xjc/META-INF/sun-jaxb.episode</bindingFile>
                        </bindingFiles>
                    </wsdlOption>
                    <wsdlOption>
                        <wsdl>target/classes/wsdl/WebServices/ECF-4.0-ServiceMDEService.wsdl</wsdl> 
                        <bindingFiles>
                            <bindingFile>../Niem/target/generated-sources/xjc/META-INF/sun-jaxb.episode</bindingFile>
                        </bindingFiles>
                    </wsdlOption>
                    <wsdlOption>
                        <wsdl>target/classes/wsdl/WebServices/ECF-4.0-FilingAssemblyMDEService.wsdl</wsdl> 
                        <bindingFiles>
                            <bindingFile>../Niem/target/generated-sources/xjc/META-INF/sun-jaxb.episode</bindingFile>
                        </bindingFiles>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant