0

我正在使用 Sudzc 来解析一个肥皂 XML。

我正在设置:

amount.currency = @"BRL";

它给了我以下错误:

validation 138 Unsupported currency specified

日志猫:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>validation 138 Unsupported currency specified</faultstring></soap:Fault></soap:Body></soap:Envelope>

我知道wsdl很好。那么我应该在哪里寻找这个错误呢?

SDZPayment* service = [SDZPayment service];
    service.logging = YES;
    service.username = @"**************";
    service.password = @"****************";


    SDZAmount *amount = [SDZAmount new];
    amount.value = (long)100;
    amount.currency = @"BRL";

    SDZCard *card = [SDZCard new];
    card.cvc = @"412";
    card.number = @"21432423423"; 
    card.holderName = @"Marcus Ataide";
    card.expiryMonth = @"12";
    card.expiryYear = @"2017";
    card.brand = @"visa";
    card.issueNumber = @"10";
    card.startMonth = @"10";
    card.startYear = @"2010";

    SDZPaymentRequest *payment = [SDZPaymentRequest new];
    payment.amount = amount;
    payment.card = card;
    payment.merchantAccount = @"*************";
    payment.shopperReference = @"123456";


    // Returns SDZPaymentResult*
    /*  */
    [service authorise:self action:@selector(authoriseHandler:) paymentRequest: payment];

从网络服务:

<xsd:complexType name="Amount">
<xsd:sequence>
<xsd:element minOccurs="1" name="currency">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="3"/>
<xsd:maxLength value="3"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element minOccurs="1" name="value" type="xsd:long"/>
</xsd:sequence>
</xsd:complexType>
4

1 回答 1

0

问题出在命名空间:

在里面,"SDZAmount.m"我需要改变:

[s appendString: [Soap serialize: self.currency]];

至:

[s appendFormat: @"<currency xmlns=\"http://common.services.adyen.com\">%@</currency>", [Soap serialize: self.currency]];
于 2013-04-23T21:49:49.363 回答