Click to See Complete Forum and Search --> : Creating Proxy class of a web service with DIME


allala
November 1st, 2005, 06:22 PM
Hi all
Pls read the following scenario what i have done.

1) created a sample web service called DimeService.asmx
here is the code for the web service
----------------------------
Imports System.Web.Services
Imports Microsoft.Web.Services2.Dime
Imports Microsoft.Web.Services2
Imports System.Net

<System.Web.Services.WebService(Namespace:="http://tempuri.org/MyDimeTest/Service1")> _
Public Class DimeService
Inherits System.Web.Services.WebService

#Region " Web Services Designer Generated Code "

Public Sub New()
MyBase.New()

'This call is required by the Web Services Designer.
InitializeComponent()

'Add your own initialization code after the InitializeComponent() call

End Sub

'Required by the Web Services Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Web Services Designer
'It can be modified using the Web Services Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
'CODEGEN: This procedure is required by the Web Services Designer
'Do not modify it using the code editor.
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

#End Region


<WebMethod()> _
Public Sub CreateDimedZip()
Dim respContext As SoapContext
respContext = ResponseSoapContext.Current
Dim dimeAttach As New DimeAttachment("zip", TypeFormat.MediaType, "C:\abc.zip")
respContext.Attachments.Add(dimeAttach)
End Sub

End Class
----------------------------------------------------------
the basic idea of the service is to attach a zip file to the soap message using DIME. I set the "WSE Settings 2.0" for this project and this works fine.
I even created a client application that consumes this web service by adding the web reference to download the zip file by calling the method "objProxy.ResponseSoapContext.Attachments(0).Stream". That is all fine.

but my problem is:
Instead of creating the client application by adding the Web Reference, i want to create a proxy class using wsdl.exe and by creating the object of that class, i want to download the zip file.

Command i used to create the proxy class:
wsdl /language:VB /out:DimeProxyClass.vb http://localhost/MyDimeTest/DimeService.asmx?WSDL

But when i create the object of the proxy class in my client application, i don't see the member ResponseSoapContext, to download the zip file.

Can anybody help me out where im doing wrong?

Thanks in advance.