Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / February 2005

Tip: Looking for answers? Try searching our database.

WseWSDL2

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chakra - 27 Feb 2005 06:46 GMT
1) I made a rather simple WSE enabled hello world web service and a WSE
enabled windows consumer.

2)Appendix A is the proxy file when i added the service web reference to the
windows application .

3) Appendix B is the proxy file created by the console command "wseWsdl2.exe
http://localhost/Webservice2/service1.asmx?WSDL myProxy.cs".

4) Why is there so much difference between the two ?

Regards,

Chak.

Appendix A:-

//--------------------------------------------------------------------------
----
// <autogenerated>

// This code was generatedby a tool.

// Runtime Version: 1.1.4322.573

//

// Changes to this file may cause incorrect behavior and will be lost if

// the code is regenerated.

// </autogenerated>

//--------------------------------------------------------------------------
----

//

// This source code was auto-generated by Microsoft.VSDesigner, Version
1.1.4322.573.

//

namespace WindowsApplication1.HelloWorld {

using System.Diagnostics;

using System.Xml.Serialization;

using System;

using System.Web.Services.Protocols;

using System.ComponentModel;

using System.Web.Services;

/// <remarks/>

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.ComponentModel.DesignerCategoryAttribute("code")]

[System.Web.Services.WebServiceBindingAttribute(Name="Service1Soap",
Namespace="http://tempuri.org/")]

public class Service1Wse : Microsoft.Web.Services2.WebServicesClientProtocol
{

/// <remarks/>

public Service1Wse() {

this.Url = "http://localhost/WebService2/Service1.asmx";

}

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.o
rg/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]));

}

}

/// <remarks/>

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.ComponentModel.DesignerCategoryAttribute("code")]

[System.Web.Services.WebServiceBindingAttribute(Name="Service1Soap",
Namespace="http://tempuri.org/")]

public class Service1 : System.Web.Services.Protocols.SoapHttpClientProtocol
{

/// <remarks/>

public Service1() {

this.Url = "http://localhost/WebService2/Service1.asmx";

}

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.o
rg/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]));

}

}

}

Appendix B:-

-------------------

//--------------------------------------------------------------------------
----

// <autogenerated>

// This code was generated by a tool.

// Runtime Version: 1.1.4322.573

//

// Changes to this file may cause incorrect behavior and will be lost if

// the code is regenerated.

// </autogenerated>

//--------------------------------------------------------------------------
----

//

// InfoVersionComment, WseWsdl2, Version=2.0.2.0, Culture=neutral,
PublicKeyToken=26ba029e599ec4f8, RunTime Version: 1.1.4322.573

//

using System;

using System.Xml;

using Microsoft.Web.Services2;

using Microsoft.Web.Services2.Addressing;

using Microsoft.Web.Services2.Messaging;

using System.Xml.Serialization;

/// <remarks/>

[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]

[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.org/",
IsNullable=false)]

public class HelloWorld {

}

/// <remarks/>

[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]

[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.org/",
IsNullable=false)]

public class HelloWorldResponse {

/// <remarks/>

public string HelloWorldResult;

}

[SoapService("http://tempuri.org/")]

public class Service1 : SoapClient

{

public Service1() : base( new
Uri("http://localhost/webservice2/service1.asmx") )

{

}

[SoapMethod("http://tempuri.org/HelloWorld")]

public HelloWorldResponse HelloWorld( HelloWorld request )

{

return (HelloWorldResponse)base.SendRequestResponse("HelloWorld",
request).GetBodyObject( typeof(HelloWorldResponse),
SoapServiceAttribute.TargetNamespace);

}

public IAsyncResult BeginHelloWorld( HelloWorld request,
System.AsyncCallback callback, object asyncState)

{

return base.BeginSendRequestResponse("HelloWorld", request, callback,
asyncState);

}

public HelloWorldResponse EndHelloWorld( System.IAsyncResult asyncResult )

{

return
(HelloWorldResponse)base.EndSendRequestResponse(asyncResult).GetBodyObject(
typeof(HelloWorldResponse), SoapServiceAttribute.TargetNamespace);

}

}
Keenan Newton - 27 Feb 2005 19:14 GMT
First the WSDl generated in VS 2003 came out with VS 2003.
WseWsdl2.exe came out around the beginning of last summer/late spring.
So I would expect some improvements, secondly they were developed to my
knowledge by two different teams.  Its ok that they are different,
they work... for the most part right?  You can also tell there will be
differences by looking at the using statements.
Chakra - 28 Feb 2005 06:15 GMT
The output from wsewsdl2 does not work because it does not even have a
namespace, and no class with the WSE suffix, which is what the client code
is expecting (when it is compiled in VS.NET at the development stage).

