This message was discovered on ASPFriends.com 'aspngfreeforall' 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) |
----- Original Message ----- From: Dennis West To: aspngxml Sent: Thursday, November 15, 2001 8:13 AM Subject: 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: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
|
|
| |
| |
| Alex Lowe |
Dennis,
You are trying to compile the client or consumer of the BabelFish web service. In order for the client to compile you must create/compile a proxy class. For information on how and why this is done I suggest you read (http://dotnetjunkies.com/tutorials.aspx?tutorialid=190).
Alex - AspFriends.com Moderation Team
ASP.NET Resource Site: http://aspalliance.com/aldotnet Grand Rapids, MI ASP.NET User Group: http://www.asp-grandrapids.net
-----Original Message----- From: Dennis West [mailto:Click here to reveal e-mail address] Sent: Thursday, November 15, 2001 3:06 PM To: aspngfreeforall Subject: [aspngfreeforall] Fw:Compiler Error Message: Need Help On trying to get BabelFish web service to run
----- Original Message ----- From: Dennis West To: aspngxml Sent: Thursday, November 15, 2001 8:13 AM Subject: 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
| ASP.net DOCS = http://www.aspng.com/docs | [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/aspngfreeforall = JOIN/QUIT | news://ls.asplists.com = NEWSGROUP
|
|
| |
|
| |
| Dennis West (VIP) |
In the download package I received a BabelFishService.wsdl file and have included it in my application I have done a build and browse on it and it does exec.
I am also using VS.NET due I need to rebuild the proxy... their was no instructions on how to use the or build the app..I assumed it was ready to go...But also suspect that something is different using VS.NET directly connected and compile on my remote server.
had to get this off to ..
Back to reading your article on the subject.. thanks..
----- Original Message ----- From: "Alex Lowe" <Click here to reveal e-mail address> To: "aspngfreeforall" <Click here to reveal e-mail address> Sent: Thursday, November 15, 2001 10:13 AM Subject: [aspngfreeforall] RE: Fw:Compiler Error Message: Need Help On trying to get BabelFish web service to run
[Original message clipped]
|
|
| |
|
| |
| Dennis West (VIP) |
I do have a proxie file inclued in the download
//-------------------------------------------------------------------------- ----
// <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]));
}
}
}
----- Original Message ----- From: "Alex Lowe" <Click here to reveal e-mail address> To: "aspngfreeforall" <Click here to reveal e-mail address> Sent: Thursday, November 15, 2001 10:13 AM Subject: [aspngfreeforall] RE: Fw:Compiler Error Message: Need Help On trying to get BabelFish web service to run
[Original message clipped]
|
|
| |
|
|
|
|
|