svcutil.exe generates errors while wsdl.exe runs through without
I'm looking into generating a web-service conforming to the WSDL found at:
http://assets.cdn.gamigo.com/xml/connection-service/1.0.10/account.wsdl
When I run with svcutil.exe like this:
svcutil.exe /language:C# /out:GamigoServices.cs http://assets.cdn.gamigo.com/xml/connection-service/1.0.10/account.wsdl
I get these errors:
Error: Cannot import wsdl:binding
Detail: The given key was not present in the dictionary.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://connection.ga
mes.gamigo.com/v_1_0']/wsdl:binding[@name='DefaultAccountServiceServiceSoapBindi
ng']
Error: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is depend
ent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://connection.ga
mes.gamigo.com/v_1_0']/wsdl:binding[@name='DefaultAccountServiceServiceSoapBindi
ng']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://connection.ga
mes.gamigo.com/v_1_0']/wsdl:service[@name='AccountService']/wsdl:port[@name='Acc
ountServicePort']
I also tried a tool, Wscf:Blue, which gives me the same errors (it's a WCF VS plugin which, supposably, would do yet a lot more for me once I get past this step).
On the other hand, if I use wsdl.exe (which I don't want because I want to use WCF, and, as far as I understand, I need to use svcutil.exe for WCF, but I just tried wsdl.exe in my attempts to narrow down the source of the problems) like this:
wsdl.exe http://assets.cdn.gamigo.com/xml/connection-service/1.0.10/account.wsdl /serverInterface
there are no errors.
I've been trying all kinds of things with local copies of the WSDL (and the types.xsd which it references), commenting out sections etc. to narrow down the problem. However, it really boils down to exactly what the error message is referring to, the definition of that binding. I've also googled, but the few references to this kind of error are not helpful at all. Besides, I'm particularly puzzled by the fact that wsdl.exe seems perfectly fine with that WSDL. I also used http://xmethods.net/ve2/WSDLAnalyzer.po# to validate the WSDL, no errors were shown.
So, now I'm at the point where I really got no idea how to proceed. As the whole issue is somewhat time-critical - by next week I should really start with implementation -, I might end up using the code generated by wsdl.exe and going for the older technology obsoleted by MS, but for several (obvious) reasons I'd rather not go that route. So if anyone has any idea what to do to make svcutil.exe work with that, I'd be grateful. I might add that while I cannot modify the definition, I might be able to convince the publisher of that WSDL to perform certain edits or at least publish a second version for my purposes.
Many thanks,
Max
Vienna,
开发者_如何学编程Austria
step1. Stare at your WSDL file
step2. ensure that the wsdl:portType "aligns with" wsdl:binding (i.e. all operations are defined in a corresponding way under portType and binding).
step3. Thank me for the best advice ever when dealing with svcUtil errors such as "the given key was not present in the dictionary" :-)
Svcutil.exe is used for the WCF service. If its a web service wsdl.exe will work fine. I think you are using the svcutil.exe for the web service so it is giving error.
精彩评论