cancel
Showing results for 
Search instead for 
Did you mean: 

Extract an XSD definition from an WSDL or removing the namespace definition

Former Member
0 Kudos

Hi experts,

Is there any way of extracting an xsd file from an wsdl definition?Is it possible to extract the WSDL inline XSD into an external XSD file?

I want to achieve that because I need removing the namespace prefix from the XML tags when trying to map an external definition in PI.

In my integration I have a really complex xml incoming from the web service. And it is exposed as a main WSDL where it is defined the header of the XML and many imports of XSD definitions begining like this:

  [.......]
<wsdl:types>
<xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ccccc" xmlns:ns0="http://com.xxxxxx" xmlns:ns1="http://com.yyyyy"  elementFormDefault="unqualified">

<xsd:import schemaLocation="file1.xsd" namespace="http://com.xxxxxx"/>  
 <xsd:import schemaLocation="file2.xsd" namespace="http://com.yyyyy"/> 
[.......] 

<xsd:complexType name="oneOfThese">
                     <xsd:choice>
			<xsd:element ref="ns0:file1"/>
			<xsd:element ref="ns1:file2"/>
		     </xsd:choice>
 </xsd:complexType>
            <xsd:complexType name="getProductResponseType">
                <xsd:sequence>

                    
[.......] 

                    <xsd:element name="product" nillable="true" type="tns:oneOfThese"/>

                </xsd:sequence>
            </xsd:complexType>

So, when I get the external definition to a message mapping the imported schemas (file1.xsd, file2.xsd) get the namespace definition in his tags:

<ok/>
   <errorCode/>
   <errorDescription/>
   <internalCode/>
   <product>


      <ns1:informeFinanciero xmlns:ns1="http://com.repsol.informa.contabilidad/schema/informeFinanciero">
         <ns1:identificacionLocalizacion>
            <ns1:identificacion>
               <ns1:tipoIdentificaciones>
                     <ns1:tipologia/>
                     <ns1:valor/>
                  </ns1:tipoIdentificacion>
               </ns1:tipoIdentificaciones>
   
</product>

So as you can see the mapping expects the xml with the namespace prefix ( <ns1:name> ) in the tags.

My problem is that I need my xml without this tags in the message mapping. I know that if taking the XSD imported definition instead the WSDL it works.

So my question is:

Is there any way of doing the mapping to not expect the namespace prefix?

Regards

Gonzalo

Edited by: Gonzalo del Castillo on Mar 23, 2010 4:48 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Gonzalo,

I dont think even if you convert into xsd it will go. The best would be to use XMLAnonymizerBean in your sender communication channel. Please see stefans blog for this:

/people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

The problem is not removing the namespace from the incoming message. I have to remove it from the message mapping.

Regards

Gonzalo

Former Member
0 Kudos

Hi Gonzalo,

Its not going to remove the namespace. It is only going to remove the prefix not the entire namespace which is what you want to have.

Regards,

---Satish

Former Member
0 Kudos

OK, I am going to explore the solution and I tell you something. Thanks.

Regards

Gonzalo

Edited by: Gonzalo del Castillo on Mar 23, 2010 6:45 PM