p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 1.0 (http://p2p.wrox.com/forumdisplay.php?f=26)
-   -   Web Services Error (Ch18) - No Web Disc. Info. (http://p2p.wrox.com/showthread.php?t=20941)

ElPato November 7th, 2004 06:13 PM

Web Services Error (Ch18) - No Web Disc. Info.
In creating a proxy (p690) I am receiving the below error when I attempt to use the wsdl command to create the proxy. Any suggestions would be appreciated.



Error: There was an error processing 'http://localhost/BegASPNET/Ch18/ISBN.asmx?
  - The HTML document does not contain Web service discovery information.

************************************************** ***
The command I am using (all on one line) is as below:
************************************************** ***
wsdl /l:vb /o:ISBNProxy.vb http://localhost/BegASPNET/Ch18/ISBN.asmx?WSDL /n:ISBNService

************************************************** ***
ISBN.asmx is copied in below (as in the book - but just in case)********************************************* ********
<%@ WebService Language="vb" Class="ISBN" %>
Imports System.Web.Services
Imports System.Data
Imports System.Data.OleDb

Public Class ISBN
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function BookDetail(ByVal strIsbn As String) As String
        Return GetBookDetails(strIsbn)
    End Function

    Private Function GetBookDetails(ByVal strIsbn As String) As String
        Dim objLibraryDR As OleDbDataReader
        Dim objLibraryConn As OleDbConnection
        Dim objLibraryCmd As OleDbCommand
        Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Library.mdb") & ";"
        Dim strSQL As String = "select Title from Books where ISBN = '" & strIsbn & "'"
        Dim strBookTitle As String

        objLibraryConn = New OleDbConnection(strConn)
        objLibraryCmd = New OleDbCommand(strSQL, objLibraryConn)

        objLibraryDR = objLibraryCmd.ExecuteReader(CommandBehavior.CloseC onnection)
        If objLibraryDR.Read() Then
            strBookTitle = objLibraryDR(0)
            strBookTitle = "Book not found in the database"
        End If

        Return strBookTitle
    End Function

End Class

charul_shukla January 29th, 2005 03:33 AM


I have tested the code you are referring and got it work after some changes. Please follow the instructions below:

Instructions to follow for Web Matrix..

Open ISBN.asmx in web matrix and run the file using web matrix inbuilt web server, in web browsers you will see something similar to “http://localhost:8080/isbn.asmx”. Copy this URL to somewhere for later use.

Now Generate the proxy Class for this web service by using “Web Service Proxy Generator” found in “Tools #61664; Web Service Proxy Generator”. On clicking this option a dialog box will appear.

In “XML Web Service Proxy Generator” dialog box fill the information as follows:

WSDL URL = “http://localhost:8080/isbn.asmx”

Namespace = ISBNService

Output Directory = C:\BegASPNET11\ch16

Source File = ISBNProxy

Generate Assembly = ISBNProxy.dll

Click on Generate. This will generate the source file named “ISBNProxy.vb” in the output directory and assembly named “ISBNProxy.dll” in the folder named bin under the output directory.

After process completion a confirmation message box will appear, click “OK” and then click “cancel” to get out of the “XML Web Service Proxy Generator” dialog box.

Now Open the aspx file named “BookInfo.aspx” and click on the “start” icon on the toolbar to run this file using the web matrix web server.

If all the instructions followed, you will see the result in web browser successfully.

Charul Shukla

TJA April 13th, 2005 03:27 PM

OK but what about this error? the Proxy create worked fine.
I am using the samples from the download. moved to this DIR c:\inetpub\wwwroot\isbn
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30002: Type 'ISBNService.ISBN' is not defined.

Source Error:

Line 4: <script language="vb" runat="server">
Line 5: Private Sub RetrieveBook(ByVal sender As System.Object, ByVal e As System.EventArgs)
Line 6: Dim ws As New ISBNService.ISBN()
Line 7: lblBookTitle.Text = ws.BookDetail(txtISBN.Text)
Line 8: End Sub

Source File: c:\inetpub\wwwroot\isbn\bookinfo.aspx Line: 6

All times are GMT -4. The time now is 08:22 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.