如何基于代码或基于WSDL生成WSDD [英] How to generate WSDD based on code or based on WSDL

查看:156
本文介绍了如何基于代码或基于WSDL生成WSDD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以访问远程服务器,从而使wsdl返回到我的响应.

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

我为此基于wsdl准备了客户端.

I prepared Client for this, based on that wsdl.

现在我想写一个假的Server(出于测试需要),我应该首先开始什么?我应该执行哪些步骤?仅当此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?

在我的应用中,我使用Apache Axis 1.4

In my app I use Apache Axis 1.4

我的脚步,我的想法:

  1. 我已经拥有: InterfacePortType 类(据我了解,该类代表远程服务器),该类是基于wsdl为我的客户端生成的.所以我可以实现它,它就是 MyService :

  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:

MyServer 实现 InterfacePortType

然后以某种方式生成 WSDD .我该怎么办?

Then generate somehow WSDD. How I can do it?

我在此处找到了类似问题未得到回答

I found similar question here not answered.

推荐答案

我找到了解决方案,我使用axistools-maven-plugin生成了WSDD,并将serverSide参数设置为 true -然后它生成了WSDD文件.

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

这是Maven插件部分:

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>

这篇关于如何基于代码或基于WSDL生成WSDD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