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

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();

}
 
G

Guest

try:
SampleSvcs.Service1 svcs = new SampleSvcs.Service1();
svcs.Credentials = new System.Net.NetworkCredential("user", "password",
"domain");
 
J

Justin Dutoit

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
 
G

Guest

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....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top