473,406 Members | 2,369 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,406 software developers and data experts.

Converting a VB.Net Console Application to a Web Service

Hi All,

I wrote a sample application to extract the messages and attachments from
a .pst file using VB.Net which is working fine. Now i am trying to web
service enable this and when i added an operation in .asmx File

<WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _
Public Function extractPST(ByVal fileName As String) As String
Dim readPST As ReadPST
readPST = New ReadPST
readPST.readPST(fileName)
Return "success"
End Function

And i have a class ReadPST.vb which has the code

Sub readPST(ByVal fileName As String)
Dim i As Integer
Dim objOutlook As New Outlook.Application
' Dim objNS As Outlook.NameSpace = objOutlook.Session
Dim myNameSpace As Outlook.NameSpace = objOutlook.GetNamespace("MAPI")
'Dim file As New System.IO.StreamWriter("c:\test.html")
' Add the .pst File to the Name Space
myNameSpace.AddStore(fileName)
...........

And when i tried to debug the code i am getting a 500 Error at the Line
Dim myNameSpace As Outlook.NameSpace = objOutlook.GetNamespace("MAPI")

How can i resolve this..

Thanks a lot
Sateesh


Nov 23 '05 #1
4 5136
Error 500 is an "internal error" -- which could mean anything. Chances are,
the getNameSpaces method will not work with the ASP.NET's worker process
security. Have you tried running the web service in a user security context?

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"kls_kumar" <kl******@discussions.microsoft.com> wrote in message
news:E0**********************************@microsof t.com...
Hi All,

I wrote a sample application to extract the messages and attachments from a .pst file using VB.Net which is working fine. Now i am trying to web
service enable this and when i added an operation in .asmx File

<WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _
Public Function extractPST(ByVal fileName As String) As String
Dim readPST As ReadPST
readPST = New ReadPST
readPST.readPST(fileName)
Return "success"
End Function

And i have a class ReadPST.vb which has the code

Sub readPST(ByVal fileName As String)
Dim i As Integer
Dim objOutlook As New Outlook.Application
' Dim objNS As Outlook.NameSpace = objOutlook.Session
Dim myNameSpace As Outlook.NameSpace = objOutlook.GetNamespace("MAPI") 'Dim file As New System.IO.StreamWriter("c:\test.html")
' Add the .pst File to the Name Space
myNameSpace.AddStore(fileName)
...........

And when i tried to debug the code i am getting a 500 Error at the Line
Dim myNameSpace As Outlook.NameSpace = objOutlook.GetNamespace("MAPI")

How can i resolve this..

Thanks a lot
Sateesh

Nov 23 '05 #2
The chances are that the ASPNET (IIS5) OR NETWORK SERVICE (IIS6) user does
not have access to read or access the mail files.

You sure you have OUTLOOK installed.

Try also to capture the exception, the 500 error is what IIS returns, which
is an internal error, but use the try catch and then write the error message
back, that may give you more information

Henk

"kls_kumar" <kl******@discussions.microsoft.com> wrote in message
news:E0**********************************@microsof t.com...
Hi All,

I wrote a sample application to extract the messages and attachments from
a .pst file using VB.Net which is working fine. Now i am trying to web
service enable this and when i added an operation in .asmx File

<WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _
Public Function extractPST(ByVal fileName As String) As String
Dim readPST As ReadPST
readPST = New ReadPST
readPST.readPST(fileName)
Return "success"
End Function

And i have a class ReadPST.vb which has the code

Sub readPST(ByVal fileName As String)
Dim i As Integer
Dim objOutlook As New Outlook.Application
' Dim objNS As Outlook.NameSpace = objOutlook.Session
Dim myNameSpace As Outlook.NameSpace =
objOutlook.GetNamespace("MAPI")
'Dim file As New System.IO.StreamWriter("c:\test.html")
' Add the .pst File to the Name Space
myNameSpace.AddStore(fileName)
...........

And when i tried to debug the code i am getting a 500 Error at the Line
Dim myNameSpace As Outlook.NameSpace = objOutlook.GetNamespace("MAPI")

How can i resolve this..

Thanks a lot
Sateesh

Nov 23 '05 #3

Hi sateesh

