This message was discovered on ASPFriends.com 'aspngxml' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| Dennis West (VIP) |
I am at this point now with this error occuring
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: CS0246: The type or namespace name 'BabelFish' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 9: using System.Web.UI.WebControls; Line 10: using System.Web.UI.HtmlControls; Line 11: using BabelFish.BabelFishWebServiceProxy; Line 12: Line 13: namespace BabelFishService
Source File: D:\Domains\aspalliance.com\dotnetsolutions\BabelFish.aspx.cs Line: 11
--------------------------------------------------------------------------------
My BabelFish.aspx page
%@ Page language="c#" Src="BabelFish.aspx.cs" Codebehind="BabelFish.aspx.cs" AutoEventWireup="false" Inherits="BabelFishService.BabelFishServiceClient" %>
........... plus
--------------------------------------------------------------------------------
My BabelFish.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using BabelFish.BabelFishWebServiceProxy;
namespace BabelFishService
{
/// <summary>
/// Summary description for BabelFish.
/// </summary>
public class BabelFishServiceClient : System.Web.UI.Page {
protected System.Web.UI.WebControls.DropDownList ddTranslationMode;
protected System.Web.UI.WebControls.TextBox txtText;
protected System.Web.UI.WebControls.Label lblTranslation;
protected System.Web.UI.WebControls.Button submitButton;
public BabelFishServiceClient() {
Page.Init += new System.EventHandler(Page_Init);
}
private void Page_Load(object sender, System.EventArgs e) {
}
private void Page_Init(object sender, EventArgs e) {
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
}
#region Web Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.submitButton.Click += new System.EventHandler(this.submitButton_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void submitButton_Click(object sender, System.EventArgs e) {
string translationMode = this.ddTranslationMode.SelectedItem.Value;
string translationText = this.txtText.Text.Trim();
string translation = "";
try {
BabelFishProxy bfp = new BabelFishProxy();
translation = bfp.BabelFish(translationMode,translationText);
}
catch (Exception exp) {
translation = "There was an error accessing the server: " + exp.Message;
}
this.lblTranslation.Text = translation;
}
}
}
--------------------------------------------------------------------------------
My BabelFishService.cs
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.0.2914.16
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------
namespace BabelFish.BabelFishWebServiceProxy {
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.Web.Services;
[System.Web.Services.WebServiceBindingAttribute(Name="BabelFishBinding", Namespace="http://www.xmethods.net/sd/BabelFishService.wsdl")]
public class BabelFishProxy : System.Web.Services.Protocols.SoapHttpClientProtocol {
[System.Diagnostics.DebuggerStepThroughAttribute()]
public BabelFishProxy() {
this.Url = "http://services.xmethods.net:80/perl/soaplite.cgi";
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmethodsBabelFish#BabelFish", RequestNamespace="urn:xmethodsBabelFish", ResponseNamespace="urn:xmethodsBabelFish")]
[return: System.Xml.Serialization.SoapElementAttribute("return")]
public string BabelFish(string translationmode, string sourcedata) {
object[] results = this.Invoke("BabelFish", new object[] {
translationmode,
sourcedata});
return ((string)(results[0]));
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
public System.IAsyncResult BeginBabelFish(string translationmode, string sourcedata, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("BabelFish", new object[] {
translationmode,
sourcedata}, callback, asyncState);
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
public string EndBabelFish(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
}
}
Dennis H. West West Design dotnetDeveloper http://www.aspalliance.com/dotnetsolutions Click here to reveal e-mail address
|
|
| |
| |
| Mitch Denny (VIP) |
Dennis,
Ensure that you are compiling in the BabelFishServer.cs file from Dan's sample code into the mix.
You are using VS.NET right? Just drag and drop ALL of the files from Dan's download into your VS.NET project and you should be up and away.
---------------------------------------- - Mitch Denny - http://www.warbyte.com - Click here to reveal e-mail address - +61 (414) 610-141 -
-----Original Message----- From: Dennis West [mailto:Click here to reveal e-mail address] Sent: Friday, 16 November 2001 3:13 AM To: aspngxml Subject: [aspngxml] Nedd Help On trying to get BabelFish web service to run
I am at this point now with this error occuring
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: CS0246: The type or namespace name 'BabelFish' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 9: using System.Web.UI.WebControls; Line 10: using System.Web.UI.HtmlControls; Line 11: using BabelFish.BabelFishWebServiceProxy; Line 12: Line 13: namespace BabelFishService
Source File: D:\Domains\aspalliance.com\dotnetsolutions\BabelFish.aspx.cs Line: 11
My BabelFish.aspx page
%@ Page language="c#" Src="BabelFish.aspx.cs" Codebehind="BabelFish.aspx.cs" AutoEventWireup="false" Inherits="BabelFishService.BabelFishServiceClient" %>
........... plus
My BabelFish.aspx.cs
using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using BabelFish.BabelFishWebServiceProxy; namespace BabelFishService { /// <summary> /// Summary description for BabelFish. /// </summary> public class BabelFishServiceClient : System.Web.UI.Page { protected System.Web.UI.WebControls.DropDownList ddTranslationMode; protected System.Web.UI.WebControls.TextBox txtText; protected System.Web.UI.WebControls.Label lblTranslation; protected System.Web.UI.WebControls.Button submitButton; public BabelFishServiceClient() { Page.Init += new System.EventHandler(Page_Init); } private void Page_Load(object sender, System.EventArgs e) { } private void Page_Init(object sender, EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); } #region Web Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.submitButton.Click += new System.EventHandler(this.submitButton_Click); this.Load += new System.EventHandler(this.Page_Load); } #endregion private void submitButton_Click(object sender, System.EventArgs e) { string translationMode = this.ddTranslationMode.SelectedItem.Value; string translationText = this.txtText.Text.Trim(); string translation = ""; try { BabelFishProxy bfp = new BabelFishProxy(); translation = bfp.BabelFish(translationMode,translationText); } catch (Exception exp) { translation = "There was an error accessing the server: " + exp.Message; } this.lblTranslation.Text = translation; } } }
My BabelFishService.cs //---------------------------------------------------------------------- -------- // <autogenerated> // This code was generated by a tool. // Runtime Version: 1.0.2914.16 // // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // </autogenerated> //---------------------------------------------------------------------- -------- namespace BabelFish.BabelFishWebServiceProxy { using System.Diagnostics; using System.Xml.Serialization; using System; using System.Web.Services.Protocols; using System.Web.Services; [System.Web.Services.WebServiceBindingAttribute(Name="BabelFishBinding", Namespace="http://www.xmethods.net/sd/BabelFishService.wsdl")] public class BabelFishProxy : System.Web.Services.Protocols.SoapHttpClientProtocol { [System.Diagnostics.DebuggerStepThroughAttribute()] public BabelFishProxy() { this.Url = "http://services.xmethods.net:80/perl/soaplite.cgi"; } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmethodsBabel Fish#BabelFish", RequestNamespace="urn:xmethodsBabelFish", ResponseNamespace="urn:xmethodsBabelFish")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public string BabelFish(string translationmode, string sourcedata) { object[] results = this.Invoke("BabelFish", new object[] { translationmode, sourcedata}); return ((string)(results[0])); } [System.Diagnostics.DebuggerStepThroughAttribute()] public System.IAsyncResult BeginBabelFish(string translationmode, string sourcedata, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("BabelFish", new object[] { translationmode, sourcedata}, callback, asyncState); } [System.Diagnostics.DebuggerStepThroughAttribute()] public string EndBabelFish(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } } } Dennis H. West West Design dotnetDeveloper http://www.aspalliance.com/dotnetsolutions Click here to reveal e-mail address
| [aspngxml] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT | http://www.asplists.com/search = SEARCH Archives
|
|
| |
|
| |
| Dennis West (VIP) |
Not true Mitch I have done that from the Start... I think I have something that gone wrong with my VS.NET Any way It will not do the Job It only works fro about 50 Chars even when I exercise the demo from steves wdsl.
----- Original Message ----- From: "Mitch Denny" <Click here to reveal e-mail address> To: "aspngxml" <Click here to reveal e-mail address> Sent: Sunday, November 18, 2001 3:57 AM Subject: [aspngxml] RE: Nedd Help On trying to get BabelFish web service to run
[Original message clipped]
|
|
| |
|
|
|
|
|