What string to call a WCF web service to obtain the results of the service

I have created my first WCF web service. I have installed it as part of the default web site on IIS 7. IIS is not running anything other than this WCF Web Service. The web service has only one Service, SpecSheetService. This service has one Function GetSpecSheet. And that function accepts one Variable, LotNo. The WCF service should returns a string.

You can see from the Publish Image that at this point all the service does is return the string that was sent plus a few other words.

The group trying to access this service has used the URL Http://XXX.XXX.XXX.IPAddress:PortNo/SpecSheetService.svc. They receive the IIS7 default home page.

In looking into this I find that after Publishing from Visual Basic 2013 that there is not a .SVC file on the Web server, see attached files.

Should there be a .SVC file on the server? If so how do I create one.?

And what string should the testers use to test this service?
wwwroot.png
AspNetClient.png
Bin.png
Publish.png
mpdillonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan McFaddenSystems EngineerCommented:
Your problem is that the web service is not deployed correctly.  Your code should not be under the aspnet_client directory.  Change your publishing directory to:  C:\inetpub\wwwroot

When using the URL you posted above, you will get an http error code of 404 because the service does not exist in the root of the website.

Your website should have the following structure:

- C:\
-- inetpub
---- wwwroot
------ bin  [all your assemblies (DLLs) should be here]
------ SpecSheetService.svc
------ web.config

As long as IIS is installed with the default settings and you have not changed any configuration of the Default Web Site, the URL to use would be:

http://hostname.domain.ext/SpecSheetService.svc

Dan
mpdillonAuthor Commented:
Dan,
I will do that later today. How do I create a .svc file since Publish does not create one?
thanks,
pat
Dan McFaddenSystems EngineerCommented:
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

mpdillonAuthor Commented:
Dan, Thanks. My work schedule will probably not permit me to try to implement the svc template from that link until Thurs night. I will post the results, successful or not, once I have them . An added complication is a 6 hour time difference between myself and the folks with which I am testing.
mpdillonAuthor Commented:
Dan, I read the article. I gather I am should add
<% @ServiceHost Service="SpecSheetWebService.SpechSheetService" %>

Open in new window

to a .svc file. I tried this two different ways.
The first was to choose Add New WCF Service. This yielded the code shown below. I added the @Servicehost piece after the .svc was created. Since it contains an error I tried something else.
' NOTE: You can use the "Rename" command on the context menu to change the class name "Service1" in code, svc and config file together.
' NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.vb at the Solution Explorer and start debugging.
Public Class Service1
    Implements IService1
    Public Sub DoWork() Implements IService1.DoWork
        <% @ServiceHost Service="SpecSheetWebService.SpechSheetService" %>
    End Sub
End Class

Open in new window


Below is the error this created.
ServiceHost-error.png
Next I tried adding a Text file to the project. I named the Text file SpecSheetWebService.svc. To the text file I added the @Servicehost code. I did not see any errors.
I deleted the WCF Service file from above. I changed the publish path and I published the app. That folder structure is shown below.
wwwRootNew.png
Was it correct for me to use a text file t create a .svc file and if so, is it now published correctly?

If all this is correct, I will open another question for how to test.
Dan McFaddenSystems EngineerCommented:
I believe that adding the text file is the way to accomplish it.  Here is a decent article that is a complete walk-thru.  Notice the section titled "Adding an SVC file to the host application."   The steps are exactly what you did above.

link:  http://www.codeproject.com/Articles/97204/Implementing-a-Basic-Hello-World-WCF-Service

As a quick test, you should be able to go to the URL and see a page that displays some content about the service.

In the article, there is also a mention of how to verify the service is functioning.

Dan

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mpdillonAuthor Commented:
Thanks, Dan. I have to rush out now for some personal business. I will review tonight.
mpdillonAuthor Commented:
I never quite got it to work. I appreciate the effort.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.