You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

WsdlToDotnet.xml 6.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <?xml version="1.0"?>
  2. <project name="wsdl-to-java-jtest" basedir="." default="init">
  3. <property environment="env"/>
  4. <property name="build.dir" location="wsdl/build"/>
  5. <property name="cache.dir" location="${build.dir}/cache"/>
  6. <property name="src.dir" location="${build.dir}/src"/>
  7. <property name="classes.dir" location="${build.dir}/classes"/>
  8. <property name="local.wsdl"
  9. location="wsdl/StockQuoteService.wsdl" />
  10. <property name="out.csc" location="${src.dir}/out.cs"/>
  11. <property name="out.app" location="${classes.dir}/out.dll"/>
  12. <property name="out.type" value="module"/>
  13. <property name="out.vbc" location="${src.dir}/out.vb"/>
  14. <property name="endpoint"
  15. value="http://nagoya.apache.org:5049/Axis/StockQuoteService.jws" />
  16. <property name="endpoint.wsdl"
  17. value="http://nagoya.apache.org:5049/Axis/StockQuoteService.jws?wsdl" />
  18. <property name="vb.references"
  19. value="System.Web.dll,System.xml.dll,System.dll,System.Web.Services.dll"/>
  20. <target name="init" depends="validate">
  21. <mkdir dir="${build.dir}"/>
  22. <mkdir dir="${cache.dir}"/>
  23. <mkdir dir="${src.dir}"/>
  24. <mkdir dir="${classes.dir}"/>
  25. </target>
  26. <target name="probe_for_apps" >
  27. <condition property="wsdl.found">
  28. <or>
  29. <available file="wsdl" filepath="${env.PATH}" />
  30. <available file="wsdl.exe" filepath="${env.PATH}" />
  31. <available file="wsdl.exe" filepath="${env.Path}" />
  32. </or>
  33. </condition>
  34. <echo> wsdl.found=${wsdl.found}</echo>
  35. <condition property="csc.found">
  36. <or>
  37. <available file="mcs" filepath="${env.PATH}" />
  38. <available file="csc" filepath="${env.PATH}" />
  39. <available file="csc.exe" filepath="${env.PATH}" />
  40. <available file="csc.exe" filepath="${env.Path}" />
  41. </or>
  42. </condition>
  43. <echo> csc.found=${csc.found}</echo>
  44. <condition property="vbc.found">
  45. <or>
  46. <available file="vbc" filepath="${env.PATH}" />
  47. <available file="vbc.exe" filepath="${env.PATH}" />
  48. <available file="vbc.exe" filepath="${env.Path}" />
  49. </or>
  50. </condition>
  51. <echo> vbc.found=${vbc.found}</echo>
  52. <condition property="dotnetapps.found">
  53. <and>
  54. <isset property="csc.found"/>
  55. <isset property="wsdl.found"/>
  56. </and>
  57. </condition>
  58. <echo> dotnetapps.found=${dotnetapps.found}</echo>
  59. </target>
  60. <target name="teardown">
  61. <delete dir="${build.dir}"/>
  62. </target>
  63. <target name="validate" depends="probe_for_apps" >
  64. <fail unless="dotnetapps.found">Needed .net apps are missing</fail>
  65. </target>
  66. <target name="testNoParams">
  67. <wsdltodotnet/>
  68. </target>
  69. <target name="testNoSrc">
  70. <wsdltodotnet destFile="${out.csc}"/>
  71. </target>
  72. <target name="testDestIsDir" depends="init">
  73. <wsdltodotnet destFile="${build.dir}"
  74. srcFile="${local.wsdl}"/>
  75. </target>
  76. <target name="testBothSrc" depends="init">
  77. <wsdltodotnet destFile="${out.csc}"
  78. srcFile="${local.wsdl}"
  79. url="${endpoint.wsdl}"
  80. />
  81. </target>
  82. <target name="testSrcIsDir" depends="init">
  83. <wsdltodotnet destFile="${out.csc}"
  84. srcFile="${build.dir}"
  85. />
  86. </target>
  87. <target name="testSrcIsMissing" depends="init">
  88. <wsdltodotnet destFile="${out.csc}"
  89. srcFile="${build.dir}/invalidfile.wsdl"
  90. />
  91. </target>
  92. <target name="testLocalWsdl" depends="init">
  93. <wsdltodotnet destFile="${out.csc}"
  94. srcFile="${local.wsdl}"
  95. />
  96. <csc
  97. srcDir="${src.dir}"
  98. destFile="${out.app}"
  99. targetType="${out.type}"
  100. references="System.Web.Services.dll"
  101. />
  102. <available property="app.created" file="${out.app}"/>
  103. <fail unless="app.created">No app created</fail>
  104. </target>
  105. <target name="testLocalWsdlServer" depends="init">
  106. <wsdltodotnet destFile="${out.csc}"
  107. srcFile="${local.wsdl}"
  108. server="true"
  109. />
  110. <csc
  111. srcDir="${src.dir}"
  112. destFile="${out.app}"
  113. targetType="${out.type}"
  114. fileAlign="512"
  115. references="System.Web.Services.dll"
  116. />
  117. <available property="app.created" file="${out.app}"/>
  118. <fail unless="app.created">No app created</fail>
  119. </target>
  120. <target name="testInvalidExtraOps" depends="init">
  121. <wsdltodotnet destFile="${out.csc}"
  122. srcFile="${local.wsdl}"
  123. extraOptions="/newOption:not-one-known-of"
  124. />
  125. </target>
  126. <target name="testLocalWsdlVB" depends="init" if="vbc.found">
  127. <wsdltodotnet destFile="${out.vbc}"
  128. language="VB"
  129. srcFile="${local.wsdl}"
  130. />
  131. <vbc
  132. srcDir="${src.dir}"
  133. destFile="${out.app}"
  134. targetType="${out.type}"
  135. references="${vb.references}"
  136. >
  137. </vbc>
  138. <available property="app.created" file="${out.app}"/>
  139. <fail unless="app.created">No app created</fail>
  140. </target>
  141. <target name="testLocalWsdlServerVB"
  142. depends="init" if="vbc.found">
  143. <wsdltodotnet destFile="${out.vbc}"
  144. language="VB"
  145. srcFile="${local.wsdl}"
  146. server="true"
  147. />
  148. <vbc
  149. srcDir="${src.dir}"
  150. destFile="${out.app}"
  151. targetType="${out.type}"
  152. optionExplicit="true"
  153. optionStrict="false"
  154. optionCompare="text"
  155. references="${vb.references}"
  156. />
  157. <available property="app.created" file="${out.app}"/>
  158. <fail unless="app.created">No app created</fail>
  159. </target>
  160. <target name="testInvalidExtraOpsVB" depends="init">
  161. <wsdltodotnet destFile="${out.vbc}"
  162. language="VB"
  163. srcFile="${local.wsdl}"
  164. extraOptions="/newOption:not-one-known-of"
  165. />
  166. </target>
  167. <target name="testideErrorsIgnoredWhenFalse" depends="init">
  168. <wsdltodotnet destFile="${out.csc}"
  169. srcFile="${local.wsdl}"
  170. ideErrors="false"
  171. >
  172. </wsdltodotnet>
  173. </target>
  174. <target name="testSchemaMustBeSet" depends="init">
  175. <wsdltodotnet destFile="${out.csc}"
  176. srcFile="${local.wsdl}"
  177. >
  178. <schema/>
  179. </wsdltodotnet>
  180. </target>
  181. <target name="testSchemaFileMustExist" depends="init">
  182. <wsdltodotnet destFile="${out.csc}"
  183. srcFile="${local.wsdl}"
  184. >
  185. <schema file="this-file-does-not-exist.xsd"/>
  186. </wsdltodotnet>
  187. </target>
  188. <target name="testSchemaFileMustHaveOneOptionOnly" depends="init">
  189. <wsdltodotnet destFile="${out.csc}"
  190. srcFile="${local.wsdl}"
  191. >
  192. <schema file="WsdlToDotnet.xml"
  193. url="http://ant.apache.org/xml/AntSchema.xsd"/>
  194. </wsdltodotnet>
  195. </target>
  196. </project>