我的直觉是基于文档的Web服务在实践中是首选 - 这是其他人的体验吗?它们更容易支持吗?(我注意到SharePoint在其WSDL接口中使用Any作为"文档类型",我猜这使得它基于Document).
此外 - 人们现在是否提供相同功能的WSDL和Rest类型服务?WSDL很受代码生成的欢迎,但对于像PHP和Rails这样的前端,他们似乎更喜欢休息.
WSDL经常导入其他WSDL和XML模式.
给定WSDL的URL,是否有一个工具可以下载WSDL和所有其他引用的WSDL和模式?
理想情况下,此工具可以是Java或Perl友好的.
我有一个JAX-WS驱动的Web服务,其WSDL我们从另一个Maven模块生成一个Web服务客户端(我将调用它ws-consumer).
无论好坏,我们将"已发布的WSDL"(服务在发布时保存/生成的WSDL和XSD的版本)src/wsdl复制到我们的文件夹中ws-consumer,然后使用jaxws-maven-pluginorg.jvnet生成使用jaxws:wsimport以下内容的客户端(截断)配置:
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<!--phase>generate-sources</phase -->
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlDirectory>src/main/resources/META-INF/wsdl/</wsdlDirectory>
<wsdlFiles>
<wsdlFile>MyWS/MyWS.wsdl</wsdlFile>
</wsdlFiles>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
现在,生成的客户端代码在类级别应用了以下注释:
@WebServiceClient(name = "MyWS", targetNamespace = "http://myws/blah", wsdlLocation = "**file:/C:/some/absolute/path/src/main/resources/META-INF/wsdl/MyWS/MyWS.wsdl"**)
Run Code Online (Sandbox Code Playgroud)
强调我的
正如您所希望看到的那样,wsdlLocation属性值具有硬编码的绝对路径,在部署服务时该路径将不正确.
有什么方法可以通过将其设置为just META-INF/wsdl/MyWS/MyWS.wsdl或其他值来"控制"它?
我和我有WSDL .eg:/ sample/hello?wsdl.我想通过在Spring-ws中配置来调用webservice服务.我将此wsdl作为参数传递给springconfig.xml中的标记.谁能告诉我如何在Spring-ws中使用这个web服务.
我正在使用PHP 5中的本机SOAP类,从NuSOAP更改为本机类更快(并且NuSOAP开发似乎已经停止).但是,PHP 5 SOAP缺乏生成WSDL的能力.
有没有经验在PHP中生成WSDL?如果是这样,请推荐您的首选方法.
谢谢.
我希望可以使用某种类型的扩展(尽管我认为我的希望是愚蠢的乐观).
/**
* <p>
* Gets the {@link ResultObject} given the identifier. The following
* fields are not available for some users and will contain a null value:
* </p>
*
* <ul>
* <li>{@code resultObject.comment}</li>
* <li>{@code resultObject.anotherObject.actionById}</li>
* <li>{@code resultObject.anotherObject.actionByName}</li>
* </ul>
*
* <p>
* The {@code daysInPurgatory} value will be {@code -1} when not
* applicable
* </p>
*
* @param requestUser
* the user initiating the request
* @param identifier
* the id of the …Run Code Online (Sandbox Code Playgroud) 我有一个在IIS 7.5中托管的WCF服务.我有两台服务器,一台用于测试,一台用于生产.
该服务在测试服务器上运行正常,但在生产服务器上我有以下错误.
当我访问该地址时,http://..../service.svc我可以看到默认页面:
您已创建了一项服务.
要测试此服务,您需要创建一个客户端并使用它来调用该服务.您可以使用命令行中的svcutil.exe工具执行此操作,语法如下:
svcutil.exe http://..../service.svc?wsdl
Run Code Online (Sandbox Code Playgroud)
这将生成配置文件和包含客户端类的代码文件.将这两个文件添加到客户端应用程序,并使用生成的客户端类来调用服务.
但是当我点击wsdl链接时,我无法进入wsdl页面.它将我返回到此默认网页,没有任何错误.我怀疑网络/防火墙授权错误,但有人有这样的经历吗?
测试和生产服务器的所有IIS设置都相同.
谢谢您最好的问候.
ProductA使用我们唯一的Web服务,它是ProductA的单独部署.我们将两者部署到生产中.
后来,我们正在编写ProductB.在此过程中,我们为我们唯一的Web服务添加了一种新方法.当ProductA发布时,该新方法不在WSDL中.我们在开发过程中不对ProductA进行任何更改.
当我们将ProductB部署到生产环境时,我们还部署(生产)我们唯一的Web服务的新版本(到ProductA期望找到它的同一端点URL).我们不会将ProductA重新部署到生产环境中.
我们唯一的Web服务的WSDL在生产中已经改变,但ProductA使用的方法的签名没有改变.他们仍然在WSDL中.
由于我们以这种方式升级我们唯一的网络服务,ProductA会有任何问题吗?
如果Web服务改变了原来的客户端方法不变,你是否必须升级webservice的客户端?
对于SOAP Web服务,有一个规范,所有请求/响应必须遵循.此规范采用WSDL文档的形式.但是对于REST Web服务,为什么没有这样的规范或WSDL?这是否使REST更容易受到运行时异常的影响,因为我们没有遵循任何规范?
我试图从wsdl文件生成源代码,但我在我的pom.xml上遇到错误,我认为这可能是我的问题?下面是我从我的pom和我的pom文件中得到的错误.我也无法用"mvn clean install"构建项目.我似乎只是因为没有真正原因而得到错误.
生成标记的错误:
Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3:generate failed: A required class was missing while executing org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3:generate: com/sun/codemodel/CodeWriter
-----------------------------------------------------
realm = plugin>org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3-715230752
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/Windows/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin/0.12.3/maven-jaxb2-plugin-0.12.3.jar
urls[1] = file:/C:/Users/Windows/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin-core/0.12.3/maven-jaxb2-plugin-core-0.12.3.jar
urls[2] = file:/C:/Users/Windows/.m2/repository/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar
urls[3] = file:/C:/Users/Windows/.m2/repository/org/apache/commons/commons-lang3/3.2.1/commons-lang3-3.2.1.jar
urls[4] = file:/C:/Users/Windows/.m2/repository/com/sun/org/apache/xml/internal/resolver/20050927/resolver-20050927.jar
urls[5] = file:/C:/Users/Windows/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar
urls[6] = file:/C:/Users/Windows/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
urls[7] = file:/C:/Users/Windows/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb22-plugin/0.12.3/maven-jaxb22-plugin-0.12.3.jar
urls[8] = file:/C:/Users/Windows/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.jar
urls[9] = file:/C:/Users/Windows/.m2/repository/org/glassfish/jaxb/jaxb-xjc/2.2.11/jaxb-xjc-2.2.11.jar
urls[10] = file:/C:/Users/Windows/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.2/maven-plugin-annotations-3.2.jar
Number of foreign imports: 5
import: Entry[import org.sonatype.plexus.build.incremental from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.Scanner from realm ClassRealm[plexus.core, parent: null]] …Run Code Online (Sandbox Code Playgroud)