Create java client from WSDL for Google App engine
This post will explain how to consume SOAP based web services on Google App Engine platform.
<plugin>- Keep your wsdl files in resources/wsdl folder
- Make these files entry in appengine-web.xml like
- <static-files>
<include path="/**.wsdl"/>
<include path="/**.WSDL"/>
</static-files> - Now update POM file for wsdl to java plugin
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>src/main/resources/wsdl/ReadData.wsdl</wsdl>
<wsdlLocation>https://${appengine.app.id}.appspot.com/wsdl/ReadData.wsdl</wsdlLocation>
<extraargs>
<extraarg>-p</extraarg>
<extraarg>com.example.ws.readdata</extraarg>
</extraargs>
</wsdlOption>
<wsdlOption>
<wsdl>src/main/resources/wsdl/SaveData.wsdl</wsdl>
<wsdlLocation>https://${appengine.app.id}.appspot.com/wsdl/SaveData.wsdl</wsdlLocation>
<extraargs>
<extraarg>-p</extraarg>
<extraarg>com.example.ws.savedata</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
Now you can use maven commands mvn clean install and stubs will be generated in com.example.ws.savedata and com.example.ws.readdata packages.
Comments
Post a Comment