Solved

Create Proxy Class for Windows Service

Posted on 2013-06-20
6
355 Views
Last Modified: 2013-07-11
I have created a windows service that converts files on my server.  I would like to create a proxy class so this can be called from my client machines.  

I am a little confused as to what to do when the svcutil.exe asks a base address, as my service sits on the c:\drive

Thanks
0
Comment
Question by:gdinunzio
  • 3
  • 2
6 Comments
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 39263999
http://www.codeproject.com/Articles/863/Your-first-C-Web-Service

http://forums.asp.net/t/1263452.aspx  - You have to deploy in IIS and provide the asmx path for svcutil
0
 

Author Comment

by:gdinunzio
ID: 39264148
I have a windows service...the web service uses a DLL that calls a windows service.
0
 
LVL 35

Expert Comment

by:Miguel Oz
ID: 39267210
Q1: What kind of windows service is this? A WCF windows service?
If it is then you just need to instance a client and call the appropiate contract methods.

Q2: What do you mean by "the web service uses a DLL that calls a windows service"? Is there a DLL doing the job of the proxy you need?
If that is the case you just need to go to your web service and refactor the code that interacts to the dll in a new class and use it in your target code.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:gdinunzio
ID: 39274634
I tried generating WSDL & XSDs first for the service-contract interfaces using svcutil.exe:
I ran the following:

Svcutil.exe "http://localhost:8731/Myservice" /target:metadata

It produced 4 files:
Myservice.xsd
schemas.microsoft.com.2003.10.serialization.xsd
tempuri.org.wsdl
tempura.org.xsd

I then tried to generate the proxy class based on WSDL & XSDs using the following command:

svcutil "http://localhost:8731/Myservice/" /Language=vb /t:Code /out:MyServiceProxy.vb /config:MyServiceProxy.config

It seems to time out.

Am I doing anything wrong?











Generate actual proxy class/es based on WSDL & XSDs generated using svcutil tool
0
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 39276544
You do not need svc utils, check "Creating a Client to Consume Service" section at:
http://www.codeproject.com/Articles/42643/Creating-and-Consuming-Your-First-WCF-Service
The sample is using an asp.net web site, but  you can use for any project as the key idea is to add a service reference. (Step 3 ) and the sample code (step 4) can go in a button event handler of a win form app.

If steps above fail, then your server is not setup correctly look at the sample server code to have similar configuration entries. If further help required, please post your WCF service code/project specifying which VS version is using.
0
 

Author Closing Comment

by:gdinunzio
ID: 39318093
worked
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now