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 / January 2006

Tip: Looking for answers? Try searching our database.

WSE2 to WSE3, what to do with the pipeline ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DaveP - 11 Jan 2006 09:35 GMT
Hi,

I'm converting an app from WSE2 to WSE3. The WSE2 app contains the following
code for 4 different Web services;

service.Pipeline.OutputFilters.Add(OutputFilter);
service.Pipeline.InputFilters.Add(InputFilter);

There is no service.Pipeline in WSE3. I've seen some info that says I should
use a Policy Assertion. But is there a tutorial that will help me re-wrte
this code ?

Signature

Regards

DaveP
UK

Pablo Cibraro - 11 Jan 2006 14:56 GMT
Hi Dave,
I have written something regarding this topic in my weblog.

http://weblogs.asp.net/cibrax/archive/2005/07/19/419921.aspx

I hope this can help you.

Regards,
Pablo Cibraro
http://weblogs.asp.net/cibrax
http://www.lagash.com

> Hi,
>
[quoted text clipped - 9 lines]
> use a Policy Assertion. But is there a tutorial that will help me re-wrte
> this code ?
DaveP - 11 Jan 2006 17:11 GMT
Pablo, I have a problem. I can't find the proxy class !

My application is in VS2005, with the WSE3 tool and WSE3 turned on. When I
want to create a proxy I do Add WebReference, then put in the WSDL, say
http://localhost/EchService.asmx?WSDL. I call it es

Then in my app I can say

es.EchoService myService = new es.EchoService();

But I can't find the proxy code. Also, I can't use SetPolicy as this does
not appear as a property of myService. It looks like my WSE3 implementation
isnt complete. Can you suggest anything ?
of myService
Signature

Regards

DaveP
UK

> Hi Dave,
> I have written something regarding this topic in my weblog.
[quoted text clipped - 21 lines]
> > use a Policy Assertion. But is there a tutorial that will help me re-wrte
> > this code ?
DaveP - 11 Jan 2006 17:21 GMT
I just get

EchService.discomap and EchoService.wsdl

how to I get the proxy class source code ?
Signature

Regards

DaveP
UK

> Pablo, I have a problem. I can't find the proxy class !
>
[quoted text clipped - 36 lines]
> > > use a Policy Assertion. But is there a tutorial that will help me re-wrte
> > > this code ?
Pablo Cibraro - 11 Jan 2006 18:18 GMT
Hi Dave,
Yes, that's a problem. ASP.NET automatically creates the proxies for the web
services. You will able to find two proxies for your service:

1. es.EchoService
2. es.EchoServiceWse (This is the proxy for WSE)

It will be better if you create the proxy class using the tool WSEWsdl3.exe

Regards,
Pablo Cibraro
http://weblogs.asp.net/cibrax
http://www.lagash.com

>I just get
>
[quoted text clipped - 45 lines]
>> > > re-wrte
>> > > this code ?
DaveP - 11 Jan 2006 18:41 GMT
So presumably this is a bug in VS2005 ? Not having access to a proxy a class
is a big problem isn't it ?
Signature

Regards

DaveP
UK

> Hi Dave,
> Yes, that's a problem. ASP.NET automatically creates the proxies for the web
[quoted text clipped - 59 lines]
> >> > > re-wrte
> >> > > this code ?
Pablo Cibraro - 12 Jan 2006 13:28 GMT
Hi DaveP,
That strange, you should have access to a class EchoServiceWse. Have you
enabled WSE on that ASP.NET application ?.

Regards,
Pablo Cibraro
http://weblogs.asp.net/cibrax
http://www.lagash.com

> So presumably this is a bug in VS2005 ? Not having access to a proxy a
> class
[quoted text clipped - 69 lines]
>> >> > > re-wrte
>> >> > > this code ?
DaveP - 12 Jan 2006 14:18 GMT
Yes, I have access to class EchoService and EchoServiceWse. EchoServiceWse
allows me to SetPolicy.

I don't understand why I can't see the source code for the classes, like
EchoService.cs and EchoServiceWse.cs.

The next step, I think, is to create a Policy file, and to name a policy, so
that I can do

EchoServiceWse.SetPolicy("myPolicy");

Do I use the Wse3 Tool to cfreate the policy xml file, or do it by hand ?

Thanks for your help
Signature

Regards

DaveP
UK

> Hi DaveP,
> That strange, you should have access to a class EchoServiceWse. Have you
[quoted text clipped - 78 lines]
> >> >> > > re-wrte
> >> >> > > this code ?
Pablo Cibraro - 12 Jan 2006 18:24 GMT
Hi Dave,
It is better if you the use tool because you can reduce the probability to
make a mistake.

Regards,
Pablo Cibraro.

> Yes, I have access to class EchoService and EchoServiceWse. EchoServiceWse
> allows me to SetPolicy.
[quoted text clipped - 98 lines]
>> >> >> > > re-wrte
>> >> >> > > this code ?
DaveP - 12 Jan 2006 21:29 GMT
Pablo,

