Microsoft Word came with a handy feature to compare 2 Word documents. But I’ve got to know this very recently.
Background
When I’m getting multiple revisions of the same MS-Word document, how can I make sure that I have seen the changes effectively?
Microsoft Word came with a handy feature to compare 2 Word documents. But I’ve got to know this very recently.
When I’m getting multiple revisions of the same MS-Word document, how can I make sure that I have seen the changes effectively?
In the MEC mapper, calling a web service is a general scenario. There are few ways to do it. One method is build the SOAP request Payload in a string and submit via POST method. (as below code snippet)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
java.net.URL obj = new java.net.URL(iURL); java.net.HttpURLConnection con = (java.net.HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); con.setRequestProperty ("Content-Type","text/xml"); con.setRequestProperty ("Accept","text/xml"); String itemStr = "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + "<GetItem xmlns=\"http://tempuri.org/\">" + "<itemNumber>KelumG</itemNumber>" + "</GetItem>" + "</soap:Body></soap:Envelope>"; con.setDoOutput(true); java.io.DataOutputStream wr = new java.io.DataOutputStream(con.getOutputStream()); wr.writeBytes(itemStr); wr.flush(); wr.close(); |
This is very primitive and takes lot of times of developer. Also it hinders the code readability & maintainability.
From this post I’m going to tell you a cleaner way, rather simple way. We, programmers, know easy way to call web service is using Proxy objects/classes.
Proxy objects are type of representations of the web service for the programming language we are using.
wsimport -d KG http://localhost:4599/HelloService.asmx?wsdl command to create proxy classes. 1 2 3 4 5 6 |
private void callWebSvc() throws Throwable { // Please implement me org.tempuri.HelloService hs = new org.tempuri.HelloService(new java.net.URL(iUrl)); org.tempuri.HelloServiceSoap hsoap= hs.getHelloServiceSoap(); oItem = hsoap.getItem(iItem); } |
For this post I have created a mock web service (.asmx ) using C# and hosted in IIS. Sample code as below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
namespace WebServiceApp { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] public class HelloService : System.Web.Services.WebService { [WebMethod] public string GetItem(string itemNumber) { return new ItemService().GetItem(itemNumber); } } public class ItemService { public string GetItem(string itno) { return string.Format("Item {0}",itno); } } |
Manipulating the out file name generated by the middle ware is a common scenario. By default file names are generated with a GUID (13a7a838-a706-4273-b190-9d58a79bf04e). It is more practical if the file name is human readable.
1 2 3 4 5 6 |
String date = new java.text.SimpleDateFormat("yyMMdd").format(new java.util.GregorianCalendar().getTime()); String time = new java.text.SimpleDateFormat("HHmmss").format(new java.util.GregorianCalendar().getTime()); String fileName = "EDI_832_OUT_"+ date+time; setManifestInfo("map:FileName", fileName); |
Presently I’m working with a MEC older version (Ver 9.1).
This version is not part of an Eclipse plugin. It’s a standalone application that use for MEC mapper development. Very tedious to work with.
MEC Mapper different than the Eclipse version. But Flat file definition tool, it’s manager & the partner agreement tool looks the same.
Mapping manger looks like this.
Mapper looks like this.
Like any other middle-ware application MEC has unique architectural components. Below diagram depicts them.
<ItemInfo>
<RequestHeader>
<environment>A</environment>
<program>B</program>
<company>A</company>
</RequestHeader>
<RequestBody>
<!-- Items goes here-->
</RequestBody>
</ItemInfo>
![]() |
| MEC Mapper |
When you sending/creating EDI messages it is necessary to include unique message interchange number. This is to ensure each message that we ...