So i have a problem that can be resolved one of two ways: First of all: I cannot change the WSDL for this; i am trying to create a Mock implementation of an existing service and my client works against the real thing but not the mock; due to the issue described below.
I'm trying to use an jaxb binding file; however whenever i use the file with wsdl2java i get this error: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:3.0.1:wsdl2java failed: org.apache.cxf.wsdl11.WSDLRuntimeException: No input message was found for operation* XXXXoperation *and input named XXXXXRequest. Check the wsdl for errors. -> [Help 1] However, when i use the file with xsdtojava with the cxf-xjc-plugin it works no problem. My binding file is ridiculously simple: <jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"> <jaxb:globalBindings generateElementProperty="false"/> </jaxb:bindings> The wsdl2java generates this: @XmlElementRef(name = "countryCodeArray", namespace = " http://schemas.datacontract.org/2004/07/MyService.vo", type = JAXBElement.class) protected JAXBElement<ArrayOfCountryCode> countryCodeArray; But i want what the xsdtojava generages, which is this: @XmlElement(nillable = true) protected ArrayOfCountryCode countryCodeArray; Because this is what is being returned from the JaxWS server when it runs as a CXF Endpoint: ... <ArrayOfCountryCode> <CountryCode> ... <ArrayOfCountryCode> <CountryCode> <ns5:string>USA</ns5:string> But this is what it is supposed to be: <countryCodeArray> <CountryCode> <countryCode>USA</countryCode> So here's the questions: What is wrong with my binding file (pom snippit for wsdl2java CXF codegen plugin) <configuration> <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot> <wsdlOptions> <wsdlOption> <wsdl>${basedir}/src/main/resources/countries.wsdl</wsdl> <extraargs> <extraarg>-autoNameResolution</extraarg> <extraarg>-wsdlLocation</extraarg> <extraarg>countries.wsdl</extraarg> <extraarg>-keep</extraarg> <extraarg>-p</extraarg> <extraarg>com.ws.countries.model</extraarg> <extraarg>-frontend</extraarg> <extraarg>jaxws21</extraarg> <extraarg>-impl</extraarg> </extraargs> </wsdlOption> </wsdlOptions> </configuration> OR how do i use xjc generated java classes with wsdl2java in the same project? (The wsd2java complains about missing data types if i leave out the XSD files). Thanks in advance for any assistance. Sorry if i rambled. -B. Stopp
