简体   繁体   中英

Twinfield Please supply a valid soap action

Twinfield SOAP XML Web service is returning the following error, Can we find the action method from wsdl ( https://api.accounting2.twinfield.com/webservices/finder.asmx?wsdl ) or what action method shall I give?

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Client</faultcode>
            <faultstring>Unable to handle request without a valid action parameter. Please supply a valid soap action.</faultstring>
            <detail />
        </soap:Fault>
    </soap:Body>
</soap:Envelope>


curl --location --request POST 'https://api.accounting2.twinfield.com/webservices/finder.asmx?wsdl' \
--header 'AccessToken: eyJ0eXAiOiJKV1QiLCJhbGciOiJ...' \
--header 'Content-Type: application/xml' \
--data-raw '       <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:twin="http://www.twinfield.com/">
        <soapenv:Header>
<twin:Header>            <twin:AccessToken>eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni....</twin:AccessToken>
<twin:CompanyCode>
                #####
            </twin:CompanyCode>
               </twin:Header>
             </soapenv:Header>
            
                    <soapenv:Body>
                  
        <twin:ProcessXmlDocument>
         <twin:xmlRequest><list xmlns=""><type>offices</type></list></twin:xmlRequest>
      </twin:ProcessXmlDocument>
     </soapenv:Body>
</soapenv:Envelope>'

SoapAction is in wsdl file. Also you need to add correct companycode as well.

To get offices, the right api is parserxml, rather finder

I believe type should be "OFF" instead of "offices" as stated in the documentation linked below:

https://accounting.twinfield.com/webservices/documentation/#/ApiReference/Miscellaneous/Finder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM