Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

XSD TO WSDL transformation

juraj14
Explorer

Hello i would like to ask you for a help.

My main goal is to use Simple Transformation to transform XML to ABAP, but i dont really want to create exporting table and all of its structures manually. Only thing i have is XSD schema (its based on EDIFACT INVOIC)

S i Google a bit and found out i can use program SPROX_XSD2WSDL to generate WSDL from my XSD and than create Enterprise service - Service consummer using this WSDL and it creates structures automatically. However while trying to create this Service consumer it gives me error and i cant tell if the problem is in my XSD or WSDL. I am not good in XML language so i cant figure out where is problem.

Here is error i get when i try to consume my WSDL file.

Of course i tried to "play" with both files XSD and WSDL, tried to add some targetNamespace etc. but as i said am not good in XML so i really dont know what am doing.

Thanks for any help.

3 REPLIES 3

Sandra_Rossi
Active Contributor
0 Kudos

Did you try

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://dummy" targetNamespace="http://dummy">

?

juraj14
Explorer

Yes, i just tried it, result was same, same error. i even tried add tns and targetNamespace definition into schema:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://dummy" targetNamespace="http://dummy" elementFormDefault="qualified" attributeFormDefault="unqualified">

I still get error but different one:

Sandra_Rossi
Active Contributor
0 Kudos

Good to know that it solves the target namespace issue. Now the issue is that the SAP algorithm doesn't recognize elements which appear later in the XSD. Move the element INVOIC element from the beginning to the end of the definitions, and UNH will be found:

   <xs:element name="INVOIC">
    <xs:annotation>
     <xs:documentation>Root element</xs:documentation>
    </xs:annotation>
    <xs:complexType>
     <xs:sequence>
      <xs:element ref="UNH"/>
      <xs:element ref="BGM"/>
      <xs:element ref="DTM" minOccurs="3" maxOccurs="3"/>
      <xs:element ref="RFF" minOccurs="0" maxOccurs="4"/>
      <xs:element ref="NAD" minOccurs="2" maxOccurs="2"/>
      <xs:element ref="CUX"/>
      <xs:element ref="ALC" minOccurs="0"/>
      <xs:element ref="LIN" maxOccurs="unbounded"/>
      <xs:element ref="UNS"/>
      <xs:element ref="MOA" maxOccurs="6"/>
      <xs:element ref="TAX" minOccurs="0" maxOccurs="10"/>
      <xs:element ref="UNT"/>
     </xs:sequence>
    </xs:complexType>
   </xs:element>