473,395 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

I am new to vb.net. I created a web service making use of SoapExtension.

Expand|Select|Wrap|Line Numbers
  1. System.InvalidOperationException was unhandled
  2.   Message="Client found response content type of 'text/plain; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path 'd:\logFile.txt' is denied.    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)    at Orders.SoapDisplayExtension.WriteInput(SoapMessage message) in C:\Inetpub\wwwroot\Orders\Orders\SoapDisplayExtension.vb:line 73    at Orders.SoapDisplayExtension.ProcessMessage(SoapMessage message) in C:\Inetpub\wwwroot\Orders\Orders\SoapDisplayExtension.vb:line 48    at System.Web.Services.Protocols.SoapMessage.RunExtensions(SoapExtension[] extensions, Boolean throwOnException)    at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()    at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()    --- End of inner exception stack trace ---  --."
  3.   Source="System.Web.Services"
  4.   StackTrace:
  5.        at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)    at TestOrders.localhost.Service1.GetOrder(Int32 OrderID) in C:\vbclient\TestOrders\TestOrders\Web References\localhost\Reference.vb:line 80    at TestOrders.Form1.Button1_Click(Object sender, EventArgs e) in C:\vbclient\TestOrders\TestOrders\Form1.vb:line 9    at System.Windows.Forms.Control.OnClick(EventArgs e)    at System.Windows.Forms.Button.OnClick(EventArgs e)    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)    at System.Windows.Forms.Control.WndProc(Message& m)    at System.Windows.Forms.ButtonBase.WndProc(Message& m)    at System.Windows.Forms.Button.WndProc(Message& m)    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)    at System.Windows.Forms.Application.Run(ApplicationContext context)    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)    at TestOrders.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81    at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)    at System.Threading.ThreadHelper.ThreadStart()
  6.   InnerException:
Oct 15 '09 #1
8 4020
tlhintoq
3,525 Expert 2GB
I am new to vb.net. I created a web service making use of SoapExtension.
Welcome to fun world of coding.

Did you have a question you wanted to ask?
Oct 15 '09 #2
I run the web service in the ie browser and it works fine but when I am calling the service from a client i get the response error:
Message="Client found response content type of 'text/plain; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path 'd:\logFile.txt'
Oct 15 '09 #3
tlhintoq
3,525 Expert 2GB
I run the web service in the ie browser and it works fine but when I am calling the service from a client i get the response error:
Ok. You get an error message. What is your question? What part of the error message are you not understanding?

Here's the part that seems significant to me:
System.UnauthorizedAccessException: Access to the path 'd:\logFile.txt' is denied.
I would guess you are writing to a log file that you don't have access to.
Oct 15 '09 #4
Yes, I want to write the incoming soap request to logFile.txt. I have both the client and server on my machine - localhost. It does not make sense to me that I am getting the UnauthorizedAccessException because the file is on my local machine.
Oct 15 '09 #5
tlhintoq
3,525 Expert 2GB
I have both the client and server on my machine - localhost.
Are they both trying to access the same log file?

One file on hard drive means there should be only one class reading from it or writing to it. Any more than that risks simultaneous attempts to access a single file.

Your client and your server should be writing to different files.
Each one should have some type of Logging class that is responsible for the file read/write.
Everything else in the application should access a method of the logging class to cause a write. I do this by raising an event of "LogThis(string Message)"

By having one one point that is responsible for writing in the log you can easily change the format of the log since there is only one place to make the change. Maybe you want to change it from
12:34 pm - This Happened
to
15oct09 12:34:56.123 - This Happened.
Oct 15 '09 #6
Actually no,

The client is calling the server awaiting a response and is not trying to access the logFile. On the other side the server gets the request and through the SoapExtension at the ProcessManager, the BeforeDeserialize option consist of a procedure which attempts to write the incoming SOAP Request to the logFile.

Hope this explains it. I would like to post the code but everything is at the office.

Sheldon
Oct 16 '09 #7
forgot to tell you that the client is a vb form
Oct 16 '09 #8
I got it to work. it was a permissions problem.
Oct 16 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: v. Seydewitz | last post by:
Hello, I want to log the soap requests (and responses) in my C# webservice consumer. I have extended my class with the SoapExtension, but the debugger don't step into the overridden methods. The...
3
by: Trevor Pinkney | last post by:
Hi, Is it possible to reference a custom SoapExtension instance from within a WebMethod? I have a SoapExtension used by several web-services for generic logging. The SoapExtension logs the...
2
by: Peter Norregaard | last post by:
Our customers have different names SLA’s / Service Level Agreements but use the same webservice. How do I handle that some users can be allowed to wait when the load is high while others can’t?...
3
by: Paul | last post by:
Hello, I am trying to write a client side SoapExtension to change the target web service url based on information from UDDI. Does any one know how to do it? I tried to set the url in the...
2
by: lprisr | last post by:
Hi, I have double byte characters in the content that I am returning using Web Services. However, the encoding in the xml file returned by Web Services is utf-8 and I am unable to read the...
1
by: Anthony Yott | last post by:
Folks, I have a ASMX Web Service (.Net 2.0) and I'm NOT using WSE. I would like to retrieve the incoming SOAP envelope body (raw XML) inside one of my web method calls but I'm not sure how to do...
1
by: AVL | last post by:
Hi, I a new bie to web services.. I've requirment wherein I need to build the xml response I know the method of my web service and I know it's return values.... I need to know the kind of xml...
0
by: thatsMaBoy | last post by:
Hi, I have a VB.NET 2003 web service client (EXE) that makes use of a SOAPExtension class. The client calls a web service that returns a SOAP message containing MIME encoded files. The...
5
by: navyliu | last post by:
Hi everyone.I want to catch message before before it's send to the Web Service.Just like WSE 3.0 customer UserNameTokenManager does.If I can do this,I can implement some functions in my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.