svcutil.exe cannot handle imports?

I'm on a project in which a .NET frontend communicates with a Java backend. We use wdsl's + xsd's to describe the interface between front and backend. I'm on the frontend side in .NET 4.0. We used to generate code for the interfaces with xsd.exe & wsdl.exe, but we want to switch to WCF now, so I'm trying to use svcutil.exe. However, I keep getting errors. I've tracked it down to an <import> statement used, so I've tried the example for that from the w3 site: W3.org site import example

I've saved those 3 example files there as StockQuoteService.wsdl, StockQuote.wsdl and StockQuote.xsd and set the location attribute to those files. I've fixed a bug (in StockQuoteService.wdsl the binding should be StockQuoteSoapBinding, not StockQuoteBinding). Then I run svcutil like this:

svcutil StockQuoteService.wsdl *.xsd /serializer:XmlSerializer

And presto, exactly the same errors as with our xsd/wsdl's:

Error: Cannot import wsdl:binding Detail: Cannot find definition for http://example.com/stockquote/definitions:StockQuotePortType. Service Description with namespace http://example.com/stockquote/definitions is missing. Parameter name: name XPath to Error Source: //wsdl:definitions[@targetNamespace='http://example.com/stockquote/service']/wsdl:binding[@name='StockQuoteSoapBinding']

StockQuotePortType is in StockQuote.wsdl which is included in StockQuoteService.wsdl, but it seems like scvutil cannot find it. With our own files we have a similar situation.

I am new to WCF, can anyone explain what is going on here?

链接地址: http://www.djcxy.com/p/34300.html

上一篇: 在WCF和Biztalk中从WSDL导入键/值complexType定义

下一篇: svcutil.exe无法处理导入?