|
Isn't there anyone to answer this?
Hi, I wrote a Schema Validator in C#.NET.
XmlTextReader R = new XmlTextReader(FileToParse); <br />
XmlValidatingReader V = new XmlValidatingReader(R); <br />
try <br />
{ <br />
XmlSchemaCollection xsc = new XmlSchemaCollection(); <br />
xsc.Add("", SchemaFile); <br />
V.Schemas.Add(xsc); <br />
V.EntityHandling = EntityHandling.ExpandEntities; <br />
V.ValidationEventHandler += new ValidationEventHandler(ShowValidationErrors); <br />
while (V.Read()) <br />
{ <br />
} <br />
} <br />
catch (XmlException xe) <br />
{ <br />
} <br />
catch (XmlSchemaException xse) <br />
{ <br />
} <br />
catch (Exception ee) <br />
{ <br />
} <br />
finally <br />
{ <br />
V.Close(); <br />
MessageBox.Show("Validation Completed"); <br />
}
This works fine if the xml file DOES NOT contain entity declarations.
But, If the xml file contains any entity declaration (as below), the 'ValidationEventHandler' throws errors like
"Validation Error: The 'mytest' element is not declared.Line : 8 Position : 2"
"Validation Error: The 'articles' element is not declared.Line : 9 Position : 2", etc.....
How do I overcome this in C#.NET
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE mytest
[
a.'>
adv.'>
]>
<mytest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="X:\Schema\content.xsd">
-- modified at 7:56 Thursday 20th September, 2007
|
|
|
|
|
like msn messeger's setup(option),it has many items to setup.
when i click the apply button, how to judge items which it is setup and which it is not setup?
How to finish these setup quickly?
|
|
|
|
|
What does this have to do with C#??
And what are you talking about?? I can get something about an "About" dialog, but that's about it.
|
|
|
|
|
Hello community,
My problem is a Win32Exception, "Error creating window handle".
I know, normally it's a sign of a bad designed GUI if this happens. (Maybe also here, who knows)
But, I have a projects where a lot of controls on seperate UserControls and TabPages, have to stay in memory for the whole time.
This is like it is and can not be changed.
If I step threw all my GUI-"pages", at some point it crashes.
I did some tests and can say, that it is not a problem of:
too less memory
too high GDI objects (which are normaly limited to 10000, but can also be set higher)
I'm using a lot of selfe designed UserControls, which of corse can be redisigned in some cases.
Maybe if I do some changes there I could kill some subControls (1000-2000).
But this would mean that I'm always on the limit.
So I would like to have a method which allows me to find the big "handle eater" in my project first.
I'm also not sure if it is correct that the limit of max window handles in WinXP is fix 16bit, and can not be modified.
Thanks for suggestions!
Upps: Forgot to tell you, that I'm using .Net1.1, but I'm sure it will only be possible over an API.
-- modified at 5:12 Friday 14th September, 2007
Also Note: The Controls and Pages are in memory from beginning (start) of the application.
So stepping threw my pages are not effecting the used memory in any way.
All the best,
Martin
|
|
|
|
|
Hi!
You can p/invoke GetGuiResources() function from user32.dll to receive the number of GDI and USER objects currently used.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
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?
|
|
|
|