Solved

Create Proxy Class for Windows Service

Posted on 2013-06-20
6
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 36

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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 

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 36

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

726 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