Web services 使用Savon发送SOAP请求

Web services 使用Savon发送SOAP请求,web-services,soap,savon,Web Services,Soap,Savon,我在使用Savon发送SOAP请求时遇到问题 我得到以下错误: {:fault=> {:faultcode=>"soap:Client", :faultstring=> "Unmarshalling Error: unexpected element (uri:\"\", local:\"api\"). Expected elements are <{}Eft>,<{}Customer>,<{}Safekey>,<{}

我在使用Savon发送SOAP请求时遇到问题

我得到以下错误:

{:fault=>   {:faultcode=>"soap:Client",    :faultstring=>
    "Unmarshalling Error: unexpected element (uri:\"\", local:\"api\"). Expected elements are <{}Eft>,<{}Customer>,<{}Safekey>,<{}Fraud>,<{}Customfield>,<{}BankTransfer>,<{}Creditcard>,<{}Basket>,<{}TransactionType>,<{}Ebucks>,<{}Loyalty>,<{}Soulstace>,<{}TransactionRecord>,<{}AdditionalInformation>,<{}Api>,<{}Autopay>,<{}Stage>,<{}Globalpay> "}}
下面是我希望使用上述代码发送的工作SOAP请求XML(在SoapUI中测试):

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soap.api.controller.web.payjar.com/" xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
  <SOAP-ENV:Header>
   <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken wsu:Id="UsernameToken-9" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
     <wsse:Username>Staging Integration Store 1</wsse:Username>
     <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">78cXrW1W</wsse:Password>
    </wsse:UsernameToken>
   </wsse:Security>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
   <ns1:setTransaction>
    <Api>ONE_ZERO</Api>
    <Safekey>{45D5C765-16D2-45A4-8C41-8D6F84042F8C}</Safekey>
    <TransactionType>PAYMENT</TransactionType>
    <AdditionalInformation>
    <merchantReference>mercRef_1350046243</merchantReference>
     <cancelUrl>http://example.com/cancel-page/</cancelUrl>    
     <returnUrl>http://example.com/return/</returnUrl>
     <supportedPaymentMethods>CREDITCARD</supportedPaymentMethods>
    </AdditionalInformation>
    <Customer>
     <email>john@doe.com</email>
     <firstName>John</firstName>
     <lastName>Doe</lastName>
     <merchantUserId>1350046243</merchantUserId>
    </Customer>
    <Basket>
     <amountInCents>100</amountInCents>
     <currencyCode>ZAR</currencyCode>
     <description>Basket description comes here</description>
    </Basket>
   </ns1:setTransaction>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

暂存集成存储1
78cXrW1W
一零零
{45D5C765-16D2-45A4-8C41-8D6F84042F8C}
付款
mercRef_1350046243
http://example.com/cancel-page/    
http://example.com/return/
信用卡
john@doe.com
约翰
雌鹿
1350046243
100
扎尔
篮子的描述在这里
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soap.api.controller.web.payjar.com/" xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
  <SOAP-ENV:Header>
   <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken wsu:Id="UsernameToken-9" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
     <wsse:Username>Staging Integration Store 1</wsse:Username>
     <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">78cXrW1W</wsse:Password>
    </wsse:UsernameToken>
   </wsse:Security>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
   <ns1:setTransaction>
    <Api>ONE_ZERO</Api>
    <Safekey>{45D5C765-16D2-45A4-8C41-8D6F84042F8C}</Safekey>
    <TransactionType>PAYMENT</TransactionType>
    <AdditionalInformation>
    <merchantReference>mercRef_1350046243</merchantReference>
     <cancelUrl>http://example.com/cancel-page/</cancelUrl>    
     <returnUrl>http://example.com/return/</returnUrl>
     <supportedPaymentMethods>CREDITCARD</supportedPaymentMethods>
    </AdditionalInformation>
    <Customer>
     <email>john@doe.com</email>
     <firstName>John</firstName>
     <lastName>Doe</lastName>
     <merchantUserId>1350046243</merchantUserId>
    </Customer>
    <Basket>
     <amountInCents>100</amountInCents>
     <currencyCode>ZAR</currencyCode>
     <description>Basket description comes here</description>
    </Basket>
   </ns1:setTransaction>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>