Click to See Complete Forum and Search --> : Web Proxy emergency help please


k4rt
July 16th, 2005, 12:33 AM
um yea guys i need to add a proxy, im makin a little mailer application but i cant seem to get it to run thru a proxy
here is the code to the mailer:
Option Strict Off
Option Explicit On

Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization

'
'This source code was auto-generated by Microsoft.VSDesigner, Version 1.1.4322.573.
'
Namespace com.matlus.webservices

'<remarks/>
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Web.Services.WebServiceBindingAttribute(Name:="IEmailServicebinding", [Namespace]:="http://www.borland.com/soapServices/")> _
Public Class IEmailServiceservice
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol

'<remarks/>
Public Sub New()
MyBase.New
Me.Url = "http://webservices.matlus.com/scripts/emailwebservice.dll/soap/IEmailservice"
End Sub

'<remarks/>
<System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:EmailIPortTypeInft-IEmailService#SendMail", RequestNamespace:="urn:EmailIPortTypeInft-IEmailService", ResponseNamespace:="urn:EmailIPortTypeInft-IEmailService")> _
Public Function SendMail(ByVal ToAddress As String, ByVal FromAddress As String, ByVal ASubject As String, ByVal MsgBody As String) As <System.Xml.Serialization.SoapElementAttribute("return")> Integer
Dim results() As Object = Me.Invoke("SendMail", New Object() {ToAddress, FromAddress, ASubject, MsgBody})
Return CType(results(0),Integer)
End Function

'<remarks/>
Public Function BeginSendMail(ByVal ToAddress As String, ByVal FromAddress As String, ByVal ASubject As String, ByVal MsgBody As String, ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
Return Me.BeginInvoke("SendMail", New Object() {ToAddress, FromAddress, ASubject, MsgBody}, callback, asyncState)
End Function

'<remarks/>
Public Function EndSendMail(ByVal asyncResult As System.IAsyncResult) As Integer
Dim results() As Object = Me.EndInvoke(asyncResult)
Return CType(results(0),Integer)
End Function
End Class
End Namespace


in the send button u type:
Dim Mail As New com.matlus.webservices.IEmailServiceservice
If Mail.SendMail(To_Ad.Text, From_ad.Text, Subject_Ad.Text, Message.Text) = 0 Then
End If


how do i add a proxy to this and where would i put the code somethin like:

Dim proxyObject As New WebProxy("http://proxyserver:80/", True)
Dim req As WebRequest = WebRequest.Create("http://www.contoso.com")
req.Proxy = proxyObject


if u can tell me how plz do so or reply wit my code wit the proxy addition in there and ill understand from there any help would be great thanx

k4rt
July 16th, 2005, 09:46 AM
if any1 knows what do to please reply