简体   繁体   English

Java Web服务客户端

[英]Java web services client

I want to build a web services client that takes wsdl link as the input and generates java classes. 我想构建一个将wsdl链接作为输入并生成Java类的Web服务客户端。 I know we can do this directly using Netbeans IDE where we provide the wsdl location during project setup. 我知道我们可以直接使用Netbeans IDE进行此操作,我们在项目设置过程中提供了wsdl位置。 But I want the wsdl location to be provided when the client starts running. 但是我希望在客户端开始运行时提供wsdl位置。 How do I do this? 我该怎么做呢?

Is the location that will be provided just used to specify the SOAP endpoint (for a web service whose WSDL was known at development time), or will it be a completely arbitrary WSDL? 是将提供的位置仅用于指定SOAP端点(对于在开发时知道WSDL的Web服务),还是将其完全是任意的WSDL?

In the first case, the web service client that was created by Netbeans has methods that accept an alternate SOAP endpoint URL. 在第一种情况下,由Netbeans创建的Web服务客户端具有接受备用SOAP端点URL的方法。 You can call those to use the client with a server whose location is not hard-coded in the client. 您可以调用这些服务器,以将客户端与服务器上的位置进行硬编码的服务器一起使用。

If however, the WSDL describes a completely unrelated service, how are you going to write Java code against it? 但是,如果WSDL描述了一个完全不相关的服务,您将如何针对该服务编写Java代码? You cannot use any interfaces derived from the WSDL (because they are not known at development time). 您不能使用从WSDL派生的任何接口(因为在开发时未知)。 You could only have a very generic SOAP client, where the user almost directly types in the XML that will be sent. 您只能有一个非常通用的SOAP客户端,用户几乎可以在其中直接键入将要发送的XML。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM