Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to make working "xjcArg" "-Xinject-code" #68

Open
rgambelli opened this issue Aug 23, 2018 · 1 comment
Open

Unable to make working "xjcArg" "-Xinject-code" #68

rgambelli opened this issue Aug 23, 2018 · 1 comment

Comments

@rgambelli
Copy link

I'm using jaxws-maven-plugin 2.5 with jdk1.8.0_121.
I have a simple wsdl and an even more simple binding file where I'm trying, without success, to add a method in a generated from wsdl bean.
It isn't working without any warnings or errors.

jaxws-maven-plugin is configured in this way:

<plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>jaxws-maven-plugin</artifactId>
	<version>2.5</version>                
	<configuration>
		<!-- tell JAXB to actually use the XJC plugins -->
		<xjcArgs>
			<xjcArg>-extension</xjcArg>
			<xjcArg>-Xinject-code</xjcArg>
			<!--<xjcArg>-Xsync-methods</xjcArg>-->
		</xjcArgs>
	</configuration>
	<executions>
		<execution>
			<id>wsimport-generate-mail-service</id>
			<phase>generate-sources</phase>
			<goals>
				<goal>wsimport</goal>
			</goals>
			<configuration>
				<sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
				<verbose>true</verbose>
				<packageName>it.cbt.mail.ws.client</packageName>
				<vmArgs>
					<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
				</vmArgs>
				<!--<wsdlLocation>http://localhost:9393/MailProxyServer/services/mail-service?wsdl</wsdlLocation>-->
				<wsdlLocation>${project.basedir}/src/wsdl/mail-service.wsdl</wsdlLocation>
				<staleFile>${project.build.directory}/jaxws/stale/mail-service.stale</staleFile>
				<xnocompile>true</xnocompile>
				<verbose>true</verbose>
				<extension>true</extension>
				<bindingFiles>
					<bindingFile>${project.basedir}/src/wsdl/bindings.xjb</bindingFile>
				</bindingFiles>
				<xdebug>true</xdebug>
			</configuration>
		</execution>
	</executions>
</plugin>

and binding file is:

<jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
                xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
                xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:ci="http://jaxb.dev.java.net/plugin/code-injector"
                wsdlLocation="mail-service.wsdl"
                jaxb:extensionBindingPrefixes="ci "
                version="2.0"
                jaxb:version="2.1">  
    
    <jaxb:bindings node="//wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='http://model.ws.mail.cbt.it']/xs:complexType[@name='mailMessageBean']/xs:sequence/xs:element[@name='subject']">
		<ci:code>
            @Override
            public String toString() { return "bravo filippo";}
        </ci:code>        
    </jaxb:bindings> 
    <!--</jaxws:bindings>--> 
</jaxws:bindings> 

I'm not understanding what is missing or if it's a bug, I tried also with the 2.4.1 version.
I really hope you can help me, thank you very much

@theit
Copy link
Contributor

theit commented Jan 13, 2020

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

No branches or pull requests

2 participants