How to get JSON item in web service workflow?

10-11  Source: Network gathering  Views:7 

Advertisement
Im tried to get json item in workflow,But was unable to obtain "RtnCode",how to do it?
This my JSON,
"MerchantID": "1032017",
"RtnCode": "2",
"RtnMsg": "Get Succeeded",
My workflow :
Get RtnCodefrom
Variable: DealItems
Error code:
RequestorId: f85b0795-6682-fde7-0000-000000000000.
Details: An unhandled exception occurred during the execution of the workflow instance.
Exception details: System.InvalidOperationException: Looking up a value using a key is not supported on an instance of 'Microsoft.Activities.Dynamic.DynamicPrimitive'. at Microsoft.Activities.Dynamic.DynamicItem.TryGetValue(String key, DynamicItem&
value) at Microsoft.Activities.Dynamic.DynamicValueBuilder.PathSegmentFactory.ObjectPathSegment.Get(DynamicItem obj) at Microsoft.Activities.GetDynamicValueProperty`1.Execute(CodeActivityContext context) at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance
instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) Exception from activity
GetDynamicValueProperty<String> Start Sequence Flowchart Sequence Pay.WorkflowXaml_07f732da_c82a_4234_abd5_34c32c637413
Hi Felaray,
I have a similar issue and what I tried to do is to install JSON.NET in my project and used the "Assign" activity (under "Primitives" category on the toolbox) to assign the string to an object:
Newtonsoft
.Json.JsonConvert.DeserializeObject(resultFromCustomActivity)
but unfortunately did not work. I am getting this exception:
Visual Studio 2013 Workflow: Failed to translate expression because of the following error: Translating the method or one of its overloads to an activity is not supported
If you cannot really change the source header, you might need to create a code custom activity and pass in your string and use JSON.NET, parse it and return what you want.
Another "easier" option might involve doing some nasty parsing (using the Assign Activity) by finding the index of your "RntCode:" and getting the next set of characters before the comma. Since the .NET classes to utilize are limited
it would be worth trying to use a RegEx
resultFromCustomActivity
.Substring(0,
10)
Related articles
  • How to get JSON item in web service workflow? 10-11

    Im tried to get json item in workflow,But was unable to obtain "RtnCode",how to do it? This my JSON, "MerchantID": "1032017", "RtnCode": "2", "RtnMsg": "Get Succeeded", My workflow : Ge

  • How to get original message in web service implementation and proxy 10-11

    Hi, We have a java web service and its client (proxy) generated from WSDL by JDev wizards. All the parameters are mapped to classes, but we need a way to get the original message we send and receive in order to log it. Is there any way to get the SOA

  • How to get a doc//literal web service with JWSDP1.3 11-30

    I can build a rpc/encoded service (based the tutorial), but I need a doc/literal. Because I have a J2ME client. How can I do it? thanksDo you want to see if Arun's white paper helps you? I checked and he talkks about this at the end of his first scen

  • How to install and consume GroupWise Web Service (SOAP) 10-11

    Hello! I'm Razvan, programmer from Romnia, and I am new to GroupWise development. I am asking if anyone could help me with a C# Visual Studio 2010 example of how to install and consume GroupWise Web Service (SOAP). The documentation from novell site

  • How to connect to database in web service?? 11-30

    Hi all, How to connect to database in web service ? Can anyone give some advice what kind of database should i use? thanksNo difference. Just connect as usual! Let me give you an example: Code to connect to postgresql db ... public Connection connect

  • How to reject Line Items in a Service Contract? 10-11

    Hello friends, Can anyone help me understand how do we reject items in a Service Contract? I don't see any Reject field. Is it one of the Status I need to configure for Item Level Status Profile? Even if I add a 'Reject' status, how do I link it to R

  • How can I call a SAPME web service from MII such as PlaceFutureHold? 10-11

    Dears, How can I call a SAPME web service from MII such as PlaceFutureHold? By using MII, I would like to develop some logic to check some values which query from SAPME database, if the value is out of spec, it needs to send a emal to inform user ans

  • How to get the version no. for service po? 10-11

    Hi, How to get the version no. for service po?For material po we are getting the version from EKKO-REVNO but for service po Ekko-revno is blank. Regards, Rachel.Hiee, It is not like service PO does not have revision. REVNO will only exists for any do

  • How to get Contract Account Number in Service Ticket 10-11

    Hi Experts, How to get Contract account number in Service Ticket, we are working in ISU environment. when i create the service ticket the contract account number is there in Business agreement number field in service tiket. Can anyone tell me how to

  • Help me!    How to use it as a web service from third party application? 10-11

    After using JDeveloper to develop BSSV object e.g. JP550010, how to use it as a web service from third party application? TKS!Obviously the OP is working on a project for the Bead Society of Southeastern Virginia http://www.bssv.org. Oh, wait, maybe

  • How to get line item net price and net value? 11-30

    I have using "BAPI_SALESORDER_SIMULATE" to SIMULATE to create SO, the return table ORDER_ITEMS_OUT-NET_VALUE is not equals than created by VA01 . how to get line item net price and net value?Hi, Can u elaborate ur query ? By this FM you cannot c

  • How to get List Item attachments name without write any custom code or any database query? 11-30

    Hi, How to get List Items attachments name without write any custom code or any database query?You can get it from Rest, There are 2 options, 1) create a 'Result Source' which has a search query for that List which has attachments   - Use rest query

  • How to get page item list in  a page? 11-30

    how to get page item list in  a page?Have a look at ISpread::GetItemsOnPage(). That should get you started.Read other 2 answers

  • How to consume sap xi pi web services or sap RFC with oracle 11g forms. 11-30

    Dear All how to consume sap xi pi web services or sap RFC with oracle 11g forms. or how to config 11g forms with sap xi.... or how to call sap xi web services in 11g forms.... or can send sample code.... Regards smfatmi Edited by: smfatmi on Oct 17,

  • How to deploy and debug java web service in eclipes or using any other soft 11-30

    Hai, can any one tell me how to deploy and debug java web service in eclipes or using any other software. i have used tomcat web server and jdk1.4.0 to develop web service. we have used web service to interact with MS outlook . bye sudhakar.mHi Sudha

  • Set listbox items from web service response 11-30

    Hi All I am trying to set list box items from a web service response. Couple of issues over here: 1. The user should be able to select multiple items from the list. Hence if I set "Allow multiple values" and set Commit on "exit", then

  • How to access (any) soap / rest web services from widget 11-30

    Hi all, Is there an API, javascript library etc, which allows accessing (any) soap / rest webservices from widgets? I know I can access web services from sap j2ee with widget foundation, but I'm still not sure how to access "outside" web service

  • How to enable SOAP compression in web services 10-11

    Hi, I have created a web services by exposing an EJB using annotations. Trouble now is that the output is an array of Objects which grew to a significant size to cause latency issue. I have saw folks using filters to compress the HTTP response but is

  • How to retrieve data from a web service 10-11

    Hi i am at very beginner level about web services. I am searching for a simple example of retrieving data from a web services, but cant find. How can i get xml data from a web service. i dont need to develop the web service it is already ready, i jus

  • How to call a secure external Web Service using Oracle BPEL and OWSM 10-11

    Hi, i have to invoke an external secure Web Service using SOA Suite 10.1.3.1, but i don´t know how to do this. Do i use OWSM gateway or Agent? how to configure the gateway or agent to pass the required security to the external secure web service. tha