cancel
Showing results for 
Search instead for 
Did you mean: 

How to import an XSD in NWDS?

che_eky
Active Contributor
0 Kudos

Hi All,

I am trying to import an XSD into NWDS but cannot figure out how When I right click on "External Definitions" I get no options, I thought there might be an option to import an XSD as an external definition:

I can however import the XSD using the following option but do not know how to reference the imported definition in my ESR object:


File -> Import -> Webservices -> XSD

FYI it is not a webservice I wish to implement, just a simple async message whose definition is in the XSD.

Thanks

Che

Accepted Solutions (1)

Accepted Solutions (1)

ankit_srivastava3
Participant
0 Kudos

Hello Che,

When you would try importing the same XSD in ESR swing client as a normal data type, you would get the same error "Type definition not found". Please try and check.

So, please modify sample XSD as suggested by Hareesh and import. In such a case, there is a caution though. When you try activating the object, it will error out complaining missing simple data types included. So, you may have to break the XSD into its simple data types, import them first and then, import the complex data type.

But when you are able to import the same XSD as external definition in XSR swing client, it should not be a show stopper.

Regards,

Ankit

Answers (2)

Answers (2)

former_member184720
Active Contributor
0 Kudos

Hi Che - I'm not sure what is the issue with the above xsd. I'm able to import it in ESR but not in NWDS.

However i modified a bit and i'm able to import with the below.

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="//your target name space">

   <xs:complexType name="shiporder">

      <xs:sequence>

         <xs:element name="orderperson" type="xs:string"/>

         <xs:element name="shipto">

            <xs:complexType>

               <xs:sequence>

                  <xs:element name="name" type="xs:string"/>

                  <xs:element name="address" type="xs:string"/>

                  <xs:element name="city" type="xs:string"/>

                  <xs:element name="country" type="xs:string"/>

               </xs:sequence>

            </xs:complexType>

         </xs:element>

         <xs:element name="item" maxOccurs="unbounded">

            <xs:complexType>

               <xs:sequence>

                  <xs:element name="title" type="xs:string"/>

                  <xs:element name="note" type="xs:string" minOccurs="0"/>

                  <xs:element name="quantity" type="xs:positiveInteger"/>

                  <xs:element name="price" type="xs:decimal"/>

               </xs:sequence>

            </xs:complexType>

         </xs:element>

      </xs:sequence>

      <xs:attribute name="orderid" type="xs:string" use="required"/>

   </xs:complexType>

</xs:schema>

May be you can try..

che_eky
Active Contributor
0 Kudos

Hi Hareesh,

I added the targetNamespace element but again the import complains "Type definitions not found".

former_member184720
Active Contributor
0 Kudos

Did you try importing the xsd provided by me?

i was able to import

Right click on the software component version and import->data types

che_eky
Active Contributor
0 Kudos

Hi Hareesh,

I did not notice you have changed the XSD definition, replacing "element name="shiporder" with "complexType name="shiporder">".

You are correct the above will work but is a pain and I do not want to edit the given XSD.

What Ankit suggests is correct and I will use the XSD imported via the swing client.

Thanks

Che

ankit_srivastava3
Participant
0 Kudos
che_eky
Active Contributor
0 Kudos

Hi Ankit,

I already tried that but the import is not able to pickup the message type in the XSD:

I am able to import the same XSD using the swing client but NWDS is having problems with even the most basic XSD. To prove I have taken a simple example XSD from the net:

<?xml version="1.0" encoding="utf-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="shiporder">

    <xs:complexType>

      <xs:sequence>

        <xs:element name="orderperson" type="xs:string" />

        <xs:element name="shipto">

          <xs:complexType>

            <xs:sequence>

              <xs:element name="name" type="xs:string" />

              <xs:element name="address" type="xs:string" />

              <xs:element name="city" type="xs:string" />

              <xs:element name="country" type="xs:string" />

            </xs:sequence>

          </xs:complexType>

        </xs:element>

        <xs:element name="item" maxOccurs="unbounded">

          <xs:complexType>

            <xs:sequence>

              <xs:element name="title" type="xs:string" />

              <xs:element name="note" type="xs:string" minOccurs="0" />

              <xs:element name="quantity" type="xs:positiveInteger" />

              <xs:element name="price" type="xs:decimal" />

            </xs:sequence>

          </xs:complexType>

        </xs:element>

      </xs:sequence>

      <xs:attribute name="orderid" type="xs:string" use="required" />

    </xs:complexType>

  </xs:element>

</xs:schema>

Can you try importing to NWDS?

Thanks

Che

Former Member
0 Kudos

Hi Che,

Click on the Software Component in IR under which you want to import the xsd files .

Then tick the following check boxes -

Objects are original objects

Objects are modifiable

I think this will solve your issue.

Thanks,

Apu

che_eky
Active Contributor
0 Kudos

Those flags are already ticked.

DG
Active Contributor
0 Kudos

I had to spend some time to find this. How come all other can be imported.

DG
Active Contributor
0 Kudos

It is not External Definitions. The Input will be imported as a normal Datatype. Which is good in some cases. But it does not allow external definitions where you want to import documents that does not fit into a namespace in your system. If it is an UBL document the UBL document namespace will be created with the datatype contained.

So you will still have to use the Swing to import external definitions unfortunately.