2

I am doing project related to WSDL, and I wanto to add new attribute to my WSDL file. Main structure of WSDL is:

<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>

What I want to do is to add Quality of Service (QoS) attribute to the wsdl, so the new structure is become like this:

<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>

For example this attribute will be added to the wsdl:

  <Reliability Qualification="threshold-best-effort" Offered="true">
        <TimeToFailure value= 500000000 unit="sec" source="measured"
        type=”mean” direction=”increasing />
 </Reliability>

The result should be like this, the <Reliability> attribute will be inserted into <service>:

<?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

I try to add new schema to the wsdl,but it always fail. Is it possible to do it? Any idea how to add this new attribute to WSDL file?

2
  • What is the attribuate ? and what failure do you have ?
    – Shahzeb
    May 28, 2015 at 3:45
  • can you elaborate on what you tried and what exception your facing ?
    – Leo.pd
    May 28, 2015 at 5:29

1 Answer 1

0

WSDL has a standard definition, you can not customize it like this.

Define as per this schema based on your binding.

http://www.w3.org/TR/wsdl#A4.2

Apperently, you can do it using this schema (Ext)

<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>

But I never tried this, don't have any sample.

1

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.