我到了 (soap:Server)'wsdl'是未声明的命名空间错误
response = client.request :submit_new_order do
soap.body = {"CompanyID" => "EPIC03", "SalesOrderData" => {"SalesOrderDataSet" => {"OrderHed" => {"Company" => "EPIC03", "OrderNum" => "0", "CustNum" => "90", "CustomerCustID" => "VJCUST","TermsCode" => "15", "CurrencyCode" => "USD"}}}} end
在肥皂请求中生成肥皂体
<env:Body><ins0:SubmitNewOrder><ins0:CompanyID>EPIC03</ins0:CompanyID><ins0:SalesOrderData><ins1:SalesOrderDataSet><wsdl:OrderHed><wsdl:TermsCode>15</wsdl:TermsCode><wsdl:CustNum>90</wsdl:CustNum><wsdl:OrderNum>0</wsdl:OrderNum><wsdl:CustomerCustID>VJCUST</wsdl:CustomerCustID><wsdl:Company>EPIC03</wsdl:Company><wsdl:CurrencyCode>USD</wsdl:CurrencyCode></wsdl:OrderHed></ins1:SalesOrderDataSet></ins0:SalesOrderData></ins0:SubmitNewOrder></env:Body>
答案 0 :(得分:0)
尝试以下代码。
client.request(:submit_new_order) do |soap|
client.http.headers['SOAPAction'] = "SOAPAction url goes here"
soap.input = [ "SubmitNewOrder", {"xmlns" => "namespace url goes here"}]
soap.body = {"SalesOrderData"=>{"SalesOrderDataSet"=>{"OrderDtl"=>{"Co mpany"=>"EPIC03","OrderNum"=>0,"OrderLine"=>1,"PartNum"=>"00C1","CustNum"=>90,"SellingQuantity"=>1},"OrderHed"=>{"Company"=>"EPIC03","OrderNum"=>0,"CustNum"=>90,"CustomerCustID"=>"VJCUST","TermsCode"=>15,"CurrencyCode"=>"USD"}},:attributes! => {"SalesOrderDataSet" => { "xmlns" => "" } } },"CompanyID"=>"EPIC03"}
end
它可能对你有帮助。