I'm trying to use xsd.exe to create a c# class. In particular I'm trying to use http://schemas.opengis.net/wms/1.1.1/capabilities_1_1_1.xml to generate the xsd to then generate the class. I managed to get a class from the 1.3.0 version of the specification via xsd.exe in windows command line but when I try to do the same for this version I get a proxy authentication error like below.
Does anyone know why I would be getting this error when I didn't for the other translation? Also if it really is my proxy blocking xsd then how do I tell xsd to use my credentials for http requests?
![Proxy error image][2]
Let me know if you need more information. Thanks for your time in advance
[2]: http://i.stack.imgur.com/CIbHM.jpg
EDIT: The image doesn't seem to be working for me so I'll just write the error message -
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin>xsd.exe capabilities_1_1_1.xml
Microsoft (R) XML Schemas/Datatypes support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All Rights Reserved.
Error: There was an error processing 'capabilities_1_1_1.xml".
- The remote server returned an error: (407) Proxy Authentication Required.
If you would like more help, please type "xsd /?".
For this one I figured out that the WMS.xml provided by the OGC does NOT have all it's namespaces working correctly. In particular one of the URL references (http://www.digitalearth.gov/wmt/xml/capabilities_1_1_1.dtd) does NOT exist anymore which was confusing my network hence returning a 407 proxy authentication required error.
THE SOLUTION:
Change the DTD referenced in OGCs capabilities.xml file to point to the DTD on their website. Why it doesn't already point to that by default I DO NOT KNOW. digitalearth.gov looks like it's been down since 2006 so it's very old. Anyway once the reference for the DTD was changed I was able to create the XSD and c# class with ease.
Related
I am coding a tool in C# with Visual Studio 2015 that queries a webserver and need authentification against a IBM webseal. Therefor I read in the internet it is possible to do the authentification with a HttpBaseProtocolFilter. But I cannot use it in my program as there is an error. "The Type- or namespacename 'HttpBaseProtocolFilter' was not found (missing using or assembly directive?)"
The documentation under https://learn.microsoft.com/en-us/uwp/api/windows.web.http.filters.httpbaseprotocolfilter says
Namespace: Windows.Web.Http.Filters
Assemblies: Windows.Web.Http.Filters.dll, Windows.dll
But I cannot find it in the IDE under - (hope I translated it correctly).
Hope you got a hint where to look for it.
I am trying to convert the XSD to some C# classes. I've done this with plenty of other files, but I am wondering why this one is not working.
The schema information contains a link in the download section to the XSD file which I've downloaded to my local disk. Then ran the XSD command from the ms dev tools.
This is the dump from the command prompt:
C:\temp\XSD>xsd version-13-draft-ivi-xsd-scheme.xsd /classes /namespace:MyNamespace
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 4.6.1055.0]
Copyright (C) Microsoft Corporation. All rights reserved.
Schema validation warning: The 'http://www.w3.org/2000/09/xmldsig:Signature' element is not declared. Line 17, position 5.
Warning: Schema could not be validated. Class generation may fail or may produce incorrect results.
Error: Error generating classes for schema 'version-13-draft-ivi-xsd-scheme'.
- The element 'http://www.w3.org/2000/09/xmldsig#:Signature' is missing.
If you would like more help, please type "xsd /?".
It seems like the XSD validator can not download the signature namespace. But I an not sure what exactly is happening. Can someone explain what is going wrong?
Download http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd to your local directory, and add it as another parameter to your command:
xsd version-13-draft-ivi-xsd-scheme.xsd xmldsig-core-schema.xsd /Classes
The xsd you are wanting to import contains a reference to that file, on line 7:
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
I debug a site. I need to identify the .NET and ASP.NET version of the running site (on a local IIS).
When I have an .NET Error, the a page is displayed, like this:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please review the
specific error details below and modify your configuration file
appropriately.
Parser Error Message: Unrecognized attribute 'requestValidationMode'.
Note that attribute names are case-sensitive.
Source Error:
Line 120: Line 121: Line
122: Line 123: Line
124:
Source File: C:\mysite\opt\root\web.config Line: 122
Version Information: Microsoft .NET Framework Version: 4.0.30319;
ASP.NET Version: 4.6.1038.0
Is there a way to obtain that data in other way than a error message, to be able to identify that versions at demand?
I would like to stress that .NET and ASP.NET are different, and I need both of them.
PS. I would prefer, if possible do not have to modify the code, but rather via IIS...
You can try either of this below
typeof(Page).Assembly.GetName().Version; //ASP.NET Version
This gives your running ASP.NET version which in my case 4.0.0.0. You can find the same information if you expand your Reference folder -> find System.Web dll -> right click and choose properties -> check the Version information.
System.Environment.Version.ToString(); //Framework Version
This gives the version information of the CLR.
.NET Framework - registry check?
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full
https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx
Environment.Version
should give you the ASP.NET version
Logged into a customer environment today to check logs and just generally do an inspection, only to notice some tasks had failed in one application.
Application is written in c# .net v4 running inside of IIS and exports to Sharepoint 2007.
I can't be 100% sure if .net or SharePoint is the culprit. These are the errors I got:
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\qbckfur1.dll'.
Export 26.05.2011 15:00:21 Failure
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\2shjg2xb.dll'.
Export 26.05.2011 15:30:13 Failure
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\b7utp199.dll'.
Export 26.05.2011 16:00:15 Failure
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\ozr2umkm.dll'.
Does this look familiar to anyone?
This is a problem with XmlSerialization (beleive it or not). I ran into this with a custom ASP.NET MVC app. Apparently, when you call Serialize or Deserialize on types marked as "Serializable", .NET will generate an assembly on-the-fly to support the serialization and it attempts to write that assembly into 'c:\windows\temp'.
Even if Everyone has full control access to that directory I have still seen this occur when running an app from within an IIS App Pool. Especially in applications that has a lot of serialization activity.
If this sounds like your problem, the solution is to "pre-compile" the Serialization assembly and include it in your application with sgen, part of the Windows SDK.
This post highlights a similar issue: Serialization issue on MSDN Social
Here is the MSDN article on the tool: sgen reference
Final Note: There is a separate version of the Tool for .NET 4.0 so make sure you are using the correct version when generating your assembly.
I have to integrate several existing webservices in my .net application. But unfortunately, invoking the svcutil tool results in an error with the message:
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
Copyright (c) Microsoft Corporation. All rights reserved.
Error: Cannot import wsdl:binding
Detail: Cannot find definition for http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/V1.0:EnviarRespuestaVerifi
carIdentidadCliente. Service Description with namespace http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/V1.0
is missing.
Parameter name: name
XPath to Error Source: //wsdl:definitions[#targetNamespace='http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/E
nlace/V1.0']/wsdl:binding[#name='EnviarRespuestaVerificarIdentidadCliente_HttpBinding']
Error: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[#targetNamespace='http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/E
nlace/V1.0']/wsdl:binding[#name='EnviarRespuestaVerificarIdentidadCliente_HttpBinding']
XPath to Error Source: //wsdl:definitions[#targetNamespace='http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/E
nlace/V1.0']/wsdl:service[#name='EnviarRespuestaVerificarIdentidadCliente']/wsdl:port[#name='EnviarRespuestaVerificarIdentidadCliente_HttpPort']
Generating files...
Warning: No code was generated.
If you were trying to generate a client, this could be because the metadata documents did not contain any valid contracts or services
or because all contracts/services were discovered to exist in /reference assemblies. Verify that you passed all the metadata documents to the tool.
Warning: If you would like to generate data contracts from schemas make sure to use the /dataContractOnly option.
Has anyone an idea what causes this problem?
I'm seeing the same issue. I have a set of 30-odd wsdl files in a folder and am trying to create C# client classes for them all.
If I do the following
svcutil /noconfig /namespace:*,My.Required.Namespace *.wsdl
I see a lot of the error you mention (Cannot import wsdl:binding).
However, picking one file at a time
svcutil /noconfig /namespace:*,My.Required.Namespace a.wsdl
Frequently works; sometimes I have to include another file, e.g.
svcutil /noconfig /namespace:*,My.Required.Namespace b.wsdl c.wsdl
This is necessary when attempting to run svcutil on b.wsdl fails due to a dependency on c.wsdl.
Bottom line: I am not sure why I can't create contracts for all of these service definitions in one go, but it doesn't seem possible. I still have a big problem with shared types across the files; this means I effectively have to edit either third-party wsdl or the automatically generated code in order to get things to compile and run correctly.