web services - namespace duplicate issue in xml -


i encountering namespace duplicate issue in response xml of webservice. have responder.xsd uses customer.xsd , common.xsd response xml structured using elements in these 2 xsds. sample xml response below:

... <ns:roletype></ns:roletype> <ns:addresses>   <ns:postalinfo>     <comm:addressline></comm:addressline>     <comm:city></comm:city>   </ns:postalinfo> </ns:addresses> <ns:validflag></ns:validflag> ... 

where ns: customer namespace , comm: common namespace.

but response below

... <ns1:roletype xmlns:ns1="urn:customer:domain:5"></ns1:roletype> <ns2:addresses xmlns:ns2="urn:customer:domain:5">   <ns2:postalinfo>     <ns3:addrline xmlns:ns3="urn:common:domain:5"></ns3:addrline>     <ns4:city xmlns:ns4="urn:common:domain:5"></ns4:city>   </ns2:postalinfo> </ns2:addresses> <ns5:validflag xmlns:ns3="urn:customer:domain:5></ns5:validflag> ... 

can me understand why same namespace duplicating incremental numbers ns1,ns2 , comm1,comm2 etc? how can fix this?

updated: code snippet formed , root element.

<gethcpresponse xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns="urn:services:serviceresponder:5" xsi:schemalocation="urn:services:serviceresponder:5 c:\users\vijay\desktop\wsdl\wsdl\service_5_2\serviceresponder.xsd">         <statuscode>0</statuscode>         <statusmessage>success</statusmessage>         <hcp>             <ns1:id xmlns:ns1="urn:customer:domain:5">29199486</ns1:id>             <ns2:customerclass xmlns:ns2="urn:customer:domain:5">hcp</ns2:customerclass>             <ns3:customerstatus xmlns:ns3="urn:customer:domain:5">a</ns3:customerstatus>             <ns4:roletype xmlns:ns4="urn:customer:domain:5">p</ns4:roletype>             <ns5:addresses xmlns:ns5="urn:customer:domain:5">                 <ns5:postalcontact>                     <ns5:masteraddressid>15863814</ns5:masteraddressid>                     <ns5:postalinfo>                         <ns6:addressline lineno="1" xmlns:ns6="urn:commontypes:domain:5">8252 nw 25th st</ns6:addressline>                         <ns7:city xmlns:ns7="urn:commontypes:domain:5">doral</ns7:city> 

...

thanks, vijay

namespace prefixes matter because of namespace uri they're bound. actual value of namespace prefix otherwise insignificant.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -