Click here to Skip to main content
11,436,803 members (72,214 online)
   

ASP.NET

 
GeneralRe: sequence contains no elements Pin
Matt U.19-Dec-12 2:47
memberMatt U.19-Dec-12 2:47 
Question[session] returns null Pin
xnaLearner18-Dec-12 0:20
memberxnaLearner18-Dec-12 0:20 
AnswerRe: [session] returns null Pin
Rahul Rajat Singh18-Dec-12 0:47
memberRahul Rajat Singh18-Dec-12 0:47 
GeneralRe: [session] returns null Pin
xnaLearner18-Dec-12 1:10
memberxnaLearner18-Dec-12 1:10 
GeneralRe: [session] returns null Pin
xnaLearner18-Dec-12 1:12
memberxnaLearner18-Dec-12 1:12 
SuggestionRe: [session] returns null Pin
Chandrabhan Sangale18-Dec-12 18:59
memberChandrabhan Sangale18-Dec-12 18:59 
QuestionMultilingual support for Web Application Pin
AB777118-Dec-12 0:18
memberAB777118-Dec-12 0:18 
AnswerRe: Multilingual support for Web Application Pin
Rahul Rajat Singh18-Dec-12 0:43
memberRahul Rajat Singh18-Dec-12 0:43 
GeneralRe: Multilingual support for Web Application Pin
AB777118-Dec-12 3:27
memberAB777118-Dec-12 3:27 
AnswerRe: Multilingual support for Web Application Pin
deflinek18-Dec-12 0:57
memberdeflinek18-Dec-12 0:57 
SuggestionRe: Multilingual support for Web Application Pin
Chandrabhan Sangale18-Dec-12 19:01
memberChandrabhan Sangale18-Dec-12 19:01 
Questiongoogle map Pin
cdpsource17-Dec-12 21:52
membercdpsource17-Dec-12 21:52 
AnswerRe: google map Pin
ryanb3118-Dec-12 5:55
memberryanb3118-Dec-12 5:55 
QuestionProblem to send message from MSMQ Pin
TRAORE cheickna17-Dec-12 11:20
memberTRAORE cheickna17-Dec-12 11:20 
Hello,

I created a WCF service into my asp.net app in order to store some messages into queue using MSMQ before send them to users. The first part work fine because i can see all messages in a pickup directory with Windows Explorer. I also can see the message number using windows service manager throw my private queue.

The second part don't work i.e my messages aren't sent and i have no error message. I don't understand where the problem come from. The code i use is following :

msmqQueuePath is my Queue name

Public Sub GetMailMessages() Implements ISvcEmailManagement.GetMailMessages
 
        Try
            ' Create an instance of MessageQueue. Set its formatter.
            Dim _msmqQueue As New MessageQueue(msmqQueuePath)
            '_msmqQueue.Formatter = New XmlMessageFormatter(New Type() {GetType([String])})
            _msmqQueue.Formatter = New BinaryMessageFormatter
            _msmqQueue.MessageReadPropertyFilter.SetAll()
            ' Add an event handler for the ReceiveCompleted event.
            AddHandler _msmqQueue.ReceiveCompleted, AddressOf msmqQueue_ReceiveCompleted
            Dim returnValue As IAsyncResult
            ' Begin the asynchronous receive operation.
            returnValue = _msmqQueue.BeginReceive()
            signal.WaitOne()
            ' Do other work on the current thread.
            Return
        Catch ex As Exception
            Dim Msg As String = ex.Message
            Throw ex
        End Try
 
    End Sub
 

The receiveCompleted function is :

Public Sub msmqQueue_ReceiveCompleted(ByVal sender As Object, ByVal e As ReceiveCompletedEventArgs)
        Try
            Dim emailMsg As EmailEntities.CEmailMessage = e.Message.Body
            'Remplir l'objet Message avec TO, FROM, BODY, SUBJECT en supposant que le message soit au bon format
            Dim mailMessage As MailMessage = New MailMessage()
            mailMessage.To.Add(New MailAddress(emailMsg.sTO))
            mailMessage.From = New MailAddress(emailMsg.sFROM)
            mailMessage.Subject = emailMsg.sSUBJECT
            mailMessage.Body = emailMsg.sBODY
            Dim oclient As SmtpClient = New SmtpClient()
            Try
                oclient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory
                oclient.Send(mailMessage)
            Catch ex As SmtpFailedRecipientsException
                Dim i As Integer
                For i = 0 To ex.InnerExceptions.Length - 1
                    Dim status As SmtpStatusCode = ex.InnerExceptions(i).StatusCode
                    If (status = SmtpStatusCode.MailboxBusy) Or (status = SmtpStatusCode.MailboxUnavailable) Then
                        'Echec à l'envoi du message : tentative dans 5 secondes
                        System.Threading.Thread.Sleep(5000)
                        oclient.Send(mailMessage)
                    Else
                        'Echec d'envoi du message à {0}
                        MsgBox("Failed to deliver message to {0}", MsgBoxStyle.Information, ex.InnerExceptions(i).FailedRecipient)
                    End If
                Next i
            Catch ex As SmtpException
                Dim msstatus As String = ex.Message
            End Try
        Catch ex As SmtpException
            Dim msstatus As String = ex.Message
        Catch ex As Exception
            Dim msstatus As String = ex.Message
            'Catch ex As XmlException
            '    Dim msstatus As String = ex.Message
        End Try
    End Sub


