2009-12-23 5 views
4

후속 조치는 this question입니다.WCF가이 웹 서비스와 대화하는 방법은 무엇입니까?

제안 된대로 by @Benjamin here, 웹 참조가 아닌 대신 내 wsdl에 대한 서비스 참조를 추가하려고합니다.

https://eu.link.fiatauto.com/tsi/DDUWsAut.php?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에서 해당 웹 서비스와 대화 할 수있는 해결 방법이 있습니까?

+0

특이한. http://soapclient.com/soaptest.html은 WSDL에서 완벽하게 작동합니다. 내 생각 엔 어딘가에 태그에 반대하는 것이 있습니까? –

+0

정말 자세히 보시면 (소스보기) 여분의 공간이있는 메시지는 공백을 보여줍니다. – smaclell

답변

3

WSDL에 버그가 있습니다. dduAbortRequest 메시지의 마지막 부분에는 이름 끝에 공백이 있습니다. 아마도 그저 버그 일뿐입니다. 그들에게 그 사실을 알리면 고쳐 줄 것이며, 그들에게 고맙다는 말을 전합니다.

WSDL은있는 그대로 명백하게 무효입니다.

<message name="dduAbortRequest"> 
    <part name="Ticket" type="xsd:string"/> 
    <part name="ServiceId" type="xsd:string"/> 
    <part name="LoginId" type="xsd:string"/> 
    <part name="DocId " type="xsd:string"/> <!-- Should be "DocId" --> 
</message> 
+0

젠장, 정말 파일에서 그걸 찾고 있었는데, 찾지 못했습니다, 감사합니다! – fretje

+0

또한 'dduRollbackRequest'메시지에 대한 문제입니다. IE로 엔드 포인트를 직접 열면이 문제점이 표시되지 않습니다. – smaclell

+0

네, 실제로 파일을 저장하고 공백을 제거 했으므로 이제 svcutil이 코드를 잘 생성합니다. 나는 이것이 다른 문제 (dduLogin method ==> http://stackoverflow.com/questions/1953132/whats-the-problem-with-this-web-service-method)를 해결할 수 있다면 내일 직장에서 확인해야 할 것이다.). 나는 계속 당신을 게시 할 것이다 ;-) – fretje

0

면책 조항 :이 아마도 귀하의 질문에 직접 대답하지 않습니다하지만 난 그냥이 같은 오류 메시지를 해결하기 위해 노력 3 시간 낭비 - 그래서 나도 여기를 게시 할.


Warning: No code was generated 오류 메시지도 C:\Windows\Temp 디렉토리에 응용 프로그램 풀 사용자에 대한 권한의 부족에 의해 유발 될 수있다 (예 정말!).

이 오류가 발생하는 경우 먼저 '서비스 참조 추가'대화 상자를 사용하려는 경우 명령 줄로 전환하는 것이 좋습니다. 서비스 URL에 대해 Fiddler를 열어이 명령을 실행하십시오.

svcutil.exe https://dev.example.com/ShoppingCartWS/WCF/ShoppingCartWCF.svc?wsdl 

당신은 요청 중 하나가 500로 돌아와 (빨간색)와 다음과 같은 응답이 표시되는 경우

ReadResponse() failed: The server did not return a response for this request.                    

그런 C:\Windows\Temp을 확인하고 당신의 응용 프로그램 풀 가지고하는 실행되고 어떤 사용자 추가 사용 권한.

This is where I found the solution - many thanks!.