By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,967 Members | 815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,967 IT Pros & Developers. It's quick & easy.

Problem Importing Schema

P: n/a
Ali
I am having problem compiling schema contained in WSDL file when analyzing
schema types contained in it (for example
http://www.ebout.net/net/GoogleSearch.wsdl).

Following code demonstrates my problem:

using System.Diagnostics;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Net;
using System.Web.Services.Description;

namespace ProblemDemonstration
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
//populate ServiceDescription
string s = @"http://www.ebout.net/net/GoogleSearch.wsdl";
//string s = @"http://sdm.lbl.gov/srm-wg/srm.v1.1.wsdl";

WebRequest oRequest = WebRequest.Create(s);
WebResponse oResponse = oRequest.GetResponse();
Stream oStream = oResponse.GetResponseStream();
ServiceDescription oServiceDescription = ServiceDescription.Read(oStream);
oStream.Close();
oResponse.Close();

//compile schema in it
XmlSchema oSchema = oServiceDescription.Types.Schemas[0];
oSchema.Compile(new ValidationEventHandler(ValidationHandler), new
XmlUrlResolver());
}

private static void ValidationHandler(object sender, ValidationEventArgs e)
{
Debug.WriteLine(e.Message);
}
}
}

It produces following validation events:
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Undefined complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' is
used as a base for complex type restriction".
Undefined complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' is
used as a base for complex type restriction".

I must be missing some fundamental step but I cannot figure out what it is.
Any suggestion will be of great help.

PS:
I can import this WebService into the Visual Studio just fine but when I try
to use WSDL.EXE tool like this, it reports the same errors.

C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin>wsdl /l:cs
/o:GoogleProxy.cs http://www.ebout.net/net/GoogleSearch.wsdl
/n:GoogleWebService

Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 1.1.4322.573]
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Writing file 'GoogleProxy.cs'.

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
CG
I compiled your code. it worked like a champ. I am not sure why you are
getting that error.

try again....

"Ali" wrote:
I am having problem compiling schema contained in WSDL file when analyzing
schema types contained in it (for example
http://www.ebout.net/net/GoogleSearch.wsdl).

Following code demonstrates my problem:

using System.Diagnostics;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Net;
using System.Web.Services.Description;

namespace ProblemDemonstration
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
//populate ServiceDescription
string s = @"http://www.ebout.net/net/GoogleSearch.wsdl";
//string s = @"http://sdm.lbl.gov/srm-wg/srm.v1.1.wsdl";

WebRequest oRequest = WebRequest.Create(s);
WebResponse oResponse = oRequest.GetResponse();
Stream oStream = oResponse.GetResponseStream();
ServiceDescription oServiceDescription = ServiceDescription.Read(oStream);
oStream.Close();
oResponse.Close();

//compile schema in it
XmlSchema oSchema = oServiceDescription.Types.Schemas[0];
oSchema.Compile(new ValidationEventHandler(ValidationHandler), new
XmlUrlResolver());
}

private static void ValidationHandler(object sender, ValidationEventArgs e)
{
Debug.WriteLine(e.Message);
}
}
}

It produces following validation events:
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Undefined complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' is
used as a base for complex type restriction".
Undefined complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' is
used as a base for complex type restriction".

I must be missing some fundamental step but I cannot figure out what it is.
Any suggestion will be of great help.

PS:
I can import this WebService into the Visual Studio just fine but when I try
to use WSDL.EXE tool like this, it reports the same errors.

C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin>wsdl /l:cs
/o:GoogleProxy.cs http://www.ebout.net/net/GoogleSearch.wsdl
/n:GoogleWebService

Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 1.1.4322.573]
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Writing file 'GoogleProxy.cs'.

Nov 21 '05 #2

P: n/a
Code works but event handler is reporting errors. Did you look at the Output
(it uses Debug.Writeline)?

Tomas

"CG" wrote:
I compiled your code. it worked like a champ. I am not sure why you are
getting that error.

try again....

"Ali" wrote:
I am having problem compiling schema contained in WSDL file when analyzing
schema types contained in it (for example
http://www.ebout.net/net/GoogleSearch.wsdl).

Following code demonstrates my problem:

using System.Diagnostics;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Net;
using System.Web.Services.Description;

namespace ProblemDemonstration
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
//populate ServiceDescription
string s = @"http://www.ebout.net/net/GoogleSearch.wsdl";
//string s = @"http://sdm.lbl.gov/srm-wg/srm.v1.1.wsdl";

WebRequest oRequest = WebRequest.Create(s);
WebResponse oResponse = oRequest.GetResponse();
Stream oStream = oResponse.GetResponseStream();
ServiceDescription oServiceDescription = ServiceDescription.Read(oStream);
oStream.Close();
oResponse.Close();

//compile schema in it
XmlSchema oSchema = oServiceDescription.Types.Schemas[0];
oSchema.Compile(new ValidationEventHandler(ValidationHandler), new
XmlUrlResolver());
}

private static void ValidationHandler(object sender, ValidationEventArgs e)
{
Debug.WriteLine(e.Message);
}
}
}

It produces following validation events:
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Namespace 'http://schemas.xmlsoap.org/soap/encoding/' is not available to be
referenced in this schema.
Undefined complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' is
used as a base for complex type restriction".
Undefined complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' is
used as a base for complex type restriction".

I must be missing some fundamental step but I cannot figure out what it is.
Any suggestion will be of great help.

PS:
I can import this WebService into the Visual Studio just fine but when I try
to use WSDL.EXE tool like this, it reports the same errors.

C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin>wsdl /l:cs
/o:GoogleProxy.cs http://www.ebout.net/net/GoogleSearch.wsdl
/n:GoogleWebService

Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 1.1.4322.573]
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'http://schemas.xmlsoap.org/soap/encoding/' is not available to be referenced
in this schema.
Writing file 'GoogleProxy.cs'.

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.