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 » faultcode and the SOAP-ENV: data value

Post new topic  Reply to topic
 faultcode and the SOAP-ENV: data value « View previous topic :: View next topic » 
Author Message
Broady
PostPosted: Tue Apr 28, 2009 5:13 am    Post subject: faultcode and the SOAP-ENV: data value Reply with quote

Novice

Joined: 16 Apr 2004
Posts: 23
Location: Halifax, West Yorkshire, England

We are using Broker v6.0.
We are receiving a web service response with a faultcode value of 'SOAP-ENV:Server'.
Or response to the .net client passes this data and lets the broker default the namespace prefix to NS1:
But the .net client (or it's web interface) fails as it parses the data looking for a declared namespace for SOAP-ENV.

The solution I want is to pick out the data portion of the faultcode without it's namespace prefix and then create the client reply msg with the Broker default of NS1 as it's namespace.

I am declareing my namespace as DIM and setting DIM:Fault as the parent element of faultcode, which is itself not namespaced.
Broker is then creating a NS1 xmlns attribute for me for the envelope namespace and prefixing all my DIMs to NS1.

Can I have ESQL that gets the Broker to add NS1: to the outgoing faultcode of 'Server', assuming I can get it in the first place?

I am trying to avoid using string manipulation to do this; thats cheating. Surely there is a XMLNSC equivalent to FIELDVALUE or XML.Attribute to grab data not namespaces prefixes within the data?

By the way we do not use an MRM and will not on this occasion. Please help with a solution that is all ESQL. Thanks.
_________________
Alan Broadbent
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 28, 2009 5:21 am    Post subject: Re: faultcode and the SOAP-ENV: data value Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Broady wrote:
lets the broker default the namespace prefix to NS1:


Why? Why not set it to SOAP-ENV?

Broady wrote:
The solution I want is to pick out the data portion of the faultcode without it's namespace prefix and then create the client reply msg with the Broker default of NS1 as it's namespace.


Again, why? What's your design thinking here?

Broady wrote:
Surely there is a XMLNSC equivalent to FIELDVALUE or XML.Attribute to grab data not namespaces prefixes within the data?


Yes - it's FIELDVALUE. This returns the data portion of an element. FIELDNAME returns the name, FIELDNAMESPACE returns the namespace.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Broady
PostPosted: Tue Apr 28, 2009 5:26 am    Post subject: Reply with quote

Novice

Joined: 16 Apr 2004
Posts: 23
Location: Halifax, West Yorkshire, England

Thanks for replying..

To set it to SOAP-ENV (without a MRM) would mean to code the namespace declarations as global for the project; i.e. code them in between the modules. But this then impacts subflows as well, which are common resusable ones, in that they use the same prefix names and are counted as duplicate.

And so I am having to rely on the Broker using NS1 and so the data portion of faultcode is unparsable as SOAP-ENV.

I used FIELDVALUE and it returned 'SOAP-ENV:Server'.
_________________
Alan Broadbent
Back to top
View user's profile Send private message
Broady
PostPosted: Tue Apr 28, 2009 5:29 am    Post subject: Reply with quote

Novice

Joined: 16 Apr 2004
Posts: 23
Location: Halifax, West Yorkshire, England

this is the layout as it stands now...reply to client

<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/">
<NS1:Header/>
<NS1:Body>
<NS1:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>This is an operation implementation generated fault</faultstring>
<faultactor/>
_________________
Alan Broadbent
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 28, 2009 5:30 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Broady wrote:
To set it to SOAP-ENV (without a MRM) would mean to code the namespace declarations as global for the project; i.e. code them in between the modules. But this then impacts subflows as well, which are common resusable ones, in that they use the same prefix names and are counted as duplicate.


That's fairly easy to fix.

Broady wrote:
I used FIELDVALUE and it returned 'SOAP-ENV:Server'.


I'm surprised.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 28, 2009 5:31 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Broady wrote:
this is the layout as it stands now...reply to client

<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/">
<NS1:Header/>
<NS1:Body>
<NS1:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>This is an operation implementation generated fault</faultstring>
<faultactor/>


Ok, less surpised now!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 28, 2009 5:33 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

IMHO you're doomed to string manupulation - the broker won't see that as a namespace:name; it's just data, like 12:17.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 28, 2009 5:36 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It sounds like the .NET client or it's generated client is doing the wrong thing.

In no way should it be trying to parse the contents of a faultcode as an XML element declaration with a namespace.

Are they actually asking you to produce
<SOAP-ENV:faultcode>SOAP-ENV:Server</SOAP-ENV:faultcode>?
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Apr 28, 2009 5:47 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The schema type of faultcode is 'xs:QName'. However, as Vitor says, this is just another tag value from XMLNSC's point of view. In the message tree, 'SOAP-ENV:Server' is just a CHARACTER value.

I think you have two choices:
a) Add a namespace declaration into OutputRoot.XMLNSC so that 'SOAP-ENV' is used throughout instead of 'NS1'.
See here for how to do this: http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ac67194_.htm
b) Write some ESQL to change 'SOAP-ENV' to 'NS1'.

a) is the most reliable solution, because b) relies on the broker's algorithm for assigning namespace prefixes.
Back to top
View user's profile Send private message
Broady
PostPosted: Wed Apr 29, 2009 12:54 am    Post subject: Reply with quote

Novice

Joined: 16 Apr 2004
Posts: 23
Location: Halifax, West Yorkshire, England

Thanks for that.

I elected to strip out the namespace prefix from the faultcode value before we reply to the .net client. I found that different services used different namespace prefixes so it was best and acceptable to just remove them.

It is odd that w3 and MB help suggest it will be namespaced and should be qualified...

...the specific name of a namespace prefix does not usually affect the meaning of a message, with one important exception. If the message content contains a qualified name, the message must contain a matching namespace prefix definition.
For example, if the output message is a SOAP Fault containing a <faultcode> element with the value soapenv:Server, a namespace prefix (which is case sensitive) for soapenv must be defined in the logical tree:
-- Build SOAP Fault message. Note that as well as defining the correct
-- namespace for the Fault element, it is also necessary to bind the
-- namespace prefix used in the faultcode element (this is set up under
-- SOAP.Context.Namespace)

DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';

SET OutputRoot.SOAP.Context.Namespace.(SOAP.NamespaceDecl)xmlns:soapenv =
'http://schemas.xmlsoap.org/soap/envelope/';
SET OutputRoot.SOAP.Body.soapenv:Fault.faultcode =
'soapenv:Server.AppError';
SET OutputRoot.SOAP.Body.soapenv:Fault.faultstring =
'Application generated SOAP Fault';
SET OutputRoot.SOAP.Body.soapenv:Fault.detail.Message =
'Application fault detail message';


anyway, it works. Thanks again.
_________________
Alan Broadbent
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 29, 2009 3:26 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

That help topic is talking about the SOAP domain. You are using the XMLNSC domain.

In any case, my advice was equivalent to the advice which you quoted; "make sure that your output document includes a namespace declaration for any namespace prefix which appears within the value of faultcode".
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » faultcode and the SOAP-ENV: data value
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.