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 » SOAPRequest: 'Wrong type in both mapped and source token'

Post new topic  Reply to topic
 SOAPRequest: 'Wrong type in both mapped and source token' « View previous topic :: View next topic » 
Author Message
lancelotlinc
PostPosted: Wed Apr 25, 2012 5:57 am    Post subject: SOAPRequest: 'Wrong type in both mapped and source token' Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

WMB Runtime 7.0.0.3 Ifix 2 AIX


Main flow -> Subflow A -> Subflow B

Subflow A purpose is to make a call to a Web Service that needs Basic Auth credentialing. If I hard code the uid pwd in an ESQL Compute node, the Basic Auth works.

We have a common subflow "B" that is used by many other flows. The other flows need uid pwd in SOAP.Header.UserToken so Basic Auth is not used in the other flows. Subflow B works well in the other flows. The purpose of the common subflow B is to query an internal web service to lookup uid and pwd for the SOAPRequest in subflow A. By setting subflow A's SOAP Request node .securityProfileName = Default_Propagation, it is somehow interfering with Subflow B's call to the pwd lookup web service.


Quote:
(0x01000000:Name):RecoverableException = (
(0x03000000:NameValue):File = '/build/S700_P/src/DataFlowEngine/TemplateNodes/ImbRequestTemplateNode.cpp' (CHARACTER)
(0x03000000:NameValue):Line = 531 (INTEGER)
(0x03000000:NameValue):Function = 'ImbRequestTemplateNode::processMessageAssemblyToFailure' (CHARACTER)
(0x03000000:NameValue):Type = 'ImbRequestTemplateNode' (CHARACTER)
(0x03000000:NameValue):Name = 'com/somecompanyl/middleware/flows/someproject/FNA_e#FCMCompositCHARACTER)
(0x03000000:NameValue):Label = Request' (CHARACTER)
(0x03000000:NameValue):Catalog = 'BIPmsgs' (CHARACTER)
(0x03000000:NameValue):Severity = 3 (INTEGER)
(0x03000000:NameValue):Number = 2230 (INTEGER)
(0x03000000:NameValue):Text = 'Caught exception and rethrowing' (CHARACTER)
(0x01000000:Name ):RecoverableException = (
(0x03000000:NameValue):File = '/build/S700_P/src/WebServices/WSLibrary/ImbSOAPRequestNode.cpp' (CHARACTER)
(0x03000000:NameValue):Line = 810 (INTEGER)
(0x03000000:NameValue):Function = 'ImbSOAPRequestNode::requestData' (CHARACTER)
(0x03000000:NameValue):Type = 'ImbRequestTemplateNode' (CHARACTER)
(0x03000000:NameValue):Name = 'Composite_1_1' (CHARACTER)
(0x03000000:NameValue):Label = 'Request' (CHARACTER)
(0x03000000:NameValue):Catalog = 'BIPmsgs' (CHARACTER)
(0x03000000:NameValue):Severity = 3 (INTEGER)
(0x03000000:NameValue):Number = 3754 (INTEGER)
(0x03000000:NameValue):Text = 'Error occurred in ImbSOAPRequestHelper::makeSOAPRequest()' (CHARACTER)
(0x01000000:Name ):RecoverableException = (
(0x03000000:NameValue):File = '/build/S700_P/src/DataFlowEngine/MessageServices/ImbSecurityManager.cpp' (CHARACTER)
(0x03000000:NameValue):Line = 1287 (INTEGER)
(0x03000000:NameValue):Function = 'ImbSecurityManager::retrieveIdentityToPropagate' (CHARACTER)
(0x03000000:NameValue):Type = '' (CHARACTER)
(0x03000000:NameValue):Name = '' (CHARACTER)
(0x03000000:NameValue):Label = '' (CHARACTER)
(0x03000000:NameValue):Catalog = 'BIPmsgs' (CHARACTER)
(0x03000000:NameValue):Severity = 3 (INTEGER)
(0x03000000:NameValue):Number = 2720 (INTEGER)
(0x03000000:NameValue):Text = 'Wrong type in both mapped and source token' (CHARACTER)
(0x01000000:Name ):Insert = (
(0x03000000:NameValue):Type = 5 (INTEGER)
(0x03000000:NameValue):Text = 'username, usernameAndPassword' (CHARACTER)
)
(0x01000000:Name ):Insert = (
(0x03000000:NameValue):Type = 5 (INTEGER)
(0x03000000:NameValue):Text = '' (CHARACTER)
)
)
)
)



mgk: is it possible that setting the subflow A's SOAP Request node .securityProfileName = Default_Propagation is being picked up by subflow B's SOAPRequest node ?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Esa
PostPosted: Wed Apr 25, 2012 6:04 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

