Author |
Message
|
rabee_nawash |
Posted: Mon Feb 09, 2015 4:53 am Post subject: Remove Namespace from anyType |
|
|
Apprentice
Joined: 01 Dec 2014 Posts: 27
|
Dears,
I'm using Mapping node to transform the content from one element to another in XMLNSC domain (SOAP Message). In the source type we have an element of type xsd:anyType that I want to pass it to destination with same type (anyType), but when the client send the soap message , they include the namespace as part of the anyType tag like this
<ministrySpecificData xsi:type="p487:MoHComplaintDetails" xmlns:p487="http://xxx.xxx..xxx">
so when I do the mapping the tag elements with namespace are moved to the target element and a SOAP fault message thrown since the elements are not recognized by the target web service,
How can I remove the elements from this tag and move the childs of the anyType tag only |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 09, 2015 5:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
you have to remove the namespace from any element it is on and you don't want to be on.
I.e. your routine to remove namespaces must be recursive. Go walk the tree but use a reference.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Mon Feb 09, 2015 5:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
fjb_saper wrote: |
I.e. your routine to remove namespaces must be recursive. Go walk the tree but use a reference. |
A search will turn up any number of discussions on this, and some example code. You may find this easier in ESQL, i.e. map it with a Mapping node and then use a Compute node to remove namespaces.
Or Not. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Feb 09, 2015 5:44 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
When using the mapping node, the output is controlled by the schema that you are mapping to.
So you need a WSDL for the message you are receiving, that has the xsi and namespace types. You need a second WSDL for the service you are calling, that does not have these xsi and namespace types. |
|
Back to top |
|
 |
rabee_nawash |
Posted: Tue Feb 10, 2015 4:55 am Post subject: |
|
|
Apprentice
Joined: 01 Dec 2014 Posts: 27
|
Thank you for reply everything went fine to remove the namespace xmlns:p487="http://xxx.xxx..xxx" using the .(XMLNSC.NamespaceDecl)* = null but I still can't remove the xsi:Type , WMB dosn't consider it Element or Field. Is there a way to remove this xsi:type="p487:MoHComplaintDetails" |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 10, 2015 5:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rabee_nawash wrote: |
Thank you for reply everything went fine to remove the namespace xmlns:p487="http://xxx.xxx..xxx" using the .(XMLNSC.NamespaceDecl)* = null but I still can't remove the xsi:Type , WMB dosn't consider it Element or Field. Is there a way to remove this xsi:type="p487:MoHComplaintDetails" |
If the elements in the document are not in any namespace and don't use the declared type, what does it matter if there happens to be a namespace declaration or type? It doesn't affect the content of the XML. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Feb 10, 2015 5:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
rabee_nawash wrote: |
Thank you for reply everything went fine to remove the namespace xmlns:p487="http://xxx.xxx..xxx" using the .(XMLNSC.NamespaceDecl)* = null but I still can't remove the xsi:Type , WMB dosn't consider it Element or Field. Is there a way to remove this xsi:type="p487:MoHComplaintDetails" |
O.K. this is going to be a more delicate answer... You really need to check your setup and I would suggest you do use a mapping node...
Typically even when there is no namespace for the elements there is a namespace for the message and for the types. It all depends on how your xsds and wsdl setup has been done...
So removing the namespace from the types may not be the answer...
Also removing the namespace declaration does not remove the namespace. It just means that the declaration will be repeated everywhere it is applied.
Like we said before, you need to walk the tree. Removing the namespace declaration is just the first step...
Or, and in your case I would suggest it, use a mapping node.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|