> First the WSDl generated in VS 2003 came out with VS 2003.
> WseWsdl2.exe came out around the beginning of last summer/late spring.
> So I would expect some improvements, secondly they were developed to my
> knowledge by two different teams.  Its ok that they are different,
> they work... for the most part right?  You can also tell there will be
> differences by looking at the using statements.
Chakra - 28 Feb 2005 06:31 GMT
How do i know they both will do the same thing ?

> The output from wsewsdl2 does not work because it does not even have a
> namespace, and no class with the WSE suffix, which is what the client code
[quoted text clipped - 6 lines]
> > they work... for the most part right?  You can also tell there will be
> > differences by looking at the using statements.
Keenan Newton - 28 Feb 2005 15:41 GMT
I am assuming your trying to use a web service proxy generated from VS
2003.  I think if you use wseWsdl2.exe to generate the wsdl, and
regenerate your web service rpoxy.  That should work.  Assuming I am
understanding your question correctly
Dilip Krishnan - 28 Feb 2005 15:38 GMT
Well, they are different because the underlying plumbing is different.
wsewsdl2 generates a SoapClient derived class whereas wsdl.exe generates
a WebServicesClientProtocol derived class. So you cannot really compare them

> The output from wsewsdl2 does not work because it does not even have a
> namespace, and no class with the WSE suffix, which is what the client code
[quoted text clipped - 6 lines]
>>they work... for the most part right?  You can also tell there will be
>>differences by looking at the using statements.

Signature

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

Softwaremaker - 28 Feb 2005 22:06 GMT
Hi,

I am not exactly sure what you mean from here. Here are my thoughts. The
proxy stub generators for WSE (WSEWSDL2) is mainly different because it
generates an extra class for you that inherits from
WebServicesClientProtocol. This is the one with the wse suffix. This base
class will let you have access to the relative SOAP Message Context so you
can apply filters and do other wonders with it. WSE also makes use of this
to apply its own filters and serializing out WS-Addressing Headers,
WS-Security headers , etc...onto the message before it goes out to the wire.

hth.
Signature

Thank you.

Regards,
William T (Softwaremaker)
http://www.softwaremaker.net/blog
=========================================

> 1) I made a rather simple WSE enabled hello world web service and a WSE
> enabled windows consumer.
[quoted text clipped - 12 lines]
>
> Appendix A:-

//--------------------------------------------------------------------------
> ----
> // <autogenerated>
[quoted text clipped - 10 lines]
>
> // </autogenerated>

//--------------------------------------------------------------------------
> ----
>
[quoted text clipped - 40 lines]
>
> /// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.o
> rg/HelloWorld", RequestNamespace="http://tempuri.org/",
> ResponseNamespace="http://tempuri.org/",
[quoted text clipped - 51 lines]
>
> /// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.o
> rg/HelloWorld", RequestNamespace="http://tempuri.org/",
> ResponseNamespace="http://tempuri.org/",
[quoted text clipped - 35 lines]
>
> -------------------

//--------------------------------------------------------------------------
> ----
>
[quoted text clipped - 11 lines]
>
> // </autogenerated>

//--------------------------------------------------------------------------
> ----
>
[quoted text clipped - 18 lines]
>
> /// <remarks/>

[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]

[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.org/",
> IsNullable=false)]
>
[quoted text clipped - 3 lines]
>
> /// <remarks/>

[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]

[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.org/",
> IsNullable=false)]
>
[quoted text clipped - 46 lines]
>
> return

(HelloWorldResponse)base.EndSendRequestResponse(asyncResult).GetBodyObject(
> typeof(HelloWorldResponse), SoapServiceAttribute.TargetNamespace);
>
> }
>
> }

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.