467,888 Members | 1,387 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,888 developers. It's quick & easy.

Is it possible to have a web service name in localized string?

Is it possible to have a web service name in localized string. Let's say, can
I have a web service developed in C# having class name in Japanese?
I am trying to build a web service as follows

namespace Test2
{
/// <summary>
/// Summary description for Service1.
/// </summary>
public class セ : System.Web.Services.WebService
{
public セ()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}

#region Component Designer generated code

//Required by the Web Services Designer
private IContainer components = null;

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}

#endregion

// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the project
// To test this web service, press F5

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}
So, if you notice, I have a class name as "セ" which is some japanese
character.
When I try to run this application, I get the parsing error in my .asmx file
for classname in webservice directive.

Pl. let me know if it is possible. and if yes, how can I dploy such a web
service?

--
Regards
-Ajit
Nov 23 '05 #1
  • viewed: 1515
Share:
2 Replies
I don't think it is possible, nor would it be a good thing. The name of your
class will be used for the URL of your service, and URL don't like localized
characters (they are changed into %XX escaped sequences, where XX is in
hexa). I guess you will have to name your service "se" (your character is a
"se" in katakana, right ?)

Regards

François

"Ajit" wrote:
Is it possible to have a web service name in localized string. Let's say, can
I have a web service developed in C# having class name in Japanese?
I am trying to build a web service as follows

namespace Test2
{
/// <summary>
/// Summary description for Service1.
/// </summary>
public class セ : System.Web.Services.WebService
{
public セ()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}

#region Component Designer generated code

//Required by the Web Services Designer
private IContainer components = null;

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}

#endregion

// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the project
// To test this web service, press F5

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}
So, if you notice, I have a class name as "セ" which is some japanese
character.
When I try to run this application, I get the parsing error in my .asmx file
for classname in webservice directive.

Pl. let me know if it is possible. and if yes, how can I dploy such a web
service?

--
Regards
-Ajit

Nov 23 '05 #2
Thanks for the response and sorry for the late reply.:)
I am not sure about the character which I used, whether it is in katakana or
in something else, as I don't understand japanese. I just copied it from one
of the japanese web site and put it in my program to do certain testing.

Probably you are right as non-ascii characters get replaced by %XX escaped
sequences.

But when I developed a web service with web service name in japanese it
works fine.

I have another issue to resolve though. I have a web service with one of the
method's name is in Japanese.
Let's say "HelloWorldプ "

when I use IE directly to send the message to this web service, it shows to
me that it's SOAPAction is
SOAPAction: "http://tempuri.org/HelloWorld%E3%83%97"

but when I open the WSDL file for the same, I am getting SOAPAction for this
operation as "http://tempuri.org/HelloWorldプ"
So why does IE shows me SOAPAction in escaped sequence while WSDL file shows
me the japanese characters directly in SOAPAction?
--
Regards
-Ajit
"François Lemaire" wrote:
I don't think it is possible, nor would it be a good thing. The name of your
class will be used for the URL of your service, and URL don't like localized
characters (they are changed into %XX escaped sequences, where XX is in
hexa). I guess you will have to name your service "se" (your character is a
"se" in katakana, right ?)

Regards

François

"Ajit" wrote:
Is it possible to have a web service name in localized string. Let's say, can
I have a web service developed in C# having class name in Japanese?
I am trying to build a web service as follows

namespace Test2
{
/// <summary>
/// Summary description for Service1.
/// </summary>
public class セ : System.Web.Services.WebService
{
public セ()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}

#region Component Designer generated code

//Required by the Web Services Designer
private IContainer components = null;

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}

#endregion

// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the project
// To test this web service, press F5

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}
So, if you notice, I have a class name as "セ" which is some japanese
character.
When I try to run this application, I get the parsing error in my .asmx file
for classname in webservice directive.

Pl. let me know if it is possible. and if yes, how can I dploy such a web
service?

--
Regards
-Ajit

Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Hardy Wang | last post: by
1 post views Thread by GeorgeB | last post: by
3 posts views Thread by Jeremy Chapman | last post: by
6 posts views Thread by =?Utf-8?B?THVib21pcg==?= | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.