|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
WEb Services ErrorI am working on the creating a web service and I have a code like Public function test (byval query as string) as string query.loadxml (queryxml) ------------- I am getting error like System.IO.FileNotFoundException: Could not find file 'C:\Shared_folder\Test\query'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) at System.Threading.CompressedStack.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state) at System.Xml.XmlTextReaderImpl.OpenUrl() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.Load(String filename) at ResearchPane.QueryProcessor.Query(String queryXml) in C:\Shared_folder\TEST\App_Code\Query.asmx.vb:line 78 I also tried the load method in place of the loadxml .. can anyone suggest some solution.. Thanks, Dave I would like 2 give the error again . as the previous one is when i
write requestxml.load(query)... This one is the error when i write requestxml.loadxml(query) System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.Throw(String res) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.LoadXml(String xml) at ResearchPane.QueryProcessor.Query(String queryXml) in C:\Shared_folder\GS5000RefLib\App_Code\Query.asmx.vb:line 78 Thanks dave ankitd***@gmail.com wrote: Show quote > Hi Guyz.. > > I am working on the creating a web service and I have a code like > > > Public function test (byval query as string) as string > > query.loadxml (queryxml) > > > > > > ------------- > > I am getting error like > > > System.IO.FileNotFoundException: Could not find file > 'C:\Shared_folder\Test\query'. > at System.IO.__Error.WinIOError(Int32 errorCode, String > maybeFullPath) > at System.IO.FileStream.Init(String path, FileMode mode, FileAccess > access, Int32 rights, Boolean useRights, FileShare share, Int32 > bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String > msgPath, Boolean bFromProxy) > at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess > access, FileShare share, Int32 bufferSize) > at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials > credentials) > at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, > Type ofObjectToReturn) > at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) > at System.Threading.CompressedStack.runTryCode(Object userData) > at > System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode > code, CleanupCode backoutCode, Object userData) > at System.Threading.CompressedStack.Run(CompressedStack > compressedStack, ContextCallback callback, Object state) > at System.Xml.XmlTextReaderImpl.OpenUrl() > at System.Xml.XmlTextReaderImpl.Read() > at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, > Boolean preserveWhitespace) > at System.Xml.XmlDocument.Load(XmlReader reader) > at System.Xml.XmlDocument.Load(String filename) > at ResearchPane.QueryProcessor.Query(String queryXml) in > C:\Shared_folder\TEST\App_Code\Query.asmx.vb:line 78 > > > > I also tried the load method in place of the loadxml .. can anyone > suggest some solution.. > > Thanks, > Dave The XmlDocument Load method has several overloads including to a file path
and to a Url, or from a stream. The LoadXml method expects a string containing the string equivalent of a complete Xml Document. Peter -- Show quoteCo-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com UnBlog: http://petesbloggerama.blogspot.com "ankitd***@gmail.com" wrote: > Hi Guyz.. > > I am working on the creating a web service and I have a code like > > > Public function test (byval query as string) as string > > query.loadxml (queryxml) > > > > > > ------------- > > I am getting error like > > > System.IO.FileNotFoundException: Could not find file > 'C:\Shared_folder\Test\query'. > at System.IO.__Error.WinIOError(Int32 errorCode, String > maybeFullPath) > at System.IO.FileStream.Init(String path, FileMode mode, FileAccess > access, Int32 rights, Boolean useRights, FileShare share, Int32 > bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String > msgPath, Boolean bFromProxy) > at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess > access, FileShare share, Int32 bufferSize) > at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials > credentials) > at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, > Type ofObjectToReturn) > at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) > at System.Threading.CompressedStack.runTryCode(Object userData) > at > System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode > code, CleanupCode backoutCode, Object userData) > at System.Threading.CompressedStack.Run(CompressedStack > compressedStack, ContextCallback callback, Object state) > at System.Xml.XmlTextReaderImpl.OpenUrl() > at System.Xml.XmlTextReaderImpl.Read() > at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, > Boolean preserveWhitespace) > at System.Xml.XmlDocument.Load(XmlReader reader) > at System.Xml.XmlDocument.Load(String filename) > at ResearchPane.QueryProcessor.Query(String queryXml) in > C:\Shared_folder\TEST\App_Code\Query.asmx.vb:line 78 > > > > I also tried the load method in place of the loadxml .. can anyone > suggest some solution.. > > Thanks, > Dave > > Hi..,
Can you suggest me the more specific way to implement that. I am a bit new to the XML . Basically I am inserting a textbox value from the application into the XML document. I tried using both requestxml.loadxml(query) aswell as requestxml.load(query).. but coming errors.. Can anyone suggest me the exact phrase which i need to change..? thanks , Dave Peter wrote: Show quote > The XmlDocument Load method has several overloads including to a file path > and to a Url, or from a stream. > The LoadXml method expects a string containing the string equivalent of a > complete Xml Document. > > Peter > > -- > Co-founder, Eggheadcafe.com developer portal: > http://www.eggheadcafe.com > UnBlog: > http://petesbloggerama.blogspot.com > > > > > "ankitd***@gmail.com" wrote: > > > Hi Guyz.. > > > > I am working on the creating a web service and I have a code like > > > > > > Public function test (byval query as string) as string > > > > query.loadxml (queryxml) > > > > > > > > > > > > ------------- > > > > I am getting error like > > > > > > System.IO.FileNotFoundException: Could not find file > > 'C:\Shared_folder\Test\query'. > > at System.IO.__Error.WinIOError(Int32 errorCode, String > > maybeFullPath) > > at System.IO.FileStream.Init(String path, FileMode mode, FileAccess > > access, Int32 rights, Boolean useRights, FileShare share, Int32 > > bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String > > msgPath, Boolean bFromProxy) > > at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess > > access, FileShare share, Int32 bufferSize) > > at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials > > credentials) > > at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, > > Type ofObjectToReturn) > > at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) > > at System.Threading.CompressedStack.runTryCode(Object userData) > > at > > System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode > > code, CleanupCode backoutCode, Object userData) > > at System.Threading.CompressedStack.Run(CompressedStack > > compressedStack, ContextCallback callback, Object state) > > at System.Xml.XmlTextReaderImpl.OpenUrl() > > at System.Xml.XmlTextReaderImpl.Read() > > at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, > > Boolean preserveWhitespace) > > at System.Xml.XmlDocument.Load(XmlReader reader) > > at System.Xml.XmlDocument.Load(String filename) > > at ResearchPane.QueryProcessor.Query(String queryXml) in > > C:\Shared_folder\TEST\App_Code\Query.asmx.vb:line 78 > > > > > > > > I also tried the load method in place of the loadxml .. can anyone > > suggest some solution.. > > > > Thanks, > > Dave > > > > |
|||||||||||||||||||||||