Skip to content
Advertisement

How to generate WSDD based on code or based on WSDL

I have access to remote sever that provides me wsdl back to my response.

I prepared Client for this, based on that wsdl.

Now I woud like to write a fake Server (for testing needs), what I should start first? Which steps I should implement? The test makes sense only if it is implemented by this WSDL. Is it possible to generate some kind of Service with empty methods?

In my app I use Apache Axis 1.4

My steps, how I think:

  1. I already have: InterfacePortType class (which, as I understand, represents the remote Server), which was generated for my client based on wsdl. So I can implement it, and it would be MyService:

    class MyServer implements InterfacePortType

  2. Then generate somehow WSDD. How I can do it?

I found similar question here not answered.

Advertisement

Answer

I found the solution, I generated WSDD using axistools-maven-plugin, setting: serverSide parameter to true – then it generates the WSDD file.

This is maven plugin part:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>axistools-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>wsdl2java-job</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
            <configuration>
                <sourceDirectory>
                    src/main/config/wsdl2java/myfolder
                </sourceDirectory>
                <outputDirectory>
                    ${generatedSourcesDirectory}
                </outputDirectory>
                <testCases>false</testCases>
                <serverSide>true</serverSide>
                <subPackageByFileName>false</subPackageByFileName>
                <packageSpace>my.api</packageSpace>
            </configuration>
        </execution>
    </executions>
</plugin>

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement