首页 \ 问答 \ Spring-WS:如何在不启动Web服务的情况下生成WSDL?(Spring-WS: How generate the WSDL without having to start the web service?)

Spring-WS:如何在不启动Web服务的情况下生成WSDL?(Spring-WS: How generate the WSDL without having to start the web service?)

我们使用Spring-WS作为实现Web服务的基础(使用框架生成的WSDL)。 除了WAR文件之外,我们的构建还生成客户端JAR(供我们的Java客户端使用,我们自己的端到端功能测试),包括模式生成的DTO和Web服务方法的存根。 这些是使用wsimport(JAX-WS)生成的。 问题是这会产生一个多步骤的构建过程:

  1. 构建服务器WAR文件;
  2. 启动Tomcat(使WSDL可用);
  3. 生成客户端存根(在WSDL URL上指向wsimport)。

有没有办法生成WSDL而无需启动Web服务? 然后我们可以在一个步骤中构建所有内容。


We use Spring-WS as the basis for implementing a web service (with the WSDL generated by the framework). As well as a WAR file our build produces a client side JAR (for use by our Java clients and our own end-to-end functional tests) consisting of schema generated DTOs and stubs for the web service methods. These are generated using wsimport (JAX-WS). Problem is this gives rise to a multi-step build process:

  1. Build the server WAR file;
  2. Start Tomcat (to make the WSDL available);
  3. Generate the client side stubs (pointing wsimport at the WSDL url).

Is there some way to generate the WSDL without having to start the web service? Then we could build everything in a single step.


原文:https://stackoverflow.com/questions/3870995
更新时间:2023-05-01 12:05

最满意答案

// your script probably can't go on without this file?
require 'config.php';

// I prefer to always pass the connection resource to mysql_query/mysql_real_escape_string
// assume $mysql = mysql_connect....
$result = mysql_query("SELECT Count(*) AS rows FROM quotes", $mysql)
  or die(mysql_error());
// there's only one row with only one column, so mysql_result() is fine
$rowcount = mysql_result($result, 0, 0);
$rand = rand(0,$rowcount-1);

$result = mysql_query("SELECT cQuotes FROM quotes LIMIT $rand, 1", $mysql)
  or die ('Error: '.mysql_error());

// there's either one or zero records. Again, no need for a while loop
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if ( !$row ) {
  echo "Empty";
}
else{
  // do you have to treat $row['cQuotes'] with htmlspecialchars()?
  echo '<p>', $row['cQuotes'], '</p>';
}

// your script probably can't go on without this file?
require 'config.php';

// I prefer to always pass the connection resource to mysql_query/mysql_real_escape_string
// assume $mysql = mysql_connect....
$result = mysql_query("SELECT Count(*) AS rows FROM quotes", $mysql)
  or die(mysql_error());
// there's only one row with only one column, so mysql_result() is fine
$rowcount = mysql_result($result, 0, 0);
$rand = rand(0,$rowcount-1);

$result = mysql_query("SELECT cQuotes FROM quotes LIMIT $rand, 1", $mysql)
  or die ('Error: '.mysql_error());

// there's either one or zero records. Again, no need for a while loop
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if ( !$row ) {
  echo "Empty";
}
else{
  // do you have to treat $row['cQuotes'] with htmlspecialchars()?
  echo '<p>', $row['cQuotes'], '</p>';
}

相关问答

