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 » Mapping the response back to request

Post new topic  Reply to topic
 Mapping the response back to request « View previous topic :: View next topic » 
Author Message
devamar28
PostPosted: Fri Jan 06, 2017 10:33 am    Post subject: Mapping the response back to request Reply with quote

Novice

Joined: 04 Jan 2017
Posts: 10

I have the below scenario

I'm sending a JSON Request with 50 records each time and each record has a unique id: below is sample request

The Request and Response are sequential and I'm using POST service to send the JSON Request using WMB.

Request

Code:
{
            "objects": [
                        {
                        "AccountNumber": "A00000024",
                        "UOM": "TRANS-OB_PO_BASE",
                        "Quantity": 15,
                        "StartDateTime": "2016-10-20T05:41:36.000+02:00",
                        "EndDateTime": "2016-20-20T05:41:36.000+02:00",
                        "WarehouseID__c": "WarehouseId12345",
                        "UniqueID__c" : "UniqueId123456"
                        },
                        {
                        "AccountNumber": "A000023424",
                        "UOM": "TRANS-OB_PO_BASE",
                        "Quantity": 15,
                        "StartDateTime": "2016-10-20T05:41:36.000+02:00",
                        "EndDateTime": "2016-20-20T05:41:36.000+02:00",
                        "WarehouseID__c": "WarehouseId12345",
                        "UniqueID__c" : "UniqueId123456"
                        }
            ],
            "type": "Usage"
}



For each request I get a response back and below is the sample response

Response:


Code:
[
 
  {
    "Success": true,
    "Id": "UniqueId123456"
  },
  {
    "Errors": [
      {
        "Code": "INVALID_VALUE",
        "Message": "The AccountID is invalid."
      }
    ],
    "Success": false
  }
]



I have to upload the status whether it was a success or failure for each record based on the response. Success record will bring me back the Unique ID which was given but failure record doesn't include the unique ID in the response. Can any one please help me with the logic on how to map the response back to request in order to find which record (Unique ID) failed?
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jan 06, 2017 11:13 am    Post subject: Re: Mapping the response back to request Reply with quote

Grand High Poobah

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

devamar28 wrote:
Can any one please help me with the logic on how to map the response back to request in order to find which record (Unique ID) failed?


Seriously?

I charge for writing code and you're (presumably) paid to. This isn't difficult.

If the problem is that the response is not in the same order as the request, that's a problem for whoever's sending the request.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
devamar28
PostPosted: Fri Jan 06, 2017 11:42 am    Post subject: Reply with quote

Novice

Joined: 04 Jan 2017
Posts: 10

I'm learning WMB from scratch and planning to become a WMB developer, I'm bombarding myself with all the tasks one could find, the other day it was SwA and today this. I will be getting better if not today some day until then I will be practicing!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jan 06, 2017 11:44 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Don't think of it as a WMB problem.

Think of it as a general coding problem.

Solve it that way, then turn it into WMB code.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jan 06, 2017 11:50 am    Post subject: Reply with quote

Grand High Poobah

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

devamar28 wrote:
I will be getting better if not today some day until then I will be practicing!


I'm sure.

But we're not a training resource. We're a very bad way of getting training.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jan 06, 2017 11:50 am    Post subject: Reply with quote

Grand High Poobah

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

mqjeff wrote:
Don't think of it as a WMB problem.

Think of it as a general coding problem.

Solve it that way, then turn it into WMB code.



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
devamar28
PostPosted: Fri Jan 06, 2017 2:22 pm    Post subject: Reply with quote

Novice

Joined: 04 Jan 2017
Posts: 10

mqjeff wrote:
Don't think of it as a WMB problem.

Think of it as a general coding problem.

Solve it that way, then turn it into WMB code.


Thank you!
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 » Mapping the response back to request
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.