|
Hello mav,
Thanks a lot for you time!
I will test the Method as soon as I'm back in office and let you know if it helped me!
But from what I could found out of the documentation[^], it looks very promising!
So thank you very much!
Got my '5'!
All the best,
Martin
|
|
|
|
|
|
Hello all,
I am just starting a project that requires me to create a base application/service to act as a proxy between clients and webservices.
Nice and simple, if I have all the relevant WSDL files at compile time. However part of the requirements is that this application is extensible. In other words, once developed a "support" person can drop a new WSDL file into the application and without recompiling this becomes immediately available.
So the question is, does anybody know of a way that this can be done?
|
|
|
|
|
Hey there MrEyes,
You’ve been posed with a tough one there and you might have to do some research on the following topic:
Reflection and runtime target invocation.
In a nut shell, you will need to implement the following strategy in your proxy assembly:
* You will need to create a public interface that all your web services must implement. The reason being that your proxy will need this metadata to expose the underlying functionality to the caller and identify the service as a deployable package.
* You will need to implement a directory search service that looks for new web services and checks for the presence of the public interface you implemented above. Store the value away in a file or database so that you have a list of web services you know about.
* Through runtime target invocation, you can now call the web service functionality dynamically; you will need knowledge of the Reflection namespace to achieve your goal.
I hope I’ve pointed you in the right direction for now, good luck.
Fernando Mendes
Senior .NET Developer, Architect
|
|
|
|
|
Well based on your comments and some research the general plan of action is something like the following:
The "Proxy" service exposes a "CallWebService" method that takes an XML structure as one of the parameters. This structure will look something like the following:
<CallData webserviceName="mywebservice">
<parameters>
<parameter key="input1" value="input 1 data"/>
<parameter key="input2" value="input 2 data"/>
<parameter key="input3" value="input 3 data"/>
</parameters>
</CallData>
When the "proxy" receives this request the following occurs:
1) Loads the relevant WSDL and associated config (i.e. endpoint, timeouts etc) from the "webservicename" attribute (probably from a DB).
2) From the WSDL data constructs an empty soap message to be posted, i.e. something like this
POST /Service1.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://services.com/mywebservice"
<?xml version="1.0" encoding="utf-8"?$gt;
<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/"$gt;
<soap:Body$gt;
<mywebservice xmlns="http://messaging.external.e-mis.com/"$gt;
<input1$gt;</input1$gt;
<input2$gt;</input2$gt;
<input3$gt;</input3$gt;
</mywebservice$gt;
</soap:Body$gt;
</soap:Envelope$gt;
3) From the submitted parameter data adds the relevant values to the relevant element in the soap message
4) Posts the full formed SOAP message to the configure endpoint
5) When the sync reply is received, it extracts the return data and puts this into a similar XML structure to the one that the client submitted, e.g.
<ResultData>
<results>
<result key="input1" value="input 1 data"/>
<result key="input2" value="input 2 data"/>
</results>
</CallData>
And then returns this back to the client
Point number 2 is where things get a little complicated. Having hunted around a little I have found a sample here on codeproject:
http://www.codeproject.com/cs/webservices/wsdlparser.asp[^]
I believe that this will do what I need, however it needs some hacking as the treeview is deeply embedded within the parsing code.
|
|
|
|
|
I want to develop an inventory system. The system has a database for an inventory, database for sales made and textfile to record sold items. I want to know how can i read t a textfile from a database.
Thank you
|
|
|
|
|
You cannot directly create a text file from the database text.You will have to read it and right it to the file.(Of course you can use things like DTS package to export values to text file directly)
|
|
|
|
|
How to put in web services to a smartphone device. The code t do that.
Thank you
|
|
|
|
|
halalalal wrote: How to put in web services to a smartphone dev
Are you asking how to HOST a web service in a smart phone?? Or are you asking how to CALLL a web service??
AFAIK, it's not possible to host a web service on a smart phone.
|
|
|
|
|
form2 is mdi child form of form1.there is a listview control and a search button on form2.when execute the project, mdi parent form(form1) loads and when click on the form2 menu, form2 loads and data shows in the listview based on criteria. when click the search button of form2, a new form form3 opens which in not mdi child form. on form3, a textbox and a button(name-search).in form3,i give the text in textbox existing in listview column of form2 and click on button(name-search). it should dispay record on the same listview of form2,when form2 activates.when form3 close, form2 gets activated.
code of form2 button
public static string check="1";
form3 objFrm3=new form3();
objFrm3.show();
code for form2_activated event
public void form2_Activated(object sender, EventArgs e)
{
if (check != "1")
{
string records = form3.record;
string sqlQuery = "select * from emp where ename like '" + records + "'";
int count = listView1.Columns.Count;
search(sqlQuery, count);
}
private void search(string sqlQuery, int count)
{
SqlConnection objCon = new SqlConnection(objFunction.strConn);
SqlDataAdapter objAdapter = new SqlDataAdapter(sqlQuery, objCon);
DataSet objDs = new DataSet();
objAdapter.Fill(objDs, "f");
listView1.Items.Clear();
for (int i = 0; i < objDs.Tables[0].Rows.Count; i++)
{
DataRow objDr = objDs.Tables[0].Rows[i];
ListViewItem objLv1 = new ListViewItem(objDr[0].ToString());
for (int j = 1; j < count; j++)
{
objLv1.SubItems.Add(objDr[j].ToString());
}
listView1.Items.Add(objLv1);
}
listView1.Items[0].Focused = true;
}
code of form3 of button(name-search)
public static string record=textBox1.Text;
form2.check = "2";
form2 objFrm2 = new form2();
objFrm2.form2_Activated(sender, e);
this.Close();
best regards,
mukesh
|
|
|
|
|
Hello. I have an application in VS 2005 that I must migrate to VS 2003 (what a great upgrade is 2005 btw), and I see that there is no dataset.CreateDataReader method.
Is there other way to do that? Do you know from other implementation I can find anywhere?
Regards,
Diego F.
|
|
|
|
|
One way would be to miss out the dataset and manually create a DataReader using ExecuteDataReader() on the command.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
If think if you are migrating backwards you will find a lot of things that didn't exist in the previous version.
The best workaround that I can suggest is that all DataReaders implement the IDataReader interface. Create your own class that implements the IDataReader interface that has a constructor that is a DataSet.
|
|
|
|
|
Hi , I need a CALLER ID Component for c#,
Plz Send to Me
|
|
|
|
|
Check whether the following link is useful
http://www.codeproject.com/useritems/CShart_TAPI_3x.asp
*jaans
|
|
|
|
|
Hi,
How can i send a message like MouseDown message without using win32 apis inC#.
Vikas Maan
|
|
|
|
|
http://msdn2.microsoft.com/en-us/library/ms171548.aspx
|
|
|
|
|
Hi,
How can i send a message like MouseDown message without using win32 apis inC#.
|
|
|
|
|
have a look in to this http://msdn2.microsoft.com/en-us/library/ms171548.aspx
|
|
|
|
|
I want to search a file from server and want to copy it to the local disk.
how it is done?
|
|
|
|
|
You can search for a file.using Directory.GetFiles(FileName,SearchPattern);
And copy to local system using ftp request and response classes in System.Net.
Mean while what is your application is a client server apps or a web applicaiton ?
|
|
|
|
|
My application is to search the particular element from an xml file and to search a file with that name in server. and i have to copy the same file to my local disk.
I tried to searc using using Directory.GetFiles(FileName,SearchPattern);
but it is not at all serching.
|
|
|
|
|
Plz help me for the above..............
|
|
|
|
|
P_Elza wrote: not at all serching
Hope you are checking if the directory is existing using
Directory.Exists ?
P_Elza wrote: search the particular element from an xml file
Are the innertext's value assigned to the intended variables?
Probably debugging the app will help you understand where it fails.
|
|
|
|
|
Tis is working if the file is in my hard disk itself.
but not when it comes to server. If i map the server i can search.like
y:\\my folder\\myfolder
am tring to make an exe. different people will map to different drive.
so i cant give like that.should give like \\server\\serverfolde\\folder\\
|
|
|
|