Reputation: 653
Can anybody explain the difference between <req:xxx>
and <ns1:xxx>
usage in soap request xml schema .?
eg:-
1st SOAP request XML Schema
<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>
2nd XML Request schema
<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>
in first soap request using <req:>
eg:-<req:initiatePaymentDetailsReq>
in second soap request <ns1:>
eg:-<ns1:ValidateMemberLogin>
what are the diffrent between them.?
Upvotes: 0
Views: 1340
Reputation: 163458
The fact that the namespace prefixes are different is purely cosmetic, you can choose any namespace prefix you like, as its only purpose is to act as a local abbreviation for the namespace URI.
But the fact that the two messages use different namespace URIs is extremely significant. (One uses http://olp.bank.com/payement/service/olppaymentmanager/req
, the other uses urn:brsmembersapi
) This means that the two messages are using completely different vocabularies defined by different people and meaning different things.
It's hard to "explain the difference" when there is no similarity - it's like asking for an explanation of the difference between archaeology and Beaujolais.
Upvotes: 1