mpdillon
asked on
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
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
ASKER
Dan,
I will do that later today. How do I create a .svc file since Publish does not create one?
thanks,
pat
I will do that later today. How do I create a .svc file since Publish does not create one?
thanks,
pat
ASKER
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.
ASKER
Dan, I read the article. I gather I am should add
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.
Below is the error this created.
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.
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.
<% @ServiceHost Service="SpecSheetWebService.SpechSheetService" %>
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
Below is the error this created.
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, Dan. I have to rush out now for some personal business. I will review tonight.
ASKER
I never quite got it to work. I appreciate the effort.
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