Biztalk Map
Hi, I'm new to BizTalk. I literally have a single record in the source schema.
<?xml version="1.0" encoding="utf-8"?>
<LogEntryResponse xmlns="...">
<LogEntryResult>
<TxId>string1</TxId>
<ServiceName>string2</ServiceName>
<Identifier>string3</Identifier>
<Amount>string4</Amount>
<Status>string5</Status>
<Detail>string6</Detail>
</LogEntryResult>
</LogEntryResponse>
I would like use each of the elements to make an individual record in the target schema like so:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:processRequestResponse>
<return>
<name>string1</name>
<value>string1</value>
</return>
<return>
<name>string2</name>
<value>string2</value>
</return>
<return>
<name>string3</name>
<value>string3</value>
</return>
</ns1:processRequestResponse>
</ns0:Envelope>
I have tried a number of things but it is clear I am doing something wrong. I hope someone can point me in the right direction.
It should be very simple.
All you have to do is link TxId, ServiceName, Identifier, etc. all to a Looping Functoid. Then link from the Looping Functoid to Return.
Then you can link each individual field to Value and use a String Concatenate to set each of the Name fields.
Related
I'm using Avalonedit in my wcf application. I have to implement code completion feature(intellisense).
My Requirement
I have an xml file with the following content.This xml data will be updated often.
<?xml version="1.0" encoding="UTF-8"?>
<RelativeRegion>
<Display_Window>
<GreenButton>10,10,30,85</GreenButton>
</Display_Window>
<Insert_Window>
<BlueButton>10,10,30,85</BlueButton>
<YellowButton>10,10,30,85</YellowButton>
</Insert_Window>
<Search_Window>
<RedButton>10,10,30,85</RedButton>
<YellowButton>10,10,30,85</YellowButton>
</Search_Window>
</RelativeRegion>
I want to insert intellisense for this data to my avalon editor like
RelativeRegion.Display_Window.GreenButton
Is it possible to directly bind the xml data to avalonedit intellisense?
Is there any way to implement this nested code completion?
What I have done so far
I googled a lot about avalonedit nested code completion and i didn't get anything about the nested thing. Finally I start with the available code from AvalonEdit Code Completion Documentation. But I think this will work only for single level and not suiting for my requirement. May be I am unaware of its the capabilities as a first time user of avalonedit.
Anyone tried the nested code completion. Is there any way to achieve this.
I can change the data format from xml to JSON or any other format if required.
I'm developing a REST API that uses Spring MVC. The objects I consume and produce are generated (using JAXB) from NCPDP (http://www.ncpdp.org/) XSDs. I have everything working when requests come in, but I'd like to add additional attributes to the root element on outgoing requests.
Right now, my outgoing response looks as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<transport:Message xmlns:transport="http://www.ncpdp.org/schema/transport">
<transport:Header>
...
</transport:Header>
<transport:Body>
<transport:Status>
<transport:Code>010</transport:Code>
<transport:Description>OK</transport:Description>
</transport:Status>
</transport:Body>
</transport:Message>
And it should look as follows:
<?xml version="1.0"?>
<transport:Message xmlns:transport="http://www.ncpdp.org/schema/transport" xmlns:datatypes="http://www.ncpdp.org/schema/datatypes"
xmlns:script="http://www.ncpdp.org/schema/script" xmlns:structures="http://www.ncpdp.org/schema/structures"
xmlns:pa-structures="http://www.ncpdp.org/schema/pa-structures" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
StructuresVersion="v2014041" ECLVersion="v2014041" DatatypesVersion="v2014041" PA-StructuresVersion="v2014041"
TransactionVersion="v2014041" TransportVersion="v2014041" TransactionDomain="SCRIPT">
<transport:Header>
...
</transport:Header>
<transport:Body>
<transport:Status>
<transport:Code>010</transport:Code>
</transport:Status>
</transport:Body>
</transport:Message>
I don't believe I need all the namespaces defined (since they're not used), but I do need the StructuresVersion and all other attributes. Is there a way to modify my bindings.xjb to include these attributes? Or do I have to copy the generated code into my source tree and add annotations to do this?
Thanks,
Matt
Since these attribute are declared in your XML schema, you should be getting appropriate properties in your schema-derived code.
It actually does not matter if this is a root element or some child element. Please re-check the generated code, look for something like getStructuresVersion(). So you don't need to do anything.
As for the namespaces, you will get them automatically declared, when you marshal. But you may first get them declared as ns0, ns1 etc. which is not very nice in terms of readability. Please see the following question:
Controlling namespace prefixes in JAXB
(the question itself, not the answers) for information on how to control these prefixes with a custom prefix mapper or this post by Blaise Doughan.
I am trying to start with the framework, but it appears to be
dramatically hard for some reason. I want to follow complete example
posted here
http://swizframework.jira.com/wiki/display/SWIZ/Quick+Start
But I have issue on the very beginning. E.g.
<swiz:beanProviders>
<config:Beans />
</swiz:beanProviders>
The line causes the error:
The prefix "config" for element "config:Bean" is not bound.
SwizTest.mxml /SwizTest/src line 10 Flex Problem
I think you're probably just missing the namespace declaration for the config: part of config:Beans. Flex basically doesn't know what package or folder config prefix is pointing to unless you have that.
If you look at the application node at the top of the example I think you'll see what's missing:
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:view="org.swizframework.quickswiz.view.*"
xmlns:config="org.swizframework.quickswiz.config.*"
xmlns:swiz="http://swiz.swizframework.org">
Hope that does the trick.
I want to show some data from an xml file inside a datagrid, so I do this:
<mx:AdvancedDataGrid id="dgDomains" dataProvider="{new XMLListCollection(xmlDomains..domain(deleted.toString() != '1'))}"
...
and the xml data looks like this:
<domains>
<domain>
<domainName>AGRICULTURE</domainName>
<deleted>1</deleted>
</domain>
<domain>
<domainName>IT</domainName>
<deleted/>
</domain>
</domains>
The filter fails if the "deleted" node isn't there. I get this error: Variable deleted is not defined.
Can someone help me improve the filter so that it will work in this case, too?
Thank you!
Its fails with error because filter can't apply's on null/undefined variables in your case delete,
you may uses XML's elements function it will take care of null/undefined value
xmlDomain..domain.(elements('deleted') != '1')
above statement also return's all nodes in which delete is not defined
Hopes that helps
I'm getting some Xml back from a service. I would like it to be the datasource of a grid view on my aspx page. Here is a sample of the Xml
<?xml version="1.0" encoding="utf-16" ?>
<ArrayOfTripTollCompleteDC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<TripTollCompleteDC>
<TripTollId>5</TripTollId>
<DMSLaneModeID xsi:nil="true" />
<HOVOnly>false</HOVOnly>
<CreateDateTime>2010-06-07T15:54:01.023</CreateDateTime>
<ConfigVTMSDelaySeconds>5</ConfigVTMSDelaySeconds>
</TripTollCompleteDC>
and here is my code that parses the xml and tries to bind the grid. What am I missing here?
var retVal = service.GetTripDetailsByTripID(tripId);
var xmlTrips = XDocument.Parse(retVal);
var tripTolls =
from t in xmlTrips.Elements("TripTollCompleteDC")
select new {
TripTollId = (int)t.Element("TripTollId")
, DMSLaneModeID = (int?)t.Element("DMSLaneModeID")
, HOVOnly = (bool)t.Element("HOVOnly")
, CreateDateTime = (DateTime)t.Element("CreateDateTime")
, ConfigVTMSDelaySeconds = (int)t.Element("ConfigVTMSDelaySeconds")
};
grdTripDetails.DataSource = tripTolls;
grdTripDetails.DataBind();
I realize these are anonymous types. Is that a problem? I have verified the service is returning the Xml as stated above. Can anyone out there point me in the right direction? Thanks so much for any tips.
Just for completeness, here is the grid markup
<asp:GridView runat="server" ID="grdTripDetails" />
Cheers,
~ck in San Diego
Try this:
from t in xmlTrips.Root.Elements("TripTollCompleteDC")
Note the addition of Root in there. There's only one top-level element, and it's not a TripTollCompleteDC.
You may also need to autogenerate the columns - I don't know about grid views. That raises a useful point about debugging this sort of thing. There are two potential problems here:
Parsing and transforming the XML
Generating the grid view
You can test the first point via logging - log the transformed values in whatever way you normally do logging. Heck, you could even just use a separate console app for testing. (That's what I've just done.)
You can test the second point by hard-coding some data and reloading the page - does it show up how you expect it to? If not, tweak the code until it does what you want.
Separating these two concerns makes it much easier to work out the problem.