cancel
Showing results for 
Search instead for 
Did you mean: 

managing XSD types extension

Former Member
0 Kudos

Dear all,

I need to use in a message mapping a message type imported as an external definition.

This message type contains complex types defined as extensions of other types.

For example :

<xsd:complexType name="ProfessionnelType">

<xsd:annotation>

<xsd:documentation>

Classe Professionnel.

</xsd:documentation>

</xsd:annotation>

<xsd:complexContent>

<b><xsd:extension base="UtilisateurType"></b>

<xsd:sequence>

<xsd:element name="raisonSociale" type="dico:ProfessionnelRaisonSocialeType" minOccurs="0" /> <xsd:element name="codeAPE" type="dico:ProfessionnelCodeAPEType" minOccurs="0" />

<xsd:element name="numeroSIRET" type="dico:ProfessionnelNumeroSIRETType" minOccurs="0" />

<xsd:element name="clientPrioritaire" type="dico:ProfessionnelClientPrioritaireType" minOccurs="0" />

</xsd:sequence>

</xsd:extension>

</xsd:complexContent>

</xsd:complexType>

The problem I have is when I want to use my message type in a message mapping, I only see the fields of the basic types, not the ones of the extended types. So of course I am not able to use the data contained in these fields.

The first workaround I thought about was creating a user-defined function in the mapping that would allow me to access via the java coding the elements I could not see in the graphical interface, but I am not sure it is possible. Is it correct ? Or does someone have a code sample to do this ?

Or is there another solution ? XSLT ? java mapping ? ABAP mapping ?

Thanks in advance for your help.

Best regards,

Julien

PS : the XSDs are provided by the cusomer and I have to use them as they are, I am not allowed to modify them

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I would check if this is supported in PI.

<xsd:extension>

It is feasible that this is not.

If it is not, there is an option of using XSLT mapping to output the message in the format you need instead of using the external definition.

I have done this where I could not use the WSDL provided by the supplier.

Cheers

Colin.

Former Member
0 Kudos

Hi Colin,

we also came to the conclusion that we had to use XSLT to perform what we want.

Thanks for your help.

Cheers,

Julien

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Julien,

When you load the external definition (WSDL), click on the tab for "External References".

Is anything shown here ? I would expect each of the types referenced in the WSDL to be listed.

Cheers

Colin.

Message was edited by:

Colin Bickell

Former Member
0 Kudos

Hi Colin,

thanks for answering.

I load a WSDL, not an XSD. Anyway, when I click on "External References", I see that the WSDL references 2 XSD files.

Cheers,

Julien

Former Member
0 Kudos

Hi,

Sorry - this was a typo.

When you load the WSDL and under the External References, you say that you can see two External References.

There are two columns - source and name.

The source field will list the 2 XSDs that are referenced. Do you have these to load as "External Definitions" - if not you will need to get these from the customer and load into XI as "Exterrnal Definitions" as well.

Once you have confirmed these are loaded into XI, I will let you know how to link them all together so you can see all sub-elements.

Cheers

Colin.

Former Member
0 Kudos

Hi Colin,

yes, the 2 referenced XSDs are already loaded in XI as external references...

Cheers,

Julien

Former Member
0 Kudos

Hi,

OK, here is what you need to do to link them together:

1. On each of the referenced XSDs, type the source name (from the WSDL external references) in the field <b>Source</b> under the field Filename.

2. Save the XSDs changes and activate.

3. View the WSDL external definition external references and you should now see the column Name has been filled in with your referenced XSD that you loaded separately.

This is all you need to do. You will now be able to see the sub-elements in mapping.

Post back if any queries.

Cheers

Colin.

Former Member
0 Kudos

Hi Colin,

the source field is already filled. When I double-click on the referenced XSD from the WSDL external definition, the XSD external definition opens in the Integration Repository.

So I guess the link between the WSDL and the XSDs is OK...

Cheers,

Julien

Former Member
0 Kudos

Hi,

Your xsd is wrong. Use this one. The namespace was missing which is required in any xsd. if you are not getting this from your customer then ask him to provide that. Now i have added and tested and working fine.

<b><?xml version="1.0" encoding="ISO-8859-1"?>

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

<xsd:complexType name="ProfessionnelType">

<xsd:annotation>

<xsd:documentation>

Classe Professionnel.

</xsd:documentation>

</xsd:annotation>

<xsd:complexContent>

<xsd:extension base="UtilisateurType">

<xsd:sequence>

<xsd:element name="raisonSociale" type="dico:ProfessionnelRaisonSocialeType" minOccurs="0" />

<xsd:element name="codeAPE" type="dico:ProfessionnelCodeAPEType" minOccurs="0" />

<xsd:element name="numeroSIRET" type="dico:ProfessionnelNumeroSIRETType" minOccurs="0" />

<xsd:element name="clientPrioritaire" type="dico:ProfessionnelClientPrioritaireType" minOccurs="0" />

</xsd:sequence>

</xsd:extension>

</xsd:complexContent>

</xsd:complexType>

<b></xsd:schema></b>

There is no question of using any other mapping like JAVA or ABAP as you have mentioned.

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh,

thanks for your answer, but the example I gave was just a sample of the full file. The XSD is embedded in a WSDL, which starts like this :

<?xml version="1.0" encoding="ISO-8859-1"?>

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.mycustomernamespace.com">

<wsdl:types>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dico="http://www.mycustomer.fr/myproject/xsd/dictionnaire/" xmlns="http://www.mycustomer.fr/myproject/xsd/SituationContractuelle/" targetNamespace="http://www.mycustomer.fr/myproject/xsd/SituationContractuelle/" elementFormDefault="qualified" attributeFormDefault="unqualified">

As I said, there is no way I can modify the WSDL or referenced XSD files.

Best regards,

Julien