RequestSoapContext is not a member of MyWebService

S

stephg

Hi,

I try to send an attachment to a web service.
WSE 2 SP1 is installed.
The web service compiles successfully.
When creating the client, and I want attach the file to the proxy class like
==
Dim attachIt As New Auction
Dim attachmentToWs As New DimeAttachment("PDF", TypeFormat.MediaType,
Me.fileUpload.PostedFile.InputStream)
attachIt.RequestSoapContext.Attachments.Add(attachmentToWs)
==
I get the error RequestSoapContext is not a member of Auction.

Any ideas what I am doing wrong?
 
T

Trebek

You have to add an assembly ref to Microsoft.Web.Services
and alter your proxy class to derive from

Microsoft.Web.Services.WebServicesClientProtocol.

This is a part of WSE2.0 and the wsdl generator doesn't use
Microsoft.Web.Services by default. It uses System.Web.Services
WebClientProtocol.

HTH,



Alex
 
S

stephg

Thanks a lot Alex. That's been it.
So step by step what I did to resolve it:
1. generate the proxy class using wsdl.exe tool
2. edit the resulting vb or cs file and change the line
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
to
Inherits Microsoft.Web.Services2.WebServicesClientProtocol
3. to compile the proxy class add the reference like
vbc /out:Auction.dll /t:library
/r:System.dll,System.XML.dll,Microsoft.Web.Services2.dll,System.Web.Services.dll Auction.vb
4. Copy the file into the clients bin directory and refernce it in the
project.

Thnks again to Alex
steph
 
T

Trebek

Yup ... that'll do just fine.

Alex

stephg said:
Thanks a lot Alex. That's been it.
So step by step what I did to resolve it:
1. generate the proxy class using wsdl.exe tool
2. edit the resulting vb or cs file and change the line
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
to
Inherits Microsoft.Web.Services2.WebServicesClientProtocol
3. to compile the proxy class add the reference like
vbc /out:Auction.dll /t:library
/r:System.dll,System.XML.dll,Microsoft.Web.Services2.dll,System.Web.Services
..dll Auction.vb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top