2011-11-02 48 views
0

好吧,我是.asmx创建的全新内容,我有一段时间计划将URL发送到.asmx文件。 .asmx文件预计会收到一个名为givenURL的参数。发送WebBrowser控制URL ---> .asmx服务

给定的paremeterURL需要从Windows窗体发送。

我需要知道我如何去做这件事?我使用SOAP还是只能使用VB发送它?我已经玩了两天了,现在真的开始接近我了!提前致谢。任何帮助表示赞赏。

<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 

回答

1

您需要在Windows窗体应用程序中创建对Web服务的引用。

当您参考Web服务时,Visual Studio将生成一个代理类,将生成SOAP消息所涉及的复杂性抽象化,并使您能够在与Web服务进行通信时纯粹处理代理对象。

请参见:Create Simple Web Service in Visual Studio 2008/2010

+0

我已经,我只是不能似乎找到任何方式与我自己的脑袋做。我明天要回头看看我是否能用某种东西来突破。当我在添加引用之后尝试与Web服务交谈时,我所得到的大约是6个类。他们中没有一个似乎还没有任何意义。 – brmcdani44