Thanks a lot for any help
Questionexport report failed in crystal report Pin
himadribanik17-Dec-12 7:51
memberhimadribanik17-Dec-12 7:51 
QuestionRefresh particular parts on masterpage Pin
cdpsource17-Dec-12 6:58
membercdpsource17-Dec-12 6:58 
AnswerRe: Refresh particular parts on masterpage Pin
Matt U.17-Dec-12 7:51
memberMatt U.17-Dec-12 7:51 
GeneralRe: Refresh particular parts on masterpage Pin
cdpsource17-Dec-12 7:59
membercdpsource17-Dec-12 7:59 
GeneralRe: Refresh particular parts on masterpage Pin
Matt U.17-Dec-12 8:06
memberMatt U.17-Dec-12 8:06 
GeneralRe: Refresh particular parts on masterpage Pin
cdpsource17-Dec-12 9:23
membercdpsource17-Dec-12 9:23 
SuggestionRe: Refresh particular parts on masterpage Pin
Chandrabhan Sangale18-Dec-12 19:04
memberChandrabhan Sangale18-Dec-12 19:04 
Questionsession variable / temp data Pin
xnaLearner17-Dec-12 5:25
memberxnaLearner17-Dec-12 5:25 
QuestionSalable Comet (server hang while more user) Pin
vaibhav.baldha17-Dec-12 4:47
membervaibhav.baldha17-Dec-12 4:47 
AnswerRe: Salable Comet (server hang while more user) Pin
Chandrabhan Sangale18-Dec-12 18:49
memberChandrabhan Sangale18-Dec-12 18:49 
QuestionThe underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Pin
kapil sharma 4917-Dec-12 3:02
memberkapil sharma 4917-Dec-12 3:02 
AnswerRe: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Pin
ryanb3118-Dec-12 5:58
memberryanb3118-Dec-12 5:58 
QuestionCan only book for yourself and not other users? Pin
xnaLearner17-Dec-12 2:29
memberxnaLearner17-Dec-12 2:29 
QuestionRe: Can only book for yourself and not other users? Pin
Zaf Khan19-Dec-12 6:49
memberZaf Khan19-Dec-12 6:49 
QuestionEval + onclientClick Gridview Error [modified] Pin
jojoba201116-Dec-12 21:38
memberjojoba201116-Dec-12 21:38 
QuestionRe: Eval + onclientClick Gridview Error Pin
ryanb3118-Dec-12 5:59
memberryanb3118-Dec-12 5:59 
QuestionSound transmission Pin
leone16-Dec-12 6:16
memberleone16-Dec-12 6:16 
QuestionRe: Sound transmission Pin
ryanb3118-Dec-12 6:00
memberryanb3118-Dec-12 6:00 
AnswerRe: Sound transmission Pin
leone19-Dec-12 0:22
memberleone19-Dec-12 0:22 
GeneralRe: Sound transmission Pin
ryanb3119-Dec-12 2:38
memberryanb3119-Dec-12 2:38 
GeneralRe: Sound transmission Pin
leone19-Dec-12 3:54
memberleone19-Dec-12 3:54 
QuestionDropDownList changed after reading SelectedValue !!!! [modified] Pin
Adore C++15-Dec-12 10:11
memberAdore C++15-Dec-12 10:11 
AnswerRe: DropDownList changed after reading SelectedValue !!!! Pin
rakak15-Dec-12 19:29
memberrakak15-Dec-12 19:29 
GeneralRe: DropDownList changed after reading SelectedValue !!!! Pin
Adore C++16-Dec-12 5:18
memberAdore C++16-Dec-12 5:18 
GeneralRe: DropDownList changed after reading SelectedValue !!!! Pin
chester_it2116-Dec-12 10:10
groupchester_it2116-Dec-12 10:10 
QuestionIIS7.5 Specific Problem Pin
Ayan Chatterjee15-Dec-12 8:07
memberAyan Chatterjee15-Dec-12 8:07 
QuestionRe: IIS7.5 Specific Problem Pin
ryanb3118-Dec-12 6:01
memberryanb3118-Dec-12 6:01 
QuestionResponse and Redirect Pin
Ani199115-Dec-12 4:32
memberAni199115-Dec-12 4:32 
AnswerRe: Response and Redirect Pin
jkirkerx16-Dec-12 19:17
memberjkirkerx16-Dec-12 19:17 
AnswerRe: Response and Redirect Pin
chester_it2117-Dec-12 18:41
groupchester_it2117-Dec-12 18:41 
QuestionSlideShow Pin
cdpsource14-Dec-12 13:28
membercdpsource14-Dec-12 13:28 
AnswerRe: SlideShow Pin
ryanb3118-Dec-12 6:04
memberryanb3118-Dec-12 6:04 
Questiontwo buttons in one page Pin
Jassim Rahma14-Dec-12 8:55
memberJassim Rahma14-Dec-12 8:55 
AnswerRe: two buttons in one page Pin
Elham M15-Dec-12 2:26
memberElham M15-Dec-12 2:26 
AnswerRe: two buttons in one page Pin
Richard MacCutchan15-Dec-12 3:21
mvpRichard MacCutchan15-Dec-12 3:21 
AnswerRe: two buttons in one page [modified] Pin
CommDev15-Dec-12 21:19
memberCommDev15-Dec-12 21:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150428.2 | Last Updated 6 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid