2011-02-10 4 views
0

SOAP 인터페이스를 사용하여 Paypal의 Adaptive Payments를 시작하려고합니다. https://svcs.sandbox.paypal.com/AdaptivePayments?WSDL에 서비스 참조를 추가하면 다음과 같은 경고는 비주얼 스튜디오로 표시되는 경우 : C# SOAP의 Paypal Adaptive Payments 시작하기

은 사용자 정의 도구 경고

: 상세 바인딩 : WSDL 가져올 수있는 WSDL의 이름 바인딩 AdaptivePaymentsSOAP11Binding이 유효하지 않습니다를 운영 CancelPreapproval에 대한 일치가 발견되지 않았기 때문에 해당 portType 정의에. XPath 소스 오류 : //wsdl:definitions[@targetNamespace='http://svcs.paypal.com/services']/wsdl:binding[@name='AdaptivePaymentsSOAP11Binding '] C : \ cproj \ daemon \ Service References \ PaypalSandboxApi \ Reference.svcmap 1 1 데몬

이 메시지를 무시하고 참조를 성공적으로 추가했습니다. 트랜잭션을 수행하기 위해 , 나는 클라이언트 만들려고 :

var client = new PaypalSandboxApi.AdaptivePaymentsPortTypeClient() 

이 발생을 InvalidOperationException이 :

ServiceModel은 서비스 클라이언트에서 계약 'PaypalSandboxApi.AdaptivePaymentsPortType'를 참조하는 기본 끝점 요소를 찾을 수 없습니다 구성 섹션. 이는 응용 프로그램에 대한 구성 파일이 없거나이 계약에 일치하는 엔드 포인트 요소가 클라이언트 요소에 없기 때. 일 수 있습니다.

나는 뭔가가 부족합니까?

AdaptivePaymentsSOAP11Binding이 아닌 AdaptivePaymentsPortTypeClient을 사용해야합니까?

답변

1

이 WSDL을 가져 오는 것이 servicemodel config를 생성하지 않는 것 같습니다. 나는 함께이 같은 일 kludged (그리고 당신에 맞게 관련 클래스 명을 업데이 트를, 그래서 당신은 붙여 넣기/복사 할 수 있습니다) :

<system.serviceModel> 
<bindings> 
    <basicHttpBinding> 
    <binding name="PaypalAdaptivePayBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="1048576" maxBufferPoolSize="1048576" maxReceivedMessageSize="1048576" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> 
     <readerQuotas maxDepth="32" maxStringContentLength="65536" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
     <security mode="Transport"> 
     <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> 
     <message clientCredentialType="UserName" algorithmSuite="Default" /> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 
<client> 
    <endpoint address="https://svcs.sandbox.paypal.com/AdaptivePayments" 
    binding="basicHttpBinding" bindingConfiguration="PaypalAdaptivePayBinding" 
    contract="PaypalSandboxApi.AdaptivePaymentsPortType" 
    name="PaypalAdaptivePay" /> 
</client> 

+0

감사합니다. 그 이후로 저는 간단한 XML로 전환하고이 문제를 해결했습니다. – UrK

+0

아마도 좋은 생각입니다 ... 위의 제 대답은 필요한 http 헤더를 보내지 않아도 완료되지 않았습니다. 물론 API는 유용한 오류 메시지의 방식으로 어떤 것도 제공하지 않으므로 다른 형식으로 전환하려고합니다. –