Java 添加新属性的wsdl扩展
我正在做与WSDL相关的项目,我想向我的WSDL文件添加新属性。 WSDL的主要结构是:Java 添加新属性的wsdl扩展,java,web-services,soap,wsdl,Java,Web Services,Soap,Wsdl,我正在做与WSDL相关的项目,我想向我的WSDL文件添加新属性。 WSDL的主要结构是: <definitions> <types> data type definitions........ </types> <message> definition of the data being communicated.... </message> <portType> set of operations....
<definitions>
<types>
data type definitions........
</types>
<message>
definition of the data being communicated....
</message>
<portType>
set of operations......
</portType>
<binding>
protocol and data format specification....
</binding>
</definitions>
数据类型定义。。。。。。。。
正在传送的数据的定义。。。。
一套操作。。。。。。
协议和数据格式规范。。。。
我想做的是向wsdl添加服务质量(QoS)属性,因此新结构如下所示:
<definitions>
<types>
data type definitions........
</types>
<message>
definition of the data being communicated....
</message>
<portType>
set of operations......
</portType>
<binding>
protocol and data format specification....
</binding>
<QoS>
Qos criteria.....
</QoS>
</definitions>
数据类型定义。。。。。。。。
正在传送的数据的定义。。。。
一套操作。。。。。。
协议和数据格式规范。。。。
Qos标准。。。。。
例如,此属性将添加到wsdl中:
<Reliability Qualification="threshold-best-effort" Offered="true">
<TimeToFailure value= 500000000 unit="sec" source="measured"
type=”mean” direction=”increasing />
</Reliability>
结果应该是这样的,
属性将被插入到
中:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://sample" xmlns:qwsdl="http://example.com/stockquote/schemas" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://sample" xmlns:intf="http://sample" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:import namespace = "http://localhost:8080/WSDLExtention/wsdl/stockquote.xsd" location="http://localhost:8080/WSDLExtention/wsdl/stockquote.xsd"/>
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://sample" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="myCalculation">
<complexType>
<sequence>
<element name="decimal" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="myCalculationResponse">
<complexType>
<sequence>
<element name="myCalculationReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="myCalculationResponse">
<wsdl:part element="impl:myCalculationResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="myCalculationRequest">
<wsdl:part element="impl:myCalculation" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="Calculation">
<wsdl:operation name="myCalculation">
<wsdl:input message="impl:myCalculationRequest" name="myCalculationRequest">
</wsdl:input>
<wsdl:output message="impl:myCalculationResponse" name="myCalculationResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CalculationSoapBinding" type="impl:Calculation">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="myCalculation">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="myCalculationRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="myCalculationResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CalculationService">
<wsdl:port binding="impl:CalculationSoapBinding" name="Calculation">
<wsdlsoap:address location="http://localhost:8080/Action1/services/Calculation"/>
</wsdl:port>
<Reliability Qualification="threshold-best-effort" Offered="true">
<TimeToFailure value= 500000000 unit="sec" source="measured"
type=”mean” direction=”increasing />
</Reliability>
</wsdl:service>
</wsdl:definitions
WSDL有一个标准,您不能像这样定制它
根据您的绑定按照此架构定义
显然,您可以使用schema()来实现
但我从未尝试过,没有任何样本。有什么属性?你有什么失败?你能详细说明你尝试了什么以及你面临什么异常吗?谢谢你的回复,我能在
中插入这个属性吗?因为我在这本杂志上看到了这是可能的,但我真的不确定怎么做()。
<element name="service" type="wsdl:serviceType"/>
<complexType name="serviceType">
<complexContent>
<extension base="wsdl:documented">
<sequence>
<element ref="wsdl:port" minOccurs="0" maxOccurs="unbounded"/>
<any namespace="##other" minOccurs="0"/>
</sequence>
<attribute name="name" type="NCName" use="required"/>
</extension>
</complexContent>
</complexType>