How to generate WSDD based on code or based on WSDL

≡放荡痞女 提交于 2020-01-15 09:52:21

问题


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.


回答1:


You need stubs for the client side and skeletons for the server side.
Google this for more info: axis generate skeleton from wsdl




回答2:


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>
     </plugin>


来源:https://stackoverflow.com/questions/12608282/how-to-generate-wsdd-based-on-code-or-based-on-wsdl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!