후속 조치는 this question입니다.WCF가이 웹 서비스와 대화하는 방법은 무엇입니까?
제안 된대로 by @Benjamin here, 웹 참조가 아닌 대신 내 wsdl에 대한 서비스 참조를 추가하려고합니다.
문제는 Visual Studio를 빈 codefile를 생성하는 것입니다 : 여기에 문제의 WSDL에 대한 URL은
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3603
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace test.ServiceReference1 {
}
내가 수동으로 사용하여 코드를 생성 할 때 svcutil, 나는 다음을 얻는다 :
C:\temp>svcutil https://eu.link.fiatauto.com/tsi/DDUWsAut.php?wsdl Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation. All rights reserved. Attempting to download metadata from 'https://eu.link.fiatauto.com/tsi/DDUWsAut. php?wsdl' using WS-Metadata Exchange or DISCO. Error: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.Se rviceModel.Description.XmlSerializerMessageContractImporter Error: The ' ' character, hexadecimal value 0x20, cannot be included in a name. Parameter name: name XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:ddu']/wsdl:portT ype[@name='dduPortType'] Error: Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is de pendent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='urn:ddu']/wsdl:port Type[@name='dduPortType'] XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:ddu']/wsdl:bindi ng[@name='dduBinding'] 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='urn:ddu']/wsdl:bindi ng[@name='dduBinding'] XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:ddu']/wsdl:servi ce[@name='ddu']/wsdl:port[@name='dduPort'] Generating files... Warning: No code was generated. If you were trying to generate a client, this could be because the metadata docu ments did not contain any valid contracts or services or because all contracts/services were discovered to exist in /reference assembl ies. 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.
5 월 서비스 참조 대신 웹 참조를 추가하여 서비스를 사용하려고 할 때 문제가 있다는 사실과 관련이 있습니다 (내 other question 참조).
그 wsdl에는 문제가있는 것 같지만 정확히 무엇을 찾을 수 없습니다.
다른 사람들이 이미 사용하고있는 제 3 자 서비스이므로 서비스 변경을 기꺼이 받아들이지 않을 것이라고 생각합니다. 따라서 .NET에서 해당 웹 서비스와 대화 할 수있는 해결 방법이 있습니까?
특이한. http://soapclient.com/soaptest.html은 WSDL에서 완벽하게 작동합니다. 내 생각 엔 어딘가에 태그에 반대하는 것이 있습니까? –
정말 자세히 보시면 (소스보기) 여분의 공간이있는 메시지는 공백을 보여줍니다. – smaclell