Error 'BusinessLayer' does not contain a definition for 'MySoapHeader'

  • Thread starter Thread starter Justin Dutoit
  • Start date Start date
J

Justin Dutoit

Hey. I have the error CS0117 'BusinessLayer' does not contain a definition
for 'MySoapHeader'. Below is a link to the asmx source, and the code which
calls the web service. MS seems to do the same thing at
http://www.dotnetjunkies.com/QuickStart/aspplus/default.aspx?url=/quickstart
/aspplus/doc/secureservices.aspx

I'd appreciate any help. Thanks

Justin Dutoit

http://justindutoit.port5.com/QuickshopDocs/businesslayer.asmx.txt

void callws(Object Source, EventArgs e) {

BusinessLayer business = new BusinessLayer();
AuthHeader auth = new AuthHeader();
auth.Username = "justindutoit";
auth.Password = "paulpaul";
business.MySoapHeader = auth; // <<< error here

info.Text = business.Test();

}
 
try:
SampleSvcs.Service1 svcs = new SampleSvcs.Service1();
svcs.Credentials = new System.Net.NetworkCredential("user", "password",
"domain");
 
Thanks for replying, but I don't think I need NetworkCredential, it's custom
authentication, where a distant web app is calling my web service by
supplying a username and password. Have a look at the web service code.

Tks
Justin
 
So your proxy object doens't contain a def for your soap header field. I just
tried writing a quick web service that uses a soap header. It seems to work
fine in c#, the only difference between my code and yours is that the proxy
contained a field for the header in the syntax [SoapHeaderObjType]Value.

Refresh your web reference (right click on the web reference in the solution
explorer, choose update). then clikc "show all files" for that project.
Expand the serivice in the explorer and drill down to the reference file.
this is your proxy. Look at the class def. you will see the field that
exposes your header and the type defined in this fiel as well.

I tested my code in C# but i assume it to work the same in VB

Let me know if this helped....
 
Back
Top