I am working on a cxf webservice client and I pull down the wsdl directly in the codegen plugin. Ignore all the urls and namespaces, I changed those for this post. The plugin is configured as such:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>https://mywsdlurl/web-services/MyWebservice?wsdl</wsdl>
<extraargs>
<extraarg>-client</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
The section of wsdl, which I am unable to edit, being referred to:
<operation name="getInstanceAsOfDates">
<input wsam:Action="http://webserviceurl.com/MyServiceType/getInstanceAsOfDatesRequest" message="tns:getInstanceAsOfDates"/>
<output wsam:Action="http://webserviceurl.com/MyServiceType/getInstanceAsOfDatesResponse" message="tns:getInstanceAsOfDatesResponse"/>
</operation>
The port method generated, and where the problem is:
@WebService(targetNamespace = "http://webserviceurl.com", name = "MyServiceType")
@XmlSeeAlso({ObjectFactory.class})
public interface MyServiceType {
...
@WebMethod
@Action(input = "http://webserviceurl/getInstanceAsOfDatesRequest", output = "http://webserviceurl/getInstanceAsOfDatesResponse")
@RequestWrapper(localName = "getInstanceAsOfDates", targetNamespace = "http://webserviceurl.com", className = "com.webservice.GetInstanceAsOfDates")
@ResponseWrapper(localName = "getInstanceAsOfDatesResponse", targetNamespace = "http://webserviceurl.com", className = "com.webservice.GetInstanceAsOfDatesResponse")
@WebResult(name = "instanceXmlAsIOMWrapperBean", targetNamespace = "")
public java.lang.String getInstanceAsOfDates(
@WebParam(name = "w3cVersionDate", targetNamespace = "http://webserviceurl.com")
java.lang.String w3CVersionDate,
@WebParam(name = "w3cEndorsementDate", targetNamespace = "http://webserviceurl.com")
java.lang.String w3CEndorsementDate,
@WebParam(name = "fulfilledCode", targetNamespace = "http://webserviceurl.com")
java.lang.String fulfilledCode,
@WebParam(name = "path", targetNamespace = "http://webserviceurl.com")
java.util.List<java.lang.String> path,
@WebParam(name = "concepts", targetNamespace = "http://webserviceurl.com")
java.util.List<java.lang.String> concepts,
@WebParam(name = "ids", targetNamespace = "http://webserviceurl.com")
java.util.List<java.lang.String> ids
);
The plugin is correctly generating the request and response objects but how can I get the parameter for the getInstanceAsOfDates(…) to be the @RequestWrapper class and the response to be the @ResponseWrapper class like so: GetInstanceAsOfDatesResponse getInstanceAsOfDates(GetInstanceAsOfDates request)