Results 1 to 2 of 2

Thread: problem in consuming web service

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Tokyo, Japan
    Posts
    72

    Question problem in consuming web service

    Hello

    I have created one web service named SampleService.asmx.
    ClassName is public class SecurityWebService : WebService
    One method is made public as follows
    public SecurityInfo GetSecurityInfo (string code)
    And created dll of this webservice.

    Now trying to use this dll in some aspx page as follows.

    <%@ Page Language="VB" %>
    <%@ import Namespace="SampleServiceVB" %>
    <script runat="server">
    dim objPrice as new SecurityWebService
    Sub Button1_Click(sender As Object, e As EventArgs)
    TextBox2.text = objPrice.GetSecurityInfo(TextBox1.text)
    End Sub
    </script>

    But it is giving error as follows

    Compiler Error Message: BC30002: Type 'SecurityWebService' is not defined.

    I found following part on internet regarding path of dll file.

    From this view, .NET has a revolution change that a component, just as our proxy class, no long needs be registered, all we need to do is that we just simplly save the component under the bin/, and .NET will automatically find it.

    What is the significance of bin directory ? Where should it be ? Or is there any other reason of this error ?

    Best Regards
    Mahesh
    Everybody is always learning something new !

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    1) In the project that will consume the web service, open it up, right-click the project in the Solution Explorer, Add a Web Reference... browse to the web service's dll, click Add, ok...
    i believe this is the part you missed

    2) Now, in your code-behind, you can simply put
    VB Code:
    1. Imports SampleServiceVB

    Then you should be able to write :
    VB Code:
    1. Dim MyWebServ As New SecurityWebService

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width