OK I am brand new to .asmx creation and I am having a hell of a time figuring out to send a URL to .asmx file. The .asmx file is expecting to receive a parameter named givenURL.
The paremeter givenURL needs to be sent from Windows Forms.
I need to know how I go about doing this? Do I use SOAP or can I just send it using VB? I’ve been playing with this for 2 days now and it is really starting to get to me! Thanks in advance. Any help is appreciated.
<WebMethod(Description:="Creates PDF Using URL")> _
Public Function CreatePDF(ByVal givenURL As String) As Byte
Dim theDoc As New Doc
Dim theID = theDoc.AddImageUrl(givenURL, True, 0, True)
Do While True
theDoc.FrameRect()
If Not theDoc.Chainable(theID) Then
Exit Do
End If
theDoc.Page = theDoc.AddPage()
theID = theDoc.AddImageToChain(theID)
Loop
theDoc.SaveOptions.Linearize = True
Dim theData As Byte() = theDoc.GetData()
Return theData(0)
End Function
You will need to create a reference to your web service in your Windows forms application.
When you reference the web service, Visual Studio will generate a proxy class, abstracting away the complexity involved in generating the SOAP messages and enabling you to deal purely with the proxy object whilst communicating with your web service.
See: Create Simple Web Service in Visual Studio 2008 / 2010