|
have u tried checking the well formedness of the xml file or xml data. please chk for the well formed ness of ur xml data and then try getting ur work done. I'm not sure as to whether u've done some exception handling stuff say like try..catch..finally n stuff. this would give u the correct output for ur error.
Regards Wilbur
|
|
|
|
|
Hi all.
WSE 2.0 on .Net 1.1 SP1, C#, Win XP Pro.
In a web service, I have a custom UsernameTokenManager, override AuthenticateToken, set up all the relevant stuff to make it use the WSE, but it never calls AuthenticateToken, simply fails on the standard default AuthenticateToken.
Microsoft.Web.Services2.Security.SecurityFault: The security token could not be authenticated or authorized at Microsoft.Web.Services2.Security.Tokens.UsernameTokenManager.OnLogonUserFailed(UsernameToken token)
Am I missing anything simple?
My custom UsernameTokenManager:
[SecurityPermissionAttribute(SecurityAction.Demand, Flags=SecurityPermissionFlag.UnmanagedCode)]<br />
public class UsernameManager : UsernameTokenManager<br />
{<br />
protected override string AuthenticateToken(UsernameToken token)<br />
{<br />
if (token == null)<br />
throw new ArgumentNullException();<br />
return "password";<br />
}<br />
}<br />
In my web service web.config file I have
<microsoft.web.services2><br />
<diagnostics /><br />
<security><br />
<securityTokenManager type="WebServiceNamespace.UsernameManager, WebServiceDllName" xmlns:wsse="http://schemas.xmlsoap.org/ws/2003/06/secext" qname="wsse:UsernameToken" /><br />
</security><br />
</microsoft.web.services2>
My proxy class for the service is derived from WebServicesClientProtocol.
In my call to the web service, I do this:
Myservice svc = new Myservice();<br />
UsernameToken tok = new UsernameToken("admin", "password", <br />
PasswordOption.SendPlainText);<br />
svc.RequestSoapContext.Security.Tokens.Add(tok);<br />
svc.AFunctiononTheService();
I guess its something simple that I'm missing, but I'm struggling to identify it!
Help!
|
|
|
|
|
hi!!!
Try changing your xmlns for this one :
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
bye
|
|
|
|
|
Thanks, that was spot on!
|
|
|
|
|
i m facing the Problem in inserting tabindex for column Header in data grid
Actually i want to move thr cursor on column header in data grid .
Help me.
Amit
|
|
|
|
|
I looking for a good beginners to advanced book on the XML/XSL. It should have thorough explanations and working examples (with ISBN numbers please). I'm intending using it either with Java or C#. Any comment on this?
Brendan
|
|
|
|
|
Hi,
I bought Wrox (Programmer to Programmer) Professional XML in the year 2000, and I would recomend it. I don't think it's available now but has been split into various versions aimed at Java, Apache, ASP, etc. I'm guessing that most of the content is much the same in the other books.
FYI the authors of my copy are:
Didier Martin, Mark Birbeck, Michael Kay, Brian Loesgen, Jon Pinnock, Steven Livingstone, Peter Stark, Kevin Williams, Richard Anderson, Stephen Mohr, David Baliles, Bruce Peat,Nikola Ozu.
I would think that anything with a combination of some of these authors would be good.
If you're doing XSLT then Michael Kay's book (Wrox) XSLT Programmers Reference is one of the best programmers books that I've ever come across.
Cheers
Phil Hobgen
Southampton, UK
|
|
|
|
|
Can you maybe supply me the ISBN number of this book you mentioned?
What skills do you specialise in?
|
|
|
|
|
Brendan Vogt wrote:
Can you maybe supply me the ISBN number of this book you mentioned?
1-861003-11-0
I think it's out of print but still listed on Amazon (UK) as available "used and new" very cheaply. A few parts of the book will be outdated, unless there was a 2nd edition. An alternative might be Professional ASP.NET 1.0 XML with C# (1-861007-24-8), which has some of the same authors involved - but I haven't read it!
Brendan Vogt wrote:
What skills do you specialise in?
Delphi for Win32 apps and C# for Web & Windows Forms; + XML, SQL Server, etc.
Cheers
Phil Hobgen
Southampton, UK
|
|
|
|
|
Is this (Professional XML) a good book for XML beginners?
Thanks
|
|
|
|
|
Guys,
I have been trying to transform and XML file using XSLT 1.0 but haven't been able to as i want to get the minimum value,abs. I tried using EXSLT but cannot get it running as i keep getting one or the other stupid errors. If possible please provide me with a sample if ur using the namespace http://exslt.org/dynamic or math or func or sumthing.
Thanx
regards
Wilbur
|
|
|
|
|
Hi,
I don't know about EXSLT but I remember performing an abs type operation by converting the number to a string using something like
format-number(value, "+#.##;-#.##")
then you can trim the leading + or - and convert back to a number.
It's a bit convoluted, but can be done.
Cheers
Phil Hobgen
Southampton, UK
|
|
|
|
|
Hi!
I am using windows applications and I am trying to create a application config file.
I have created an app. config file thru add item and this is how it looks..
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="FilePath" value="C:\testConfig.xml" />
</appSettings>
</configuration>
And from my code I am accessing the config file soemthing like this
using System.Configuration;
string path = ConfigurationSettings.AppSettings("FilePath");
I am getting this error:
An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll Only elements allowed
I would appreciate any insight
Thanks in advance
|
|
|
|
|
I'm using the Microsoft Communications API SDK to make SIP calls.
I then try to register with the Asterisk[^] registrar, however it never works. From the SDK documentation says I need to write an XML profile. I haven't managed to write one yet that works. Can anyone help please? TIA
Jerry
I feel like I'm diagonally parked in a parallel universe
Jerry Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
I see the syntax of msxsl.exe says -o for output. But I do not know how to apply it.
I would like to write a batch program that outputs the result to a file named week3result.xml. This is what I have
C:\XML_Class\msxsl.exe C:\XML_Class\week3\MomAndPop.xml C:\XML_Class\week3\order.xsl -o c:\xml class\week3\week3result.xml
Thank you.
Again I am looking for the correct syntax to direct the output from the screen to a file.
|
|
|
|
|
Hi,
You need quotes round the output filename, it's got a space in it.
Cheers
Phil Hobgen
Southampton, UK
|
|
|
|
|
i wrote a simple line of code that retrives a value from a static XML file but my problem that it returns diffrent result every time it runs, the line is:
string asd = VoteData.DocumentElement.ChildNodes[1].ChildNodes[1].InnerText;
maybe that happen coz the file is not completely loaded , i'm using C# but i don't found any method that let me know if the file is completely loaded or not, i know that theres a function in javascript which is : readyState that do the job, but i can't found any in C#, can anyone help ?
thanx in advance.
|
|
|
|
|
Hi Guys,
I am using XML 2.0 to parse some files in Windows CE .NET 4.2. I am thinking of using XML 3.0 for parsing purpose. Will this increase the performance? Will this improve the speed of parsing?
If you guys have any articles on this please send me.
With regards
A.Santosh
|
|
|
|
|
Hi..
I am having some problems with the xmldocument. Below is my code...can anyone tell me why the output is not well formed..this is my ouput for the following code...
<?xml version="1.0" ?>
- <Persons>
- <Person Name="v" Age="00">
<Title="v" />
</Person>
</Persons>
why is the Title element not complete???
XmlDocument xmlDoc = new XmlDocument();
XmlDeclaration xmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0",null,null);
XmlElement rootNode = xmlDoc.CreateElement("Persons");
xmlDoc.InsertBefore(xmlDeclaration, xmlDoc.DocumentElement);
xmlDoc.AppendChild(rootNode);
XmlElement Node = xmlDoc.CreateElement("Person");
Node.SetAttribute("Name", name);
Node.SetAttribute("Age", age);
xmlDoc.DocumentElement.AppendChild(Node);
XmlElement Node1 = xmlDoc.CreateElement("Title");
Node1.SetAttribute("Title", title);
Node.AppendChild(Node1);
Thank you
|
|
|
|
|
The output IS well formed. When a node does not have children, it can be shown like this:
<Title></Title>
OR like this:
<Title/>
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Ooops - I meant to say that <Title/> is the same as <Title></Title>, but I forgot to check the little box
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi
I have a few textbox entries that i have written to an xml file and now I have to add a datasource as its child node. Any ideas on how to achieve this. I did try WriteXml method for datasource but this does not write to the file as a child node.
This is what I am trying to do
<Query name = "XYZ", age = "123" >
<Criteria>
<criterion display = "aaaa", commname = "kkkkkk">
</criterion>
<Criteria>
<Query>
The query's name and age are textbox entries and the Criteria is a part of the dataset. So i am trying to insert <Criteria> as child node to <query>
Any ideas will be greatly appreicated
Thanks in advance
|
|
|
|
|
hi, I think you can write your Criteria node to, say XmlDocumentFragment (using XmlWriter ), and then append it as node to your original XML - assumming it's in XmlDocument or similar (basicaly everything with AppendChild method ). Or you can probably work with XmlWriter directly.
Does it help?
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
David
I looked into XmlWriter class. The problem is writing the complete dataset individually by adding elements and its attributes. Criteria has a about 10 columns that I did not specify in the mail. If I were to use XmlWriter then I would have to append every single column as an element. But the datasource's writeXml method takes care of everything. Would you happen to know how I can create a document fragment and somehow use ds.WriteXml("Filename") method
Thanks!!!
Rekha
|
|
|
|
|
hi,
Of course you can let dataset do lot of work for for you! you can use
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatasetclasswritexmltopic4.asp">WriteXml(XmlWriter) </a>[<a target=_blank title='New Window' href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatasetclasswritexmltopic4.asp">^</a>]<br /> overloaded method to write columns and all into XmlWriter at once. Bt yes, you would have to write your Query element by yourself...
example:
XmlTextWriter w = new XmlTextWriter(filename);
w.WriteElementStart("query");
ds.WriteXml(w);
w.WriteElementEnd();
w.Close();
It's not exact code - just idea how to do that... I don't know exact method names and arguments from heart... I think this way it should work...
As for XmlDocument, sorry. I forgot you can load XML into it with XmlReader, bt AFAIK you can't write into it with XmlWriter. My fault.
hmm or you can save dataset into file, than load it to XmlDocument and than you can create XmlDocumentFragment from it. Next step is to append Criteria node to Query element - It suppose to have Query also loaded in (another) XmlDocument - probably less efficient solution than the first one ( with XmlTextWriter).
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|