capdragon
capdragon

Reputation: 14899

Error generating Interface with svcutil.exe

Can someone help me generate the Interface (c#) file for the following OGC schema?

Schema files: Download Schema Files Link

I need to create web services for the Ordering wsdl in the schema zip file above. I've been at it for days now with no luck generating the interface. I've tried:

svcutil.exe thewsdl.wsdl /language:c# /out:ITheInterface.cs

svcutil Order.wsdl /out:IOrder.cs

svcutil Order.wsdl Order.xsd ..\ws-addressing\ws-addr.xsd /out:IOrder.cs

svcutil Order.wsdl Order.xsd ws-addr.xsd /out:IOrder.cs

and i get the following error:

Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1]
Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Cannot read ws-addr.xsd.

    Cannot load file D:\Documents\DEV\SARPilot\Docs\eoschema\schema\OrderSchema\ws-addr.xsd as an Assembly. Check the FusionLogs f
or more Information.

    Could not load file or assembly 'file:///D:\Documents\DEV\SARPilot\Docs\eoschema\schema\OrderSchema\ws-addr.xsd' or one of its
 dependencies. The module was expected to contain an assembly manifest.

Upvotes: 2

Views: 4065

Answers (2)

Paul McCarthy
Paul McCarthy

Reputation: 890

Another thing to be aware of is the encoding of the wsdl file. I received a wsdl file but it was not encoded with UTF-8 and so I got the 'could not load file or assembly' message. The fact that it says assembly is completely misleading, as is often the case with Microsoft errors. In my opinion the word "or" should be banned from error messages. Anyway the soloution was to open the wsdl in Notepad++ and convert to UTF-8. (Encoding-Convert to UTF-8)

Upvotes: 0

capdragon
capdragon

Reputation: 14899

Okay, so i've gotten past this error. (i get more now, but those are for another question).

I opened the ws-addr.xsd file in VS2010 and looked down the warnings list. one said:

Warning 105 The XML editor tried to convert this DTD to XSD so it can provide validation and intellisense while you type, but it could not create a valid XSD schema. Perhaps this DTD uses constructs that do not map to XSD. You may be able to get more information about the problem by using the Create Schema command. D:\Documents\DEV\SARPilot\Docs\eoschema\schema\ws-addressing\ws-addr.xsd 3 11 D:...\schema\

So i man went to "http://www.w3.org/2005/08/addressing/ws-addr.xsd" and downloaded the correct one and replaced it.

I no longer got the warning 105, and no longer get the "Could not load file" error with svcutil

Upvotes: 1

Related Questions