I'm sorry if I'm not mgk, but it seems that you are letting LocalEnvironment to propagate between the subflows. If subflow 2 has a compute node before SOAPRequest, you should change it's compute mode to one that includes LocalEnvironment and make the required changes in the ESQL code.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Apr 25, 2012 6:11 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Thanks for your reply Esa. That would be a good suggestion. Only problem, there is nothing in the LocalEnvironment (looking at it from a Trace node output):

Quote:
===
LocalEnvironment:

===


Is it possible I can set .securityProfileName from an ESQL Compute node? Then I can leave the .securityProfileName blank and set it just before the SOAPRequest node that needs Basic Auth. That way, both calls will work.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
optimist
PostPosted: Wed Apr 25, 2012 7:55 am    Post subject: Reply with quote

Apprentice

Joined: 18 Nov 2010
Posts: 33

Assume you are doing this inside ESQL in Subflow A.

SET OutputRoot.Properties.IdentitySourceType='usernameAndPassword';
SET OutputRoot.Properties.IdentitySourceToken = 'abc';
SET OutputRoot.Properties.IdentitySourcePassword = 'xyz';

I was able to set Default Propagation on a SoapRequest node and pick up the settings from the compute node in one of our projects.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Apr 25, 2012 8:40 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Hi optimist, thanks for responding.

No doubt it works as you described. It works for me too. I've done some moving around, and here is what I found out.

If two SOAPRequest nodes are in the same Message Flow and you want the first SOAPRequest node to make a Web Service call _not_ using Basic Auth, but you want the second SOAPRequest node to make a Web Service call _using_ Basic Auth, setting the .securityProfileName on the second node also forces the first node to use Basic Auth, which causes a failure during the first Web Service call (since the first Web Service call is not expecting credentials).

So, I guess I am going to open a PMR on it. The business requirement is to make two SOAP requests from the same flow, the first not using any auth profile, and the second using the Basic Auth Default Propagation profile. The malfunction in my current WMB version is that setting the .securityProfileName on the second node incorrectly forces the first node to use that same profile.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
optimist
PostPosted: Wed Apr 25, 2012 9:08 am    Post subject: Reply with quote

Apprentice

Joined: 18 Nov 2010
Posts: 33

Thanks lancelotlinc.

That's the problem I thought you are running into (and you explained very well on your original post), but wanted to make sure.

Pl. keep us posted on the outcome of the PMR.

Thank you.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Apr 25, 2012 9:49 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Code:
 
Steps to reproduce the error:
 
1. Create a message flow.
2. In this message flow, put an MQInput node, a flow order node, two compute nodes(EC-1, EC-2), and two SOAPRequest nodes (SR-A, SR-B).
3. Select a message set with imported WSDL for SR-A which calls a Web Service with no authentication.
4. Select a message set with imported WSDL for SR-B which calls a Web Service that requires Basic Auth.
5. In EC-2, SET OutputRoot.Properties.IdentitySourceType = 'usernameAndPassword';
6. In EC-2, SET OutputRoot.Properties.IdentitySourceToken = 'someuserid';
7. In EC-2, SET OutputRoot.Properties.IdentitySourcePassword = 'somepassword';
8. Override the bar file to set the SR-B .securityProfileName to "Default_Propagation".
9. Drop a message in the queue attached to MQInput.
10. Observe  'Wrong type in both mapped and source token' error.
 
 
Steps for manual workaround.
 
1. Create a message flow.
2. In this message flow, put an MQInput node, one compute nodes(EC-3), and one SOAPRequest nodes (SR-C).
3. Select a message set with imported WSDL for SR-C which calls a Web Service that requires Basic Auth.
4. In EC-3, SET OutputRoot.Properties.IdentitySourceType = 'usernameAndPassword';
5. In EC-3, SET OutputRoot.Properties.IdentitySourceToken = 'someuserid';
6. In EC-3, SET OutputRoot.Properties.IdentitySourcePassword = 'somepassword';
7. Override the bar file to set the SR-C .securityProfileName to "Default_Propagation".
8. Drop a message in the queue attached to MQInput.
9. Observe correct and successful operation of Web Service call from SR-C.
 
 

_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Fri Apr 27, 2012 12:48 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Status update: PMR is in progress, but I did construct a pretty neat work around until a patch can be applied to the runtime.

The original design main message flow starts with an MQInput. I changed it by adding two message flows, each message flow listening to the same queue with an MQInput node. When the message is first put in the queue by the original sender, I set the CorrelId to 0x000000000000000000000001. The first message flow reads the queue for only messages that have this Correld and looks up the password with no credential auth. Once the password is retrieved using the common pwd svcs subflow, I put the message including the uid/pwd back into the same input queue, but this time I set the CorrelId to 0x000000000000000000000002. The real main message flow only gets messages with this new CorrelId. So it processes the transaction happily having the uid/pwd and the Basic Auth.

A great workaround since it needs no new queues, and once the patch is applied to the runtime, can go back to having only one message flow.

Thanks for all who replied. Happy weekend.


_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
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 » SOAPRequest: 'Wrong type in both mapped and source token'
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.