Announcement Announcement Module
Collapse
No announcement yet.
namespace issue - DOMException: NAMESPACE_ERR Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • namespace issue - DOMException: NAMESPACE_ERR

    Hi,
    we are struggling with CASTOR marcchalling for executing a service request. we are seeing DOMException: NAMESPACE_ERR exception. Let me tell you what i have before telling the problem.

    Mapping XML:

    <?xml version="1.0"?>
    <mapping>

    <!-- Request Elements -->

    <class name="com.fmr.fiis.springws.TransactionHistoryDeta ilRequestBean">
    <map-to xml="srvc:TransactionMonetaryInquireSingle" xmlns:srvc="http://www.fmr.com/fiis/1.0/fiis-services"/>
    <field name="orgTaNo" type="java.lang.String">
    <bind-xml name="data:OrgTaNo" node="element" xmlns:data="http://www.fmr.com/fiis/1.0/fiis-data"/>
    </field>
    <field name="accountNo" type="java.lang.String">
    <bind-xml name="data:AccntTaNo" node="element" location="data:AccountTaRef" xmlns:data="http://www.fmr.com/fiis/1.0/fiis-data"/>
    </field>
    <field name="fundNo" type="java.lang.String">
    <bind-xml name="data:FundNo" node="element" location="data:FundRef" xmlns:data="http://www.fmr.com/fiis/1.0/fiis-data"/>
    </field>
    <field name="topsConfirmNo" type="java.lang.String">
    <bind-xml name="data:TopsConfirmNo" node="element" xmlns:data="http://www.fmr.com/fiis/1.0/fiis-data"/>
    </field>
    <field name="transactionId" type="java.lang.String">
    <bind-xml name="data:TransactionIdTx" node="element" xmlns:data="http://www.fmr.com/fiis/1.0/fiis-data"/>
    </field>
    </class>
    </mapping>

    Actual XML Expected:
    When executed throught plain java class in local JRE through RAD it works fine and gives below response.
    <SOAP-ENV:Body>
    <srvc:TransactionMonetaryInquireSingle>
    <data:AccountTaRef>
    <data:AccntTaNo></data:AccntTaNo>
    </data:AccountTaRef>
    <data:FundRef>
    <data:FundNo></data:FundNo>
    </data:FundRef>
    <data:TransactionIdTx></data:TransactionIdTx>
    </srvc:TransactionMonetaryInquireSingle>
    </SOAP-ENV:Body>

    Problem:
    When deployed in websphere portal server and when the service is called, we are facing below problems:

    Note that TransactionMonetaryInquireSingle element should have "srvc" prefix and others should have "data" as prefix
    1) If i mention srvc:TransactionMonetaryInquireSingle and namespace -xmlns:srvc="http://www.fmr.com/fiis/1.0/fiis-services" in <map-to> it throws below error.

    "Get descriptor for: com.fmr.fiis.afc.accounts.requestresponse.Transact ionHistoryDetailRequestBean found: org.exolab.castor.xml.util.XMLClassDescriptorAdapt er@7b30498; descriptor for class: com.fmr.fiis.afc.accounts.requestresponse.Transact ionHistoryDetailRequestBean; xml name: srvc:TransactionMonetaryInquireSingle

    Service org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces."


    2) If I mention - ns-uri="http://www.fmr.com/fiis/1.0/fiis-services" ns-prefix="srvc" instead of xml="srvc:TransactionMonetaryInquireSingle" in <map-to> srvc prefix gets appended for TransactionMonetaryInquireSingle and AccountTaRef elements (since AccountTaRef is mentioned as location attribute it applies the parent prefix to this also). It generates XML as below which has wrong prefix for AccountTaRef

    <SOAP-ENV:Body>
    <srvc:TransactionMonetaryInquireSingle>
    <srvc:AccountTaRef>
    <data:AccntTaNo></data:AccntTaNo>
    </srvc:AccountTaRef>
    <srvc:FundRef>
    <data:FundNo></data:FundNo>
    </srvc:FundRef>
    <data:TransactionIdTx></data:TransactionIdTx>
    </srvc:TransactionMonetaryInquireSingle>
    </SOAP-ENV:Body>


    Could anyone please help with this? I am really confused why it is working with local JRE and not in the server.
Working...
X