My name is masoom and i hope that u got my last message.. I read ur
message and u mentioned that extracting from pst in VB.NET is working
fine with you.. I am masters student and currently making project for
Police Department in MElbourne. I would be grateful to you if u can
pass the code or can help me in any other way as the RFC for the pst
file is not available.

my emial address is : ma***********@yahoo.com
or mc******@students.latrobe.edu.au

Thanking you in anticipation

Masoom Chauhan

kls_kumar wrote:
*Hi All,

I wrote a sample application to extract the messages and attachments
from
a .pst file using VB.Net which is working fine. Now i am trying to
web
service enable this and when i added an operation in .asmx File

<WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _
Public Function extractPST(ByVal fileName As String) As String
Dim readPST As ReadPST
readPST = New ReadPST
readPST.readPST(fileName)
Return "success"
End Function

And i have a class ReadPST.vb which has the code

Sub readPST(ByVal fileName As String)
Dim i As Integer
Dim objOutlook As New Outlook.Application
' Dim objNS As Outlook.NameSpace = objOutlook.Session
Dim myNameSpace As Outlook.NameSpace =
objOutlook.GetNamespace("MAPI")
'Dim file As New System.IO.StreamWriter("c:\test.html")
' Add the .pst File to the Name Space
myNameSpace.AddStore(fileName)
............

And when i tried to debug the code i am getting a 500 Error at the
Line
Dim myNameSpace As Outlook.NameSpace =
objOutlook.GetNamespace("MAPI")

How can i resolve this..

Thanks a lot
Sateesh *


--
masoom_mirage
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1493006.html

Apr 3 '06 #4

kls_kumar wrote:
*Hi All,

I wrote a sample application to extract the messages and attachments
from
a .pst file using VB.Net which is working fine. Now i am trying to
web
service enable this and when i added an operation in .asmx File

<WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _
Public Function extractPST(ByVal fileName As String) As String
Dim readPST As ReadPST
readPST = New ReadPST
readPST.readPST(fileName)
Return "success"
End Function

And i have a class ReadPST.vb which has the code

Sub readPST(ByVal fileName As String)
Dim i As Integer
Dim objOutlook As New Outlook.Application
' Dim objNS As Outlook.NameSpace = objOutlook.Session
Dim myNameSpace As Outlook.NameSpace =
objOutlook.GetNamespace("MAPI")
'Dim file As New System.IO.StreamWriter("c:\test.html")
' Add the .pst File to the Name Space
myNameSpace.AddStore(fileName)
............

And when i tried to debug the code i am getting a 500 Error at the
Line
Dim myNameSpace As Outlook.NameSpace =
objOutlook.GetNamespace("MAPI")

How can i resolve this..

Thanks a lot
Sateesh *


--
masoom_mirage
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1493006.html

Apr 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Henry Chen | last post by:
We have a multi-tier application using .net remoting. In server side, I can use either service and console application to process client request. I sometimes can not find the problem with the...
2
by: Chris | last post by:
Hi, Currently, I have a console application written in C# and an unmanaged legacy DLL written in VC++ 6.0. In the DLL's previous application, when an event occurs in the DLL, a windows message...
1
by: Clifton Griffin | last post by:
Ok, I have a proxy server written in c#. Because I'm maintaning two versions (a console application for debugging and a windows service for deployment) I got the console application working,...
1
by: kls_kumar | last post by:
Hi All, I have written a simple VB.Net Application which takes a .pst file and extracts the messages attachments from the .pst. It is working fine as a Console Application. I tried Web...
5
by: Tim Werth | last post by:
I have a .NET console application that is kicked off by a .NET Windows service. They communicate via .NET Remoting, although there isn't much communication between the two while the console app is...
2
by: asadikhan | last post by:
I have written a console application that clears out some folders. I want this application to run as a Windows Service (not a scheduled task). What is the easiest way to convert this console...
8
by: Todd Jaspers | last post by:
Hey guys, I've written a fairly simple Windows C# Application using Visual Studio 2005. I have to manually run it, but I would prefer to have it run on it's own, as if it was a Windows NT...
3
by: trymore | last post by:
hi all; Can anybody help me out there, I am very niave to programming windows services. I want to convert my console application to a windows service. any information of how i start this? ...
2
by: pankajprakash | last post by:
Hi All, I have a asp.net web service and I am running an .exe file though this web service. The web serivce is calling that .exe file (console application) and running the code of that console...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.