'automated client code building tool'?

Your previous thread was calling a webservice

Think what you are asking for is how to use this?

If so, use something like VisualStudio and add the service as a reference. You will then end up with something like the below and can use the service in your code:

webservice.png


EDIT: Just realised I did this with a silverlight project - ignore that fact but principle still same
 
Last edited:
svcutil will give you the metadata for the service in two files

make sure you run it from the commandline (not just double-click it)

e.g.

C:\Users\notmyUsername>"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\SvcUtil.exe" http://www.GCGoldWeb.com/MemberData.svc

Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'http://www.gcgoldweb.com/MemberData.svc' using WS-Metadata Exchange or DISCO.
Generating files...
C:\Users\notmyUsername\MemberData.cs
C:\Users\notmyUsername\output.config
 
svcutil will give you the metadata for the service in two files

make sure you run it from the commandline (not just double-click it)

e.g.

C:\Users\notmyUsername>"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\SvcUtil.exe" http://www.GCGoldWeb.com/MemberData.svc

Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'http://www.gcgoldweb.com/MemberData.svc' using WS-Metadata Exchange or DISCO.
Generating files...
C:\Users\notmyUsername\MemberData.cs
C:\Users\notmyUsername\output.config

Im doing something wrong here, this is what i have when i type svcutil.exe http://www.gcgoldweb.com/MemberData.svc?wsdl



Uploaded with ImageShack.us

What am i doing wrong?
 
Last edited:
not really sure what you're using there - the correct svcutil is from the microsoft SDK

yours states "Joe Richard" wheras mine shows "Microsoft"...

for instance mine (on a 64-bit system) is located at:
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\SvcUtil.exe", hence my commandline looks like this:

C:\Users\notmyUsername>"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\SvcUtil.exe" http://www.GCGoldWeb.com/MemberData.svc

Think this is the correct download (usually is packaged as part of a Visual Studio install)

See usage on MSDN here
 
Right, thats generated my 2 files, and i think ive added them to visual studio properly. Now this has gone WAY beyond my tiny little brain. How do i use this to add a login page to my website? :?
 
Last edited:
I'll admit I'm not a web programmer mate - just a geek with some spare time...

If you have visual studio though you shouldn't have needed to use svcutil. Just add the service as a reference to the project using the url and VS will automatically create all of the code-behind.

In regards to using, will very much depend on the API documentation - if you have this it will tell you how to use. Once VS has added all of the code-behind you should be able to access the service classes using standard coding in your project. For example, something along these lines (where I have called the added service "MemberServiceReference"):

protected void testService(object sender, EventArgs e)
{
MemberServiceReference.MemberData svc = new MemberServiceReference.MemberData();
MemberServiceReference.LoginCredentials testLog = new MemberServiceReference.LoginCredentials();
testLog.ClubID = "1";
testLog.Password = "Meh";

svc.GetMembersCompleted += new MemberServiceReference.GetMembersCompletedEventHandler(svc_GetMembersCompleted);
System.Diagnostics.Debug.WriteLine("Sending web request . . .");
svc.GetMembersAsync(testLog, 1, false, 1, false);
}

void svc_GetMembersCompleted(object sender, GetMembersCompletedEventArgs e)
{
if (e.UserState == null)
{

}
else
{
System.Diagnostics.Debug.WriteLine("Members User state", (e.Result as GetMembersResult).Status.Result.ToString());
}
}
 
Last edited:
The thing thats getting me is, why do i need to know all this? all i want to do is change the ugly login page http://forums.overclockers.co.uk/showthread.php?t=18332288 to be more suited to my website design.

Not sure if you do - as stated I'm not a web programmer by trade. Your question was about code generation and the above is how you would consume a webservice in an application.

Best place to start would be the existing code for the page you want to change - they will already be doing something similar - and just edit the front part.
 
No worries. Think for speed, edit the existing page if possible.

However, if you want to use AJAX (as someone mentioned in other thread) or anything complicated you will probably need to understand the webservice.

Good luck!

/thread
 
Back
Top Bottom