【问题标题】:what are the differnt in <req:xxx> and <ns1:xxx> in SOAP requestSOAP 请求中的 <req:xxx> 和 <ns1:xxx> 有什么不同
【发布时间】:2016-09-21 07:14:38
【问题描述】:

谁能解释一下&lt;req:xxx&gt;&lt;ns1:xxx&gt; 在soap 请求xml 架构中的用法之间的区别?

例如:-

第一个 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>

第二个 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请求中使用&lt;req:&gt; eg:-&lt;req:initiatePaymentDetailsReq&gt; 在第二个soap请求中&lt;ns1:&gt; eg:-&lt;ns1:ValidateMemberLogin&gt; 他们之间有什么不同。?

【问题讨论】:

    标签: xml web-services soap soapui


    【解决方案1】:

    命名空间前缀不同的事实纯粹是装饰性的,您可以选择您喜欢的任何命名空间前缀,因为它的唯一目的是充当命名空间 URI 的本地缩写。

    但是,这两条消息使用不同的命名空间 URI 这一事实非常重要。 (一个使用http://olp.bank.com/payement/service/olppaymentmanager/req,另一个使用urn:brsmembersapi)这意味着这两条消息使用的是完全不同的词汇,由不同的人定义,含义不同。

    当没有相似之处时,很难“解释差异” - 这就像要求解释考古学和博若莱之间的差异一样。

    【讨论】:

    猜你喜欢
    • 2019-05-01
    • 1970-01-01
    • 2012-02-13
    • 2016-01-13
    • 1970-01-01
    • 2012-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多