Author Topic: <import> XSD in generated WSDL  (Read 916 times)

D. Walter

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
<import> XSD in generated WSDL
« on: July 28, 2015, 10:24:34 pm »
Hi,

we are modeling a web service in EA and generate its WSDL via Code engineering / Generate WSDL. Due to technical reasons, we want to have all type definitions in a separate XML Schema .xsd file. The generated WSDL should therefore look roughly like the following:

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="SampleWSDLFile" targetNamespace="http://www.exampleURI.com/WSDLPackage1" xmlns:tns="http://www.exampleURI.com/WSDLPackage1" 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" xmlns:t="http://www.exampleURI.com/Schema1">
      <wsdl:types>
            <xs:schema>
                  <xs:import namespace="http://www.exampleURI.com/Schema1" schemaLocation="Schema1.xsd"/>
            </xs:schema>
      </wsdl:types>
    <!-- WSDL main part -->
    
</wsdl:definitions>

However, if we generate a new WSDL skeleton (via More tools / WSDL / Namespace), and move all types referenced by WSDLmessages to a separate schema file, no import statement as above is generated. Instead, we obtain an empty types section and the WSDL becomes invalid, as the message parts refer to types not qualified with namespace, which are obviously unknown to the WSDL.

Does anybody know a solution to this problem? AFAIK, it is quite common to have all type definitions collected in an XSD, not in the WSDL.

Many thanks, D. Walter

dudebaba

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: <import> XSD in generated WSDL
« Reply #1 on: August 07, 2015, 05:58:08 am »
I am trying to do the same thing. Also EA is only generating the xsd inside the WSDL, if I have some kind of folder structure its not generating anything. Please help.

WSDL
      ->WSDLnamespace>>http://xxx.yyy.tt.us
         -><XSDschema>>Types
            ->common
                -><<XSDcomplextype>>Address
                    ->city



<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="CBAInterface" targetNamespace="http://xxx.yyy.tt.us" 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:import namespace="http://www.w3.org/2001/XMLSchema"/>
      <wsdl:types>
            <xs:schema targetNamespace="http://xxx.yyy.tt.us" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://xxx.yyy.tt.us" xmlns:s1="http://xxx.yyy.tt.us"/>
      </wsdl:types>
      <wsdl:message name="CBAResponse">
            <wsdl:part name="status" type="xs:String"/>
      </wsdl:message>
      <wsdl:message name="CBARequest">
            <wsdl:part name="nybeID" type="xs:int"/>
            <wsdl:part name="personInfo" type="Individual"/>
            <wsdl:part name="address" type="Address"/>
      </wsdl:message>
      <wsdl:portType name="PortTypeHTTP">
            <wsdl:operation name="submitCBA">
                  <wsdl:input name="Request" message="CBARequest"/>
                  <wsdl:output name="Response" message="CBAResponse"/>
            </wsdl:operation>
      </wsdl:portType>
      <wsdl:portType name="PortTypeSOAP">
            <wsdl:operation name="submitCBA">
                  <w