I've tried using the Wse 3 tool, but it won't work for me. The tool seems to
be just for security settings. I'm not doing any security.

The web services that I'm calling ask for an id, or 'handle', to be placed
in the SOAP header. I was just using the CustomInputFilter and
CustomOutputFilter to do this, but this seems to be difficult in WSE3.

What is the best way to put a string in the SOAP header on the request, and
then to check what value is in the SOAP Header when my client receives the
response ?
Signature

Regards

DaveP
UK

> Hi Dave,
> It is better if you the use tool because you can reduce the probability to
[quoted text clipped - 105 lines]
> >> >> >> > > re-wrte
> >> >> >> > > this code ?
Pablo Cibraro - 13 Jan 2006 14:00 GMT
Hi DaveP,
Are you using WSE only to add a soap header to the message ?.
That can be done with a simple web service without using WSE.
WSE is usefull when you need to add support for different WS-* protocols to
your service.

For example,

public class MyService : System.Web.Services.WebService
{
   public MyHeader CustomHeader;

  [WebMethod()]
  [SoapHeader( "CustomHeader")]
  public void MyWebMethod(string value)
 {
  }
}

/// <remarks/>
[XmlRoot("MyHeader", Namespace=http://temp.uri")]
[XmlType(Namespace=http://temp.uri)]
public class MyHeader: SoapHeader
{
  /// <remarks/>
 public string StringValue;
}

Regards,
Pablo Cibraro

> Pablo,
>
[quoted text clipped - 133 lines]
>> >> >> >> > > re-wrte
>> >> >> >> > > this code ?
DaveP - 13 Jan 2006 14:48 GMT
Thanks Pablo, this looks useful.

I'm calling 4 Web services from a web app, and each time I call them I will
need to set a different value. When they return I need to get the value from
the SOAP Header that is returned.

So before the call can I set the value in the SOAP Header class, for example

MyHeader.SetValue("thisValue");
MyService1.MyWebMethod("blah");
string OutHeader = Myheader.GetValue();

MyHeader.SetValue("thatValue");
MyService2.MyWebMethod("bleh");
string OutHeader = Myheader.GetValue();

Does this look right ? I'll try it anyway.
Signature

Regards

DaveP
UK

> Hi DaveP,
> Are you using WSE only to add a soap header to the message ?.
[quoted text clipped - 164 lines]
> >> >> >> >> > > re-wrte
> >> >> >> >> > > this code ?
DaveP - 13 Jan 2006 14:58 GMT
Pablo,

I'm calling Web services. I have no control over them. They are Java, and
they are part of a vendor product.

So I have to add values to the SOAP header without changing the Web service.
Signature

Regards

DaveP
UK

> Hi DaveP,
> Are you using WSE only to add a soap header to the message ?.
[quoted text clipped - 164 lines]
> >> >> >> >> > > re-wrte
> >> >> >> >> > > this code ?
Pablo Cibraro - 13 Jan 2006 16:14 GMT
Hi DaveP,
Ok, you can do the same on the proxy class for the web service.
I mean, you can define a custom header in the same way. Does it make sense ?

Regards,
Pablo Cibraro.

> Pablo,
>
[quoted text clipped - 182 lines]
>> >> >> >> >> > > re-wrte
>> >> >> >> >> > > this code ?
DaveP - 13 Jan 2006 16:46 GMT
Pablo, thanks, it makes sense.  But.. this takes me back to my previous
problem. My client is a Web App built in VS2005, and when I do an Add Web
Reference I don't get the proxy class, I just get the discomap and wsdl.

I can try it by using the command line tool, WseWsdl3.exe, but then I have
to copy it back into my VS2005 structure. When I've finished this I have to
document it as the way that our developers should work. It looks bad if I
tell them to use Visual Studio, but to use a command line tool every time
they have to add a Web reference !

Do you understand my problem ? Do you know if this will be fixed in VS2005
some day ?
Signature

Regards

DaveP
UK

> Hi DaveP,
> Ok, you can do the same on the proxy class for the web service.
[quoted text clipped - 189 lines]
> >> >> >> >> >> > > re-wrte
> >> >> >> >> >> > > this code ?
Pablo Cibraro - 13 Jan 2006 19:11 GMT
Yes, I understand your concern very well.
It is not a problem with VS2005, it is a problem with ASP.NET because it
uses a new application model based on different folders
(e.g, App_Code to store the code, App_WebReferences to store the web
services proxies).
The ASP.NET team in Microsoft will also provide the previous model (The
model used by ASP.NET 1.1 and VS2003) in the next version,
so you will able to chose the compilation model for your application. This
is great news for many people, including me :).

Regards,
Pablo Cibraro.

> Pablo, thanks, it makes sense.  But.. this takes me back to my previous
> problem. My client is a Web App built in VS2005, and when I do an Add Web
[quoted text clipped - 219 lines]
>> >> >> >> >> >> > > re-wrte
>> >> >> >> >> >> > > this code ?

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.