【问题标题】:Is there anything I can do if a Service Reference is not working?如果服务参考不起作用,我能做些什么吗?
【发布时间】:2011-06-25 06:33:06
【问题描述】:

我正在尝试在https://www.paypal.com/wsdl/PayPalSvc.wsdl 获取对 Paypal API 的引用,但将其添加为服务引用或 Web 引用会出现

charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported     method is implemented properly. The first 1024 bytes of the response were: '<?xml     version="1.0" encoding="UTF-8"?>
<wsdl:definitions
ns:version="76.0"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns="urn:ebay:api:PayPalAPI"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ebl="urn:ebay:apis:eBLBaseComponents"
xmlns:cc="urn:ebay:apis:CoreComponentTypes"
xmlns:ed="urn:ebay:apis:EnhancedDataTypes"
targetNamespace="urn:ebay:api:PayPalAPI">
<wsdl:types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ebay:api:PayPalAPI" elementFormDefault="qualified" attributeFormDefault="unqualified">
        <import namespace="urn:ebay:apis:CoreComponentTypes" schemaLocation="CoreComponentTypes.xsd"/>
        <import namespace="urn:ebay:apis:eBLBaseComponents" schemaLocation="eBLBaseComponents.xsd"/>
        <import namespace="urn:ebay:apis:EnhancedDataTypes" schemaLocation="En'.
If the service is defined in the current solution, try building the solution and adding the service reference again.

我觉得我做错了什么而不是 paypal 的 API 坏了。 我正在关注的教程没有提到在这种情况下该怎么做,我的研究也没有任何结果。

【问题讨论】:

    标签: c# web-services paypal


    【解决方案1】:

    手动运行 wsdl:

    Error: There was an error processing 'https://www.paypalobjects.com/wsdl/PayPalS
    vc.wsdl'.
      - The document was understood, but it could not be processed.
      - The WSDL document contains links that could not be resolved.
      - The 'maxOccur' attribute is not supported in this context.
    

    看来,wsdl 对 .NET 不太友好。

    【讨论】:

    • 那我该怎么办?该网站唯一的其他选项是 xsd 或类似的东西,它会导致同样的错误。
    • @Brian 我会在这里尝试一切:stackoverflow.com/questions/386155/…
    • 谢谢,我会在今天晚些时候检查一下。
    • 将 maxOccur 更改为 maxOccurs。 WSDL 中的错字。
    猜你喜欢
    • 2023-04-09
    • 2010-12-17
    • 2021-09-15
    • 2021-03-31
    • 2019-06-07
    相关资源
    最近更新 更多