Solved

Create Proxy Class for Windows Service

Posted on 2013-06-20
6
352 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

14 Experts available now in Live!

Get 1:1 Help Now