Book a Demo

Author Topic: Generate WSDL in document/literal/wrapped style  (Read 3981 times)

D. Walter

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Generate WSDL in document/literal/wrapped style
« on: July 31, 2015, 05:10:54 pm »
Dear forum,

I would like to generate a WSDL in Enterprise Architect 11 that follows the document/literal/wrapped style (http://www.ibm.com/developerworks/library/ws-usagewsdl/).

It is possible in EA. The basic "trick" is to have the WSDLmessage parameter refer to a XSDtopLevelElement, not a XSDcomplexType. This way, the message part in the generated WSDL uses an element= attribute, not a type= attribute.

However, I would like to give the XSDtopLevelElement and its XSDcomplexType the same name (which is quite natural). If I do this, EA generates an invalid WSDL with two identical element definitions, see WSDL below.

I assume one definition is due to the XSDtopLevelElement, the other gets generated due to an implicit "Garden of Eden" style generation.
Is there a way to achieve my goal and circumvent this bug?

Many thanks!
D. Walter


The WSDL
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="SampleWSDLFile" targetNamespace="http://www.exampleURI.com/WSDLPackage2" xmlns:tns="http://www.exampleURI.com/WSDLPackage2" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <wsdl:types>
            <xs:schema targetNamespace="http://www.exampleURI.com/WSDLPackage2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:s1="http://www.exampleURI.com/WSDLPackage2">
                  <xs:element name="erstelleAngeboteRequest" type="s1:erstelleAngeboteRequest"/>
                  <xs:complexType name="erstelleAngeboteRequest">
                        <xs:sequence>
                              <xs:element name="content" type="xs:string" minOccurs="1" maxOccurs="1"/>
                        </xs:sequence>
                  </xs:complexType>
                  <xs:element name="erstelleAngebote" type="s1:erstelleAngeboteRequest"/>
                  <xs:element name="erstelleAngeboteResponse" type="s1:erstelleAngeboteResponse"/>
                  <xs:element name="erstelleAngeboteResponse" type="s1:erstelleAngeboteResponse"/>
                  <xs:complexType name="erstelleAngeboteResponse">
                        <xs:sequence>
                              <xs:element name="content" type="xs:string" minOccurs="1" maxOccurs="1"/>
                        </xs:sequence>
                  </xs:complexType>
            </xs:schema>
      </wsdl:types>
      <wsdl:message name="erstelleAngeboteResponse">
            <wsdl:part name="parameters" element="tns:erstelleAngeboteResponse"/>
      </wsdl:message>
      <wsdl:message name="erstelleAngeboteRequest">
            <wsdl:part name="parameters" element="tns:erstelleAngebote"/>
      </wsdl:message>
      <wsdl:portType name="SamplePortTypeSOAP">
            <wsdl:operation name="erstelleAngebote">
                  <wsdl:input name="Request" message="tns:erstelleAngeboteRequest"/>
                  <wsdl:output name="Response" message="tns:erstelleAngeboteResponse"/>
            </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="SampleBindingSOAP" type="tns:SamplePortTypeSOAP">
            <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
            <wsdl:operation name="erstelleAngebote">
                  <soap:operation soapAction="/erstelleAngebote" style="document"/>
                  <wsdl:input name="Request">
                        <soap:body use="literal"/>
                  </wsdl:input>
                  <wsdl:output name="Response">
                        <soap:body use="literal"/>
                  </wsdl:output>
            </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="SampleService">
            <wsdl:port name="SamplePortSOAP" binding="tns:SampleBindingSOAP">
                  <soap:address location="http://www.exampleURI.com/WSDLPackage2/SamplePortSOAP"/>
            </wsdl:port>
      </wsdl:service>
</wsdl:definitions>