Click here to Skip to main content
15,918,742 members
Home / Discussions / C#
   

C#

 
AnswerRe: creating installer, startup??? Pin
marazm19-Jul-05 7:48
marazm19-Jul-05 7:48 
AnswerRe: creating installer, startup??? Pin
amitmohanty9-Jul-05 15:16
amitmohanty9-Jul-05 15:16 
AnswerHERE IS THE ANSWER Pin
marazm19-Jul-05 16:20
marazm19-Jul-05 16:20 
GeneralRe: HERE IS THE ANSWER Pin
amitmohanty9-Jul-05 18:17
amitmohanty9-Jul-05 18:17 
GeneralIn first time I draw, in the second, no. Pin
Alex Cutovoi9-Jul-05 6:21
Alex Cutovoi9-Jul-05 6:21 
GeneralRe: In first time I draw, in the second, no. Pin
Snowblind379-Jul-05 10:23
Snowblind379-Jul-05 10:23 
GeneralRe: In first time I draw, in the second, no. Pin
Alex Cutovoi10-Jul-05 5:21
Alex Cutovoi10-Jul-05 5:21 
GeneralNeed help using an abstract WebMethod Pin
Snowblind379-Jul-05 5:32
Snowblind379-Jul-05 5:32 
Before I pull out my hair out, throw the computer out the window, step on the neighbours cat, drive my car over the cliff or all of the above......I thought maybe I could ask for some help.

The concept is simple....or so it would seem.

I want to call a WebMethod with my credentials and get the information about my account back. Hmmm, should be a piece of cake. The problem is that the class created by wsdl.exe is an abstract class with abstract methods. So I created a class that implements those methods using override.

Here is the basic setup:

The abstract class created by wsdl
<br />
[System.Web.Services.WebServiceBindingAttribute(Name="AccountsSoap", Namespace="http://address")]<br />
<br />
    public abstract class ServiceAccounts : System.Web.Services.WebService <br />
{<br />
        <br />
        [System.Web.Services.WebMethodAttribute()]<br />
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://address/QueryProfile", RequestNamespace="http://address", ResponseNamespace="http://address", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]<br />
<br />
        public abstract AccountProfile QueryProfile(Credentials credentials);<br />
<br />
}<br />


The class to implement
<br />
[WebService(Name="ServiceAccounts",Description="Provides a callback mechanism",Namespace="http://address/accounts")]<br />
<br />
	public class AccountsImpl : Project.App.Tls.Accounts.ServiceAccounts<br />
	{<br />
<br />
[WebMethod(MessageName="QueryProfile",Description="Gets the profile of the specified client.",EnableSession=false)]<br />
<br />
public override AccountProfile QueryProfile(Credentials credentials)<br />
		{<br />
//What do I put in here?<br />
}<br />


And finally the call
<br />
private void sendButton_Click(object sender, System.EventArgs e)<br />
		{<br />
			CredentialCache myCache = new CredentialCache();<br />
<br />
			NetworkCredential netCred = new NetworkCredential("name1", "pwd1", "domain");<br />
			((CredentialCache) myCache).Add(destUri, "NTLM", netCred);<br />
			((CredentialCache) myCache).Add(destUri, "negotiate", netCred);<br />
			((CredentialCache) myCache).Add(destUri, "digest", netCred);<br />
<br />
			accounts.credentials.Account = "name2";<br />
			accounts.credentials.Password = "pwd2";<br />
<br />
			accountProfile = accounts.QueryProfile(accounts.credentials);<br />
		}<br />


Now, I'm sure you are all wondering what my problem is....My problem is that I don't know what to put in my implementation of QueryProfile() to make it call the webMethod. All of the implementations I have seen say to create a new object of ServiceAccounts and then just call the respective method. This code I would put in my QueryProfile() implementation. But since both the ServiceAccounts and the ServiceAccounts.QueryProfile() are both abstract, I cannot create a reference to them.

I know the answer is going to be simple but I cannot figure this out!!!!!!!!

Any input would be appreciative as I kinda like my hair, my computer, the neighbour's cat and especially my car.

Thanks

SnowBlind37 who is CodeBlind37 at this moment
GeneralRe: Need help using an abstract WebMethod Pin
Member 20300389-Jul-05 9:05
Member 20300389-Jul-05 9:05 
GeneralRe: Need help using an abstract WebMethod Pin
Snowblind379-Jul-05 9:44
Snowblind379-Jul-05 9:44 
GeneralRe: Need help using an abstract WebMethod Pin
leppie9-Jul-05 14:30
leppie9-Jul-05 14:30 
GeneralRe: Need help using an abstract WebMethod Pin
Snowblind379-Jul-05 17:47
Snowblind379-Jul-05 17:47 
GeneralRe: Need help using an abstract WebMethod Pin
Snowblind3710-Jul-05 3:34
Snowblind3710-Jul-05 3:34 
GeneralRe: Need help using an abstract WebMethod Pin
S. Senthil Kumar10-Jul-05 3:37
S. Senthil Kumar10-Jul-05 3:37 
GeneralRe: Need help using an abstract WebMethod Pin
Snowblind3710-Jul-05 6:14
Snowblind3710-Jul-05 6:14 
QuestionVideo preview from external device - how to? Pin
Gal Shadeck9-Jul-05 3:22
Gal Shadeck9-Jul-05 3:22 
GeneralRedefining Enums Pin
Chris Davies9-Jul-05 2:59
Chris Davies9-Jul-05 2:59 
GeneralRe: Redefining Enums Pin
S. Senthil Kumar9-Jul-05 4:02
S. Senthil Kumar9-Jul-05 4:02 
GeneralRe: Redefining Enums Pin
Uwe Keim9-Jul-05 8:01
sitebuilderUwe Keim9-Jul-05 8:01 
GeneralRe: Redefining Enums Pin
Chris Davies9-Jul-05 9:19
Chris Davies9-Jul-05 9:19 
GeneralListView Column Width resize Pin
ARBR9-Jul-05 2:01
ARBR9-Jul-05 2:01 
GeneralRe: ListView Column Width resize Pin
mav.northwind9-Jul-05 20:52
mav.northwind9-Jul-05 20:52 
GeneralSet up problem Pin
ksanju10009-Jul-05 1:30
ksanju10009-Jul-05 1:30 
GeneralListView - Columns collection design-time question Pin
iliyang8-Jul-05 23:51
iliyang8-Jul-05 23:51 
QuestionPass byte array? Pin
Dominik Reichl8-Jul-05 23:08
Dominik Reichl8-Jul-05 23:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.