现在的位置: 首页 > 综合 > 正文

早上跟Michael的对话

2019年01月15日 ⁄ 综合 ⁄ 共 3144字 ⁄ 字号 评论关闭
danny: Good evening,Michael.I am sorry that I can't find a better solution of that.And what should I do something about this now?
reallymp: Hi Danny
reallymp: I am not surprised - I could not find a solution either.  Were you able to gain some familiarity with C#?
danny: I know C# syntax.but don't know other things.
reallymp: Great, you will find it very similar to Java, we will learn as we go.    OK, we are going to go with an alternative plan, using a servlet to communicate between C#/.NET and Java.   I have already started this implementation but I need you to finish it before we can being to write the C# client.
danny: I have learn C# before about one month.It just like java.
reallymp: Please make sure you have latest code, and take a look at the file RSuiteXML.java in the base directory under src
reallymp: The C# code will call into the API by using this servlet, which constructs RSIAPI dynamically and calls the sub functions
danny: ok,I will look at this.
reallymp: I have written some Ajax code to test this and it works great
reallymp: Please also look again at RSIAPI.java (the server version, not the client)
reallymp: you will notice that I created a "wrapper" for every function
danny: what is the wrapper?
reallymp: We need the C# to receive XML as a String through the servlet so it will not be able to handle complex data types.  The wrapper functions call the RSIAPI internal functions, retrieve the return value and convert it to XML as a String before returning
reallymp: they are named the same as the internal function only they have the "XML" on the end
reallymp: so for example, the API function CreateAssemblyNode has a wrapper called CreateAssemblyNodeXML
reallymp: it is the same argument list, only instead of returning a boolean, it returns a String (which has an XML representation)
danny: But maybe C# string is different of Java's string?
reallymp: It will return as XML directly from the servlet actually, so C# can use a style sheet or the XmlElement object to read it directly
reallymp: (the downside to this is we need to create an HttpConnection class on the C# side to facilitate the API call, but more about that later)
reallymp: I created a wrapper for every API function and a way to call the internal function, take the return value, turn to XML and return and it is great.  But what still needs to be done is fixing the input arguments.
danny: ok,I think I will know all of this as my best.
reallymp: Because the servlet mechanism is using a HTTP GET to receive the API call, only input arguments that are Strings can be used
danny: And some more?
reallymp: yes everything before is already done, but what I need you to do (after you become familiar with the code) is to update any wrapper function which currently has an argumen other than String
danny: Would I need to write some codes about AJAX?
reallymp: We will move the C# task you were originally assigned to May, this will be your last task for the month.
reallymp: No - you need to first update the API wrappers so that all of them can receive the calls from either AJAX or C#
reallymp: right now only about 50% of them work
reallymp: the rest need to be fixed - any wrapper API function which currently has a non-String input argument must use a String instead and covert to the real datatype in the wrapper function.
danny: ok,I will start this after today.
danny: Thanks your help.
reallymp: OK I will send you more specific details in an e-mail today.
reallymp: In the meantime, please familiarize yourself with RSuiteXML.java and the wrapper functions in RSIAPI.java and learn how they work
reallymp: also, I think Lu has some bug fixes he would like you to assist with in RSIAPI today
danny: ok,I will look at the email and help Lu to finish some work.
reallymp: OK great, let's talk again tomorrow morning

抱歉!评论已关闭.