2017-11-17 3 views
1

현재 SOAP를 통해 웹 서비스와 인터페이스하려고합니다 (불행히도 제공하는 유일한 인터페이스/프로토콜). 웹 서비스를 더 쉽게 사용할 수 있도록 여기에서 볼 수있는 WSDL을 제공합니다 : http://demo.coveto.de/soap?wsdl (application/soap + xml 대신 content type text/html로 태그가 붙어있어서 정말 이상하게 보이고 VS는이를 받아들이지 않습니다. 따라서 로컬 파일에 저장해야합니다.PHP로 생성 된 WSDL을 Visual Studio로 가져 오기 20130

WSDL을 Visual Studio 2017로 importaing하는 중 문제가 발생했습니다. 이해할 수있는 한 WSDL (URL 또는 로컬 파일)을 서비스 참조로 추가하는 것이 좋습니다.

Warning  Custom tool warning: Cannot import wsdl:binding 
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on. 
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='https://demo.coveto.de/soap']/wsdl:portType[@name='coveto_soapWebservicePort'] 
XPath to Error Source: //wsdl:definitions[@targetNamespace='https://demo.coveto.de/soap']/wsdl:binding[@name='coveto_soapWebserviceBinding']  

Warning  Custom tool warning: Cannot import wsdl:port 
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. 
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='https://demo.coveto.de/soap']/wsdl:binding[@name='coveto_soapWebserviceBinding'] 
XPath to Error Source: //wsdl:definitions[@targetNamespace='https://demo.coveto.de/soap']/wsdl:service[@name='coveto_soapWebserviceService']/wsdl:port[@name='coveto_soapWebservicePort'] 

Warning  Custom tool warning: Cannot import wsdl:portType 
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter 
Error: The datatype 'http://schemas.xmlsoap.org/soap/encoding/:Array' is missing. 
XPath to Error Source: //wsdl:definitions[@targetNamespace='https://demo.coveto.de/soap']/wsdl:portType[@name='coveto_soapWebservicePort'] 

(이 경고가 아닌 오류를 말하는 동안 아무것도 더 있지만, 다른 경고를 확인을 말합니다 실제 오류가 있습니다) :이 나에게 명확하지 VS17에서 다음과 같은 오류가 팝업

나는 마지막 하나만이 실제로 문제라고 생각할 것이고, 나머지 두 가지는 간단하게 그것으로 인해 생기는 것이라고 나는 생각할 것이다.

SOAP 또는 WSDL에 대해 많이 알지 못하므로 문제가 정확히 무엇인지 정확하게 지적하고 있습니다. 나는 경고에 언급 된 스키마를 다운로드하려고했지만 URL을 여러 위치 또는 파일 이름 (wsdl 파일과 같은 디렉토리)으로 바꾸면 새로운 오류가 많이 발생합니다. 유형 X는 이미 있습니다. 정의되었거나 대상 네임 스페이스가있는 스키마를 찾을 수 없습니다. 필자는 이것이 WSDL 파일의 구조에 대한 일반적인 이해가 아닌 것으로 생각합니다.

도움을 많이 받으실 수 있습니다. 응답 Content-Type:text/html; charset=UTF-8 때문에

답변

0

내가 비주얼 스튜디오 2017

  1. WSDL 파일 http://demo.coveto.de/soap?wsdl에 대한 링크로 WSDL 파일을 가져 시도한 것은 유효하지 않습니다. 콘텐츠 유형은 Content-Type:text/xml;charset=UTF-8이어야합니다.

  2. PHP 내부 SoapClient는 그리 좋지 않습니다. 대신 Zend SoapClient을 사용해보십시오.

이 나를 위해 작동합니다

<?php 

// composer require zendframework/zend-soap 

require_once __DIR__ . '/vendor/autoload.php'; 

$client = new Zend\Soap\Client("http://demo.coveto.de/soap?wsdl"); 
$result1 = $client->getFunctions(); 
var_dump($result1); 
+0

감사에 대답하는 시간을내어! Zend SoapClient를 설치했는데 어떻게 도움이 될지 모르겠다. PHP (C# 응용 프로그램)를 사용할 수없고 웹 서비스 (다른 회사)를 제어 할 수 없다. –

+0

그런 다음이 버그를이 회사에보고해야합니다. – DanielO

관련 문제