SOAP 请求中 <req:xxx> 和 <ns1:xxx> 有什么不同
what are the differnt in <req:xxx> and <ns1:xxx> in SOAP request
谁能解释 soap 请求 xml 模式中 <req:xxx>
和 <ns1:xxx>
用法的区别。?
例如:-
第一个 SOAP 请求XML架构
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://olp.bank.com/payement/service/olppaymentmanager/req">
<soapenv:Header/>
<soapenv:Body>
<req:initiatePaymentDetailsReq>
<olpIdAlias>****</olpIdAlias>
<merchantId>****</merchantId>
<merchantRefNum>234324</merchantRefNum>
<paymentAmount>200</paymentAmount>
<paymentCurrency>SAR</paymentCurrency>
<dynamicMerchantLandingURL></dynamicMerchantLandingURL>
<dynamicMerchantFailureURL></dynamicMerchantFailureURL>
</req:initiatePaymentDetailsReq>
</soapenv:Body>
</soapenv:Envelope>
第 2 个 XML 请求架构
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:brsmembersapi" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:ValidateMemberLogin>
<login xsi:type="ns1:LoginCredentials">
<clientAPIVersion xsi:type="xsd:int">0</clientAPIVersion>
<username xsi:type="xsd:string">someapiusername</username>
<password xsi:type="xsd:string">someapipassword</password>
</login>
<memberLogin xsi:type="ns1:MemberLoginCredentials">
<username xsi:type="xsd:string">somememberusername</username>
<password xsi:type="xsd:string">somememberpassword</password>
</memberLogin>
</ns1:ValidateMemberLogin>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
在第一个 soap 请求中使用 <req:>
例如:-<req:initiatePaymentDetailsReq>
在第二个 soap 请求中 <ns1:>
例如:-<ns1:ValidateMemberLogin>
它们之间有什么区别?
命名空间前缀的不同纯粹是装饰性的,您可以选择任何您喜欢的命名空间前缀,因为它的唯一目的是充当命名空间 URI 的本地缩写。
但这两条消息使用不同的命名空间 URI 这一事实非常重要。 (一个使用http://olp.bank.com/payement/service/olppaymentmanager/req
,另一个使用urn:brsmembersapi
)这意味着这两个消息使用完全不同的词汇表,由不同的人定义并表示不同的事物。
很难 "explain the difference" 没有相似之处 - 这就像要求解释考古学和博若莱之间的区别。
谁能解释 soap 请求 xml 模式中 <req:xxx>
和 <ns1:xxx>
用法的区别。?
例如:-
第一个 SOAP 请求XML架构
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://olp.bank.com/payement/service/olppaymentmanager/req">
<soapenv:Header/>
<soapenv:Body>
<req:initiatePaymentDetailsReq>
<olpIdAlias>****</olpIdAlias>
<merchantId>****</merchantId>
<merchantRefNum>234324</merchantRefNum>
<paymentAmount>200</paymentAmount>
<paymentCurrency>SAR</paymentCurrency>
<dynamicMerchantLandingURL></dynamicMerchantLandingURL>
<dynamicMerchantFailureURL></dynamicMerchantFailureURL>
</req:initiatePaymentDetailsReq>
</soapenv:Body>
</soapenv:Envelope>
第 2 个 XML 请求架构
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:brsmembersapi" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:ValidateMemberLogin>
<login xsi:type="ns1:LoginCredentials">
<clientAPIVersion xsi:type="xsd:int">0</clientAPIVersion>
<username xsi:type="xsd:string">someapiusername</username>
<password xsi:type="xsd:string">someapipassword</password>
</login>
<memberLogin xsi:type="ns1:MemberLoginCredentials">
<username xsi:type="xsd:string">somememberusername</username>
<password xsi:type="xsd:string">somememberpassword</password>
</memberLogin>
</ns1:ValidateMemberLogin>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
在第一个 soap 请求中使用 <req:>
例如:-<req:initiatePaymentDetailsReq>
在第二个 soap 请求中 <ns1:>
例如:-<ns1:ValidateMemberLogin>
它们之间有什么区别?
命名空间前缀的不同纯粹是装饰性的,您可以选择任何您喜欢的命名空间前缀,因为它的唯一目的是充当命名空间 URI 的本地缩写。
但这两条消息使用不同的命名空间 URI 这一事实非常重要。 (一个使用http://olp.bank.com/payement/service/olppaymentmanager/req
,另一个使用urn:brsmembersapi
)这意味着这两个消息使用完全不同的词汇表,由不同的人定义并表示不同的事物。
很难 "explain the difference" 没有相似之处 - 这就像要求解释考古学和博若莱之间的区别。