<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>René Løhde (aka Rene Loehde) : OBA</title><link>http://blogs.msdn.com/renel/archive/tags/OBA/default.aspx</link><description>Tags: OBA</description><dc:language>da-DK</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>E-procurement demo from Helsinki Summit</title><link>http://blogs.msdn.com/renel/archive/2007/10/06/e-procurement-demo-from-helsinki-summit.aspx</link><pubDate>Sat, 06 Oct 2007 09:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5308523</guid><dc:creator>renel</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/renel/comments/5308523.aspx</comments><wfw:commentRss>http://blogs.msdn.com/renel/commentrss.aspx?PostID=5308523</wfw:commentRss><description>&lt;P&gt;Two days ago&amp;nbsp;I presented at Architect Summit in Helsinki. I had two sessions - one on identity management and one on e-procurement. The delivery of the e-procurement session was my first and before getting my slides together I made sure that there was at least one demo. &lt;/P&gt;
&lt;P&gt;I did a very simple OBA demo simulating the sending of an UBL 2.0 order to a LOB system - in my case this was done by exposing a local file folder through a sequential workflow service (with only one activity - recieveOrder) . I was authenticated with Cardspace and the UBL document was created in Word 2007. &lt;/P&gt;
&lt;P&gt;The meat and potatoes of the demo are the ability to capture any e-procurement vocabulary in Word 2007 or should I say OpenXML. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Simple structured data in OpenXML &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;To demo how this is done I took a small OpenXML document and showed how this could be used to make our own structures and semantics in a OpenXML document. &lt;/P&gt;
&lt;P&gt;I took this graphical representation (in the zip file below this is the "simpleGreeting.docx"): &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 366px; HEIGHT: 418px" height=418 src="http://farm3.static.flickr.com/2127/1494981930_c5641e20b7.jpg" width=366 mce_src="http://farm3.static.flickr.com/2127/1494981930_c5641e20b7.jpg"&gt;&lt;/P&gt;
&lt;P&gt;And explained how this appears to be a greeting from Beat – this is the semantics that we as humans will put into that picture. For a machine this is merely text. However under the covers and looking into the "main" xml document: &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 455px; HEIGHT: 384px" height=384 src="http://farm3.static.flickr.com/2208/1494129225_0d459daeca.jpg" width=455 mce_src="http://farm3.static.flickr.com/2208/1494129225_0d459daeca.jpg"&gt;&lt;/P&gt;
&lt;P&gt;It becomes visible that greeting is text, but the name contains some semantics that is mapped to at data structure. The data structured is: &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 381px; HEIGHT: 232px" height=232 src="http://farm3.static.flickr.com/2262/1494129319_ca64b0e543.jpg" width=381 mce_src="http://farm3.static.flickr.com/2262/1494129319_ca64b0e543.jpg"&gt;&lt;/P&gt;
&lt;P&gt;This example is the primer to give an idea of what is possible. This should eventually put the idea into the head of the attendee that it is possible to make another document with far more advanced structure and business capabilities. For instance this could be a purchase order. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Mapping complex data structure (like a PO) to content controls &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The next part of the demo showed a PO in Word 2007 with content controls that have bindings to a UBL 2.0 order elements: &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 435px; HEIGHT: 394px" height=394 src="http://farm3.static.flickr.com/2387/1494982262_6a70282ea2.jpg" width=435 mce_src="http://farm3.static.flickr.com/2387/1494982262_6a70282ea2.jpg"&gt;&lt;/P&gt;
&lt;P&gt;What I didn't show in the demo was how to map the complex structure of the PO to all the content controls in the Word 2007 interpretation of the OpenXML document. &lt;/P&gt;
&lt;P&gt;You don't want to do that manually – doing the xpath expressions yourself. You should use a tool like the one I have used – the&lt;A href="http://www.codeplex.com/dbe" mce_href="http://www.codeplex.com/dbe"&gt; Word Content Control toolkit&lt;/A&gt;. Excellent tool that will help make the right mapping. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The Demo solution &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;At the bottom of this post there is a link to the demo used in Finland. It is a zip file containing a Visual Studio 2008 beta 2 solution. In the solution there are three projects – a Workflow service, a console application to host the service and a Word 2007 document with a mapped UBL 2.0 order and with a new Ribbon control. &lt;/P&gt;
&lt;P&gt;Running the Word document and selecting the new e-procurement ribbon you get: &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 474px; HEIGHT: 319px" height=319 src="http://farm3.static.flickr.com/2137/1494982330_2527b67fa9.jpg" width=474 mce_src="http://farm3.static.flickr.com/2137/1494982330_2527b67fa9.jpg"&gt;&lt;/P&gt;
&lt;P&gt;When pressing the "Send UBL Order" – the WordML object cointaining all xml part will be xpath traversed (I am sure this should be rewritten to use Linq to xml) to navigate to the customxml part and selecting the UBL 2.0 purchase order. An instance of the UBL order is then sent to the service and stored. It is important to note that it is only the UBL 2.0 compliant Order and nothing else that is send to the service. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Notes and observations &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;There at are few things in the solution that are different from what was shown in the demo in Helsinki. &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;There is no Cardspace authentication turned on – If this should be reinforced the service host app.config file should have the right bindings should be set again (uncomment in the app.config) and a X.509 cert should be installed under the local machine. &lt;/LI&gt;
&lt;LI&gt;This also means the there is a simple basicHttpBinding running at the service host – so absolutely no security here. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;One interesting this to notice is that at the service operation the parameter taken as input is a System.Xml.XmlDocument – but at the .Net 3.5 beta 2 client doc/lit proxy generation this translates into a System.Xml.Linq.XDocument . &lt;/P&gt;
&lt;P&gt;This makes sense when looking at the types description of the WSDL: &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 343px; HEIGHT: 319px" height=319 src="http://farm3.static.flickr.com/2235/1494129639_e3333ea6a3.jpg" width=343 mce_src="http://farm3.static.flickr.com/2235/1494129639_e3333ea6a3.jpg"&gt;&lt;/P&gt;
&lt;P&gt;It is basically a "anything goes" input. If there should be more informative metadata it would be beneficial for clients accessing the service to know what xml document really are the ones the service wants to accept (the UBL 2.0 order). &lt;/P&gt;
&lt;P&gt;To achieve this there are a number of possible options and suggestions. However I am not going to go into that now. But for the more ambitious people who want to dig a little deeper the zip file below also contains the xsd.exe generated code of the UBL 2.0 order (Order.cs). It is possible to add this file to the service project and use the "orderType" object as input to the service operation recieveOrder.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5308523" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/renel/attachment/5308523.ashx" length="132538" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/renel/archive/tags/Event/default.aspx">Event</category><category domain="http://blogs.msdn.com/renel/archive/tags/OpenXML/default.aspx">OpenXML</category><category domain="http://blogs.msdn.com/renel/archive/tags/OBA/default.aspx">OBA</category><category domain="http://blogs.msdn.com/renel/archive/tags/UBL/default.aspx">UBL</category></item></channel></rss>