使用CURL进行POST请求,错误的响应 - 我想

时间:2016-02-24 16:03:37

标签: curl wsdl

我向WSDL发出以下CURL帖子请求

curl --header "Content-Type: text/xml;charset=UTF-8" --header "SOAPAction:urn:ActivateRequest" --data @therequest.txt https://thewebsite.com/SAPISOAP/SAPI?wsdl

request.txt文件由以下内容组成:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Activate xmlns="http://SAPISOAP/">
        <SapiRequest xmlns="">
            <primaryAccountNumber>35463223438965343</primaryAccountNumber>
            <processingCode>100000</processingCode>
            <transactionAmount>1000.00</transactionAmount>
            <transmissionDateTime>160218131500</transmissionDateTime>
            <traceNumber>000911</traceNumber>
            <localTransactionTime>131500</localTransactionTime>
            <localTransactionDate>160218</localTransactionDate>
            <merchantCategoryCode>5311</merchantCategoryCode>
            <pointOfServiceEntryMode>041</pointOfServiceEntryMode>
            <retrievalReferenceNumber>beloga1</retrievalReferenceNumber>
            <sourceIdentifier>BB34343</sourceIdentifier>
            <merchantIdentifier>BB0000001</merchantIdentifier>
            <transactionCurrencyCode>710</transactionCurrencyCode>
            <productID>45445454FDGADTYUJHGFDSG</productID>
            <productType>D</productType>
        </SapiRequest>
    </Activate>
  </s:Body>
</s:Envelope>

我得到的回应如下:

<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:ActivateResponse xmlns:ns2="http://SAPISOAP/"><return><primaryAccountNumber>35463223438965343</primaryAccountNumber><processingCode>100001</processingCode><transactionAmount>1000.00</transactionAmount><transmissionDateTime>160218131500</transmissionDateTime><traceNumber>000911</traceNumber><localTransactionTime>131500</localTransactionTime><localTransactionDate>160218</localTransactionDate><merchantCategoryCode>5311</merchantCategoryCode><pointOfServiceEntryMode>041</pointOfServiceEntryMode><retrievalReferenceNumber>beloga1</retrievalReferenceNumber><responseCode>13</responseCode><sourceIdentifier>BB34343</sourceIdentifier><merchantIdentifier>BB0000001</merchantIdentifier><transactionCurrencyCode>710</transactionCurrencyCode><productID>45445454FDGADTYUJHGFDSG</productID><productType>D</productType><transactionUniqueIdentifier>00000015313F375EBBC5D60091</transactionUniqueIdentifier></return></ns2:ActivateResponse></S:Body></S:Envelope>

我做错了什么?

0 个答案:

没有答案