很抱歉,我不知道这是问题还是功能要求。我用谷歌搜索,但找不到答案,因此将其发布在这里。
我正在使用以下代码生成SOAP
@client = Savon.client(wsdl: "https://easypaystg.easypaisa.com.pk/easypay-service/PartnerBusinessService/META-INF/wsdl/partner/transaction/PartnerBusinessService.wsdl",
ssl_verify_mode: :none,
log: true,
log_level: :debug,
pretty_print_xml: true,
env_namespace: :soapenv,
namespaces: {"xmlns:soapenv" => "http://schemas.xmlsoap.org/soap/envelope/",
"xmlns:dto" => "http://dto.transaction.partner.pg.systems.com/",
"xmlns:dto1" => "http://dto.common.pg.systems.com/"}
)
message = {
"dto:initiateTransactionRequestType": { "dto1:username": "xyz@gmail.com", "dto1:password": "adasdasdasdsadasddas", channel: "internet", storeId: "4886", transactionType: "MA", msisdn: "M", mobileAccountNo: "+xxxxxxxxxx", emailAddress: "xyz@gmal.com" }
}
@client.call(:initiate_transaction,
:message => message, soap_action: false
)
<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://transaction.partner.pg.systems.com/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dto="http://dto.transaction.partner.pg.systems.com/" xmlns:dto1="http://dto.common.pg.systems.com/">
<soapenv:Body>
**<wsdl:initiateTransaction>**
<dto:initiateTransactionRequestType>
<dto1:username>xyz@abc.com</dto1:username>
<dto1:password>asdssadasdasdasdsa</dto1:password>
<channel>internet</channel>
<storeId>4886</storeId>
<transactionType>MA</transactionType>
<msisdn>M</msisdn>
<mobileAccountNo>xxxxxxxx</mobileAccountNo>
<emailAddress>abc@gmail.com</emailAddress>
</dto:initiateTransactionRequestType>
</wsdl:initiateTransaction>
</soapenv:Body>
</soapenv:Envelope>
但是该服务需要
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:dto="http://dto.transaction.partner.pg.systems.com/" xmlns:dto1="http://dto.common.pg.systems.com/">
**<soapenv:Header />
<soapenv:Body>
<dto:initiateTransactionRequestType>**
<dto1:username>pgsystems</dto1:Username>
<dto1:password>9b01234324vxddc0b</dto1:Password>
<channel>Internet</channel>
<orderId>000000001</orderId> <storeId>465</storeId>
<transactionAmount>5000.00</transactionAmount>
<transactionType>OTC</transactionType>
<msisdn></msisdn>
<mobileAccountNo>034632401722</mobileAccountNo>
<emailAddress>abc@test.com</emailAddress>
</dto:initiateTransactionRequestTyp
e>
</soapenv:Body>
</soapenv:Envelope>
这只是系统所需的信封和我的信封之间的区别。所以问题是当我使用@ client.call(:method)函数时,SAVON会自动将标签添加到请求中,请帮我解决此问题。