FIX: WSDL Tool Cannot Generate Web Service Proxies in Visual J# .NET (815258)
The information in this article applies to:
- Microsoft Visual J# .NET Redistributable Package 1.0
SYMPTOMSWhen you use the Wsdl.exe tool (WSDL) to generate a Web service proxy
in a specific language by using the /l or /language switch, you cannot
specify the language for Microsoft Visual J# .NET. The language option permits you to
specify CS for Microsoft Visual C# .NET, VB for Microsoft Visual Basic .NET, and JS for
Microsoft JScript .NET. However, no value is available for Visual J# .NET. Therefore, you cannot
generate the proxy file in Visual J# .NET.WORKAROUNDTo work around this problem in Microsoft Visual Studio .NET 2002, you
can generate the proxy for JScript .NET, and then manually change the proxy file to make the classes compile by using the Visual J# .NET complier. For the default HelloWorld Web service, you must make the following changes in
the JScript .NET proxy to convert it to a JSharp .NET proxy:
- Remove the following line in the class header:
//@cc_on
//@set @debug(off) - Change the Import statements. For example, replace
import System; with the following code:import System.*; - Change the Attribute of class and methods. For
example, replace
/// <remarks/>
public System.Diagnostics.DebuggerStepThroughAttribute() System.ComponentModel.DesignerCategoryAttribute("code") System.Web.Services.WebServiceBindingAttribute(Name="Service1Soap", Namespace="http://tempuri.org/") with the following code:/** <remarks/> */
/** @attribute
System.Diagnostics.DebuggerStepThroughAttribute()*/
/** @attribute
System.ComponentModel.DesignerCategoryAttribute("code")*/
/** @attribute
System.Web.Services.WebServiceBindingAttribute(Name="Service1Soap", Namespace="http://tempuri.org/")*/ - Add the public keyword before the class name as follows.
public class Service1 - In the constructor setting, change the URL. For
example, replace
this.Url = "http://localhost/WebService/Service1.asmx"; with the following code:this.set_Url("http://localhost/WebService/Service1.asmx"); - Change the syntax of the method signature and the variable declaration to JSharp .NET style.
The following code describes a generated proxy in JScript
.NET and the corresponding JSharp .NET version after manual changes: JScript .NET Code//@cc_on
//@set @debug(off)
import System.Diagnostics;
import System.Xml.Serialization;
import System;
import System.Web.Services.Protocols;
import System.ComponentModel;
import System.Web.Services;
//
// This source code was auto-generated by wsdl, Version=1.0.3705.0.
//
/// <remarks/>
public System.Diagnostics.DebuggerStepThroughAttribute() System.ComponentModel.DesignerCategoryAttribute("code") System.Web.Services.WebServiceBindingAttribute(Name="Service1Soap", Namespace="http://tempuri.org/")
class Service1 extends System.Web.Services.Protocols.SoapHttpClientProtocol {
/// <remarks/>
public function Service1() {
this.Url = "http://localhost/WebService1/Service1.asmx";
}
/// <remarks/>
public final System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/HelloWorld", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped) function HelloWorld() : System.String {
var results : System.Object[] = this.Invoke("HelloWorld", new System.Object[0]);
return System.String(results[0]);
}
/// <remarks/>
public final function BeginHelloWorld(callback : System.AsyncCallback, asyncState : System.Object) : System.IAsyncResult {
return this.BeginInvoke("HelloWorld", new System.Object[0], callback, asyncState);
}
/// <remarks/>
public final function EndHelloWorld(asyncResult : System.IAsyncResult) : System.String {
var results : System.Object[] = this.EndInvoke(asyncResult);
return System.String(results[0]);
}
}
JSharp .NET Codeimport System.Diagnostics.*;
import System.Xml.Serialization.*;
import System.*;
import System.Web.Services.Protocols.*;
import System.ComponentModel.*;
import System.Web.Services.*;
//
// This source code was auto-generated by wsdl,
Version=1.0.3705.0.
//
/** <remarks/> */
/** @attribute
System.Diagnostics.DebuggerStepThroughAttribute()*/
/** @attribute
System.ComponentModel.DesignerCategoryAttribute("code")*/
/** @attribute
System.Web.Services.WebServiceBindingAttribute(Name="Service1Soa
p", Namespace="http://tempuri.org/")*/
public class Service1 extends
System.Web.Services.Protocols.SoapHttpClientProtocol {
/** <remarks/> */
public Service1() {
this.set_Url("http://localhost/WebService1/Service1.asmx");
}
/** <remarks/> */
/** @attribute
System.Web.Services.Protocols.SoapDocumentMethodAttribute("http:
//tempuri.org/HelloWorld",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.
Wrapped)*/
public String HelloWorld() {
Object[] results = this.Invoke("HelloWorld", new
Object[0]);
return ((String)(results[0]));
}
/** <remarks/> */
public System.IAsyncResult
BeginHelloWorld(System.AsyncCallback callback, Object
asyncState) {
return this.BeginInvoke("HelloWorld", new Object[0],
callback, asyncState);
}
/** <remarks/> */
public String EndHelloWorld(System.IAsyncResult asyncResult)
{
Object[] results = this.EndInvoke(asyncResult);
return ((String)(results[0]));
}
}
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
This bug was corrected in Microsoft Visual Studio .NET version
2003.
Modification Type: | Major | Last Reviewed: | 4/18/2003 |
---|
Keywords: | kbBug kbfix kbWebServices kbWNet kbService kbCommandLine KB815258 kbAudDeveloper |
---|
|