ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Remove Namespace from anyType

Post new topic  Reply to topic
 Remove Namespace from anyType « View previous topic :: View next topic » 
Author Message
rabee_nawash
PostPosted: Mon Feb 09, 2015 4:53 am    Post subject: Remove Namespace from anyType Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Mon Feb 09, 2015 5:20 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Feb 09, 2015 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Mon Feb 09, 2015 5:44 am    Post subject: Reply with quote

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
View user's profile Send private message
rabee_nawash
PostPosted: Tue Feb 10, 2015 4:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Feb 10, 2015 5:37 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Feb 10, 2015 5:40 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Remove Namespace from anyType
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.