cancel
Showing results for 
Search instead for 
Did you mean: 

Error importing xsd as external definition

Former Member
0 Kudos

I'm importing a wsdl file as external definition and it references some xsd files that I'm trying to import too. Specifically there are 2 of them that I can't import in PI, as I get the next error:

Error when loading XML document (Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.UnknownHostException: www.w3.org)

XSD files might be found under next urls:

[XAdES.xsd|https://www3.aeat.es/ADUA/internet/es/aeat/dit/adu/xades/XAdES.xsd]

[xmldsig-core-schema.xsd|https://www3.aeat.es/ADUA/internet/es/aeat/dit/adu/xades/xmldsig-core-schema.xsd]

and are meant to be used to sign the document.

I have validated the files using the service in the next url:

[http://www.w3.org/2001/03/webdata/xsv|http://www.w3.org/2001/03/webdata/xsv] as well as in Altova XML Spy.

Has anyone any idea of what the problem might be? It is really interfering in my development.

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Though some questions are unanswered yet main problems have been overcome.

ONavas
Participant
0 Kudos

Hi Eduardo,

I solve similar situation with an AEAT Interfaces (Ie118) by editing the original wsdl and xsd files in the schemalocation tags, and making the next modificataion:

Original:

https://www3.agenciatributaria.gob.es/static_files/common/internet/dep/aduanas/es/aeat/dit/adu/adi0/...

To modified:

Before the import, all files (XSD and WSDL) need to be in the same path.

In my example, I need to import Ie118 WSDL with all references, and I changed SchemaLocation in all files and copy all to the same path.

Import procedure for external definitions

Please check Import Reference Also because.

If you need more help about this procedure, please don't hesitate to contact to me

Shabarish_Nair
Active Contributor
0 Kudos

in this blog it talks about importing XSD files with references - /people/james.guanzon/blog/2006/02/22/how-to-support-industry-standards-in-xi-part-i-of-iii--interfaces

use it as help

other references -

Former Member
0 Kudos

Hi Shabarish thanks for you answer (and your great blogs ). The problem however is not with the references. Those xsd files can't be imported even independently, so it is something that is wrong with the xsd files but I don't know what exactly.

The error suggest a problem with the host www.w3.org which is however a perfectly valid host.

Shabarish_Nair
Active Contributor
0 Kudos

did you try removing references to www.w3.org and importing?

Former Member
0 Kudos

Ok I think I might have solved it. First there was a pair of problems with the file xmldsig-core-schema.xsd.

1. The name couldn't be used in PI as '-' characters are not allowed.

I changed the name to xmldsig_core_schema.xsd

2. The file had these lines at the start:

<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
	<!ATTLIST schema
	xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#"
>
	<!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
	<!ENTITY % p ''>
	<!ENTITY % s ''>
]>

PI doesn't like that if you import the file as XSD because I guess that is DTD not XSD format.

I removed those lines.

With these two changes this file could be imported.

However I still had problems with the XAdES.xsd file. PI couldn't recognize the import of xmldsig-core-schema.xsd file:

<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/
REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>

It didn't like the URL, so I changed it to make reference to my local file.

After this, it all worked. The question is, will it also work in runtime when I'll make use of these external definitions created? Or will my changes have an impact on the results? I guess it will work fine but perhaps I'm wrong.

Besides, when activated I got the next warning:

Name of '/schema/complexType("TimeStampType")/sequence/choice/element("XMLTimeStamp")' starts with 'xml'

There's an element name that starts by XML. Is this forbidden? Will I have problems if I activate and use it just as it is?

Thanks for the answers.

former_member190389
Active Contributor
0 Kudos

Use this

schemaLocation="xmldsig-core-schema.xsd"

And place this xsd file in server0 directory of XI

former_member200962
Active Contributor
0 Kudos
There's an element name that starts by XML. Is this forbidden? Will I have problems if I activate and use it just as it is?

At least when we create a DT in XI/ PI any name which starts with xml/ XML is not allowed.....however if you import an XSD into XI/ PI then the same may however be accepted.

Regards,

Abhishek.

Former Member
0 Kudos

Hi Eduardo,

We were having the same issue, thanks for the solution! The solution for us was definitely what you suggested:

Renaming xmldsig-core-schema.xsd to xmldsig_core_schema.xsd and removing the following fromxmldsig_core_schema.xsd

<!DOCTYPE schema

  PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"

[

   <!ATTLIST schema

     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">

   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>

   <!ENTITY % p ''>

   <!ENTITY % s ''>

  ]>

Again Thanks,

Shari