更多
  • PDOException对象有一个属性errorInfo ,它是一个三元素数组,与PDO::errorInfo() 。 MySQL错误代码是元素1。 try { . . . } catch (PDOException $e) $errorInfo = $e->errorInfo; error_log "MySQL error " . $errorInfo[1] . "\n"; } PS:请注意,只是回应错误是不正确的异常处理,我只是这样做,以显示如何访问信息。 A PDOExcep ...
  • 你错过了VALUES (子句)的结束。通常,在将它传递给mysql_query之前,更容易将SQL分配给变量(可以输出这样的调试用途)。 You're missing the closing ) from the VALUES ( clause. In general, it's easier to assign your SQL to a variable (which you can output for debugging purposes like this) prior to passing it ...
  • $ connection变量在default_func不可见。 如果你想要它,只需将其声明为全局: function default_func() { global $connection; ... } 但是,当代码稍微复杂时,全局变量可能会导致难以诊断的错误。 隐藏的全局状态(如果你将第二个参数完全从mysql_query ,那就是你正在使用的状态)甚至更糟。 你最好将连接传递给函数: switch ($var) { case 'dosomething': break ...
  • // your script probably can't go on without this file? require 'config.php'; // I prefer to always pass the connection resource to mysql_query/mysql_real_escape_string // assume $mysql = mysql_connect.... $result = mysql_query("SELECT Count(*) AS rows FRO ...
  • FROM是MySQL中的保留字(通常是SQL)。 如果你真的有一个名为FROM的列,你应该用` (反引号)包装它,这样解析器就知道你的意思是一个名字: INSERT INTO WIRET (`FROM`, TO, ID, CURRENCY1, ... FROM is a reserved word in MySQL (and SQL in general). If you really have a column named FROM you should wrap it with ` (backtick ...
  • 更改$mysql_hostname = "localhost:8081"; to $mysql_hostname = "localhost"; mysql使用3306作为默认端口。 或$mysql_hostname = "localhost:3306"; 或者你的mysql列表的其他端口 change $mysql_hostname = "localhost:8081"; to $mysql_hostname = "localhost"; mysql use 3306 as default port. or ...
  • 它给出了这个错误,因为您的MySQL服务器使用旧的存储密码方式 - 而不是新方法,这更安全。 使用PHP 5.3引入的mysqlnd驱动程序不支持旧的身份验证方式。 因此,您必须修改MySQL配置,以使用新的,更安全的方式。 您收到的错误消息指示您如何执行此操作。 It gives this error because your MySQL server uses the old way of storing password -- and not the new way, which is more se ...
  • 看你phpinfo() 。 很可能mysql扩展不存在。 当你在它的时候,你可以放弃古老的mysql_*方式做事,并学习如何使用PDO和预备语句。 它是数据库连接和交互的抽象API。 Look at you phpinfo(). Most likely mysql extensions is not there. And while you are at it, you could just drop the ancient mysql_* way ow doing thing and learn how ...
  • 这是我在PHP中进行数据库访问的方式: $result=mysql_query($sql) or die ("bad sql query: ".mysql_error()); 所以如果SQL错了; 我得到一个可用的错误,通常是有罪的SQL片段 this is how i do my DB access in PHP: $result=mysql_query($sql) or die ("bad sql query: ".mysql_error()); so if the SQL is wrong; i ...

相关文章

更多

最新问答

更多
  • 如何检索Ember.js模型的所有属性(How to retrieve all properties of an Ember.js model)
  • maven中snapshot快照库和release发布库的区别和作用
  • arraylist中的搜索元素(Search element in arraylist)
  • 从mysli_fetch_array中获取选定的值并输出(Get selected value from mysli_fetch_array and output)
  • Windows Phone上的可用共享扩展(Available Share Extensions on Windows Phone)
  • 如何在命令提示符下将日期设置为文件名(How to set file name as date in command prompt)
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • 从iframe访问父页面的id元素(accessing id element of parent page from iframe)
  • linux的常用命令干什么用的
  • Feign Client + Eureka POST请求正文(Feign Client + Eureka POST request body)
  • 怎么删除禁用RHEL/CentOS 7上不需要的服务
  • 为什么Gradle运行测试两次?(Why does Gradle run tests twice?)
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在android中的活动之间切换?(Switching between activities in android?)
  • Perforce:如何从Depot到Workspace丢失文件?(Perforce: how to get missing file from Depot to Workspace?)
  • Webform页面避免运行服务器(Webform page avoiding runat server)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 内存布局破解(memory layout hack)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • 我们可以有一个调度程序,你可以异步添加东西,但会同步按顺序执行吗?(Can we have a dispatcher that you can add things todo asynchronously but will be executed in that order synchronously?)
  • “FROM a,b”和“FROM a FULL OUTER JOIN b”之间有什么区别?(What is the difference between “FROM a, b” and “FROM a FULL OUTER JOIN b”?)
  • Java中的不可变类(Immutable class in Java)
  • bat批处理文件结果导出到txt
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • 德州新起点计算机培训学校主要课程有什么?
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • “latin1_german1_ci”整理来自哪里?(Where is “latin1_german1_ci” collation coming from?)