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

Tip: Looking for answers? Try searching our database.

Accessing Soap Header

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Debasish Pramanik - 13 Sep 2006 12:08 GMT
Hi All,

I have added a SoapHeader in my websevice, which is exposed as a variable
from my webservice. Whenver I access the header form my client I see the
name of variable being changed to <VaribaleName>Value.

public class MyClass: System.Web.Services.WebService

{

public Header RequestHeader;

[WebMethod]

[SoapHeader("RequestHeader")]

public String Method1(ref String Data)

{

}

In the Client we access as follows

Header header = new Header();

MyClass m = new MyClass();

m.HeaderValue = header;

Why it suffixed the it with value or is this the right way to access it.

Signature

Regards,

Debasish Pramanik
Assetlink India.
Phone: +91 20 26119531 (226)

John Saunders - 13 Sep 2006 15:04 GMT
> Hi All,
>
[quoted text clipped - 27 lines]
>
> Why it suffixed the it with value or is this the right way to access it.

If it works, then why ask why?

John
Debasish Pramanik - 14 Sep 2006 10:31 GMT
Why can't I access it as RequestHeader of the Service Object ?????

Signature

Regards,

Debasish Pramanik
Assetlink India.
Phone: +91 20 26119531 (226)

> > Hi All,
> >
[quoted text clipped - 31 lines]
>
> John
John Saunders - 14 Sep 2006 17:35 GMT
> Why can't I access it as RequestHeader of the Service Object ?????

Sorry, I didn't notice that you were confusing the client and the server.
The service object does not exist on the client. What's on the client (in
your case) is a proxy class generated from the WSDL file which .NET produced
from the metadata on the server. .NET chose to create a proxy class with a
Header object called HeaderValue. That's not within your control.

So, don't worry about the name difference, as MyClass on the client and
MyClass on the server are two classes with almost no relationship between
them.

In other words, just use what works, HeaderValue, and don't expect the
client and server to be the same thing.

John
Debasish Pramanik - 19 Sep 2006 07:53 GMT
Hi John,

Thanks for the reply !!

I have seen some site whee they say it depend upon the namespace that you
can provide the attribute that controls the name. Do you have any idea about
that.

Signature

Regards,

Debasish Pramanik
Assetlink India.
Phone: +91 20 26119531 (226)

> > Why can't I access it as RequestHeader of the Service Object ?????
>
[quoted text clipped - 12 lines]
>
> John
John Saunders - 19 Sep 2006 10:52 GMT
> Hi John,
>
[quoted text clipped - 4 lines]
> about
> that.

No, sorry, I've never heard of anything like that. As far as I know, if you
use a Microsoft-generated proxy class, then you have to put up with
Microsoft-generated names.

John

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.