从WSDL中如何选择取得Operation Method,并且运行?
假设有一个关于查询汇率的Web Service,它的WSDL如下:
WSDL(片断):
<message name="getRate1">
<part name="country1" type="xsd:string" />
<part name="country2" type="xsd:string" />
</message>
<message name="getRate2">
<part name="country1" type="xsd:string" />
<part name="country2" type="xsd:string" />
<part name="date" type="xsd:string" />
</message>
<message name="getRate3">
<part name="currency1" type="xsd:string" />
<part name="currency2" type="xsd:string" />
</message>
<message name="getRate4">
<part name="currency1" type="xsd:string" />
<part name="currency2" type="xsd:string" />
<part name="date" type="xsd:string" />
</message>
一个查询汇率Web Application得到这个Web Service的WSDL后,怎样判断并且从四个相近的Method中选择一个需要的method呢?注意,Application 是在Run time 获得这个WSDL的,在开发这个Web application的时候是不知道WSDL的内容的.
我也不想在Run time的时候产生动态的Java 代码.因为开发太费功夫了.
谢谢.
WSDL(片断):
<message name="getRate1">
<part name="country1" type="xsd:string" />
<part name="country2" type="xsd:string" />
</message>
<message name="getRate2">
<part name="country1" type="xsd:string" />
<part name="country2" type="xsd:string" />
<part name="date" type="xsd:string" />
</message>
<message name="getRate3">
<part name="currency1" type="xsd:string" />
<part name="currency2" type="xsd:string" />
</message>
<message name="getRate4">
<part name="currency1" type="xsd:string" />
<part name="currency2" type="xsd:string" />
<part name="date" type="xsd:string" />
</message>
一个查询汇率Web Application得到这个Web Service的WSDL后,怎样判断并且从四个相近的Method中选择一个需要的method呢?注意,Application 是在Run time 获得这个WSDL的,在开发这个Web application的时候是不知道WSDL的内容的.
我也不想在Run time的时候产生动态的Java 代码.因为开发太费功夫了.
谢谢.
...全文
相关推荐
eclipse根据wsdl创建webservice服务端.pdf
这样,当服务运行时,Eclipse能够找到并加载这些依赖。5.
Java术语详解(JMS、RPC、Ajax、SOAP、WSDL、JPA、ORM、mvc和JNDI)
在Java中,有多种实现RPC的框架,如RMI(Java Remote Method Invocation)和gRPC,它们简化了分布式系统中的跨网络通信。3.
Flex与.NET互操作
wsdl" useProxy="false"> <mx:operation name="HelloWorld" result="onSuccess(event)" fault="onFault(event
C#.NET_动态调用webservice的三种方式
然而,在某些特定场景下,我们可能需要在运行时动态地调用一个未知的WebService。这种需求往往出现在服务地址不确定、服务接口频繁变动或是为了增强系统的灵活性和扩展性等情况。
Python3 webservice接口测试代码详解
```python# 获取服务的方法列表methods = client.wsdl.services[0].ports[0].methodsfor method in methods: print(method.name


