0
Contextualization
I’m developing a C# application to access a test webservice I created. This webservice is simple, it only has a method that returns a string.
The webservice I created by Visual Studio, through an Asp.net. I added a webservice to the project and implemented the method that returns a string.
Project ASP.Net
Project structure
Files generated by the project
In the Asp.net project folder, the files were generated as print below:
The highlighted file (testeWS) is in . asmx format.
Method of the webservice
Project executed by Visual Studio
Note that the method (testWebService) appears at the beginning of the page.
After I click on the method link, the following page appears:
When I click the call button on this page, I get the message that the test methodWebService returns, which is "Webservice working properly".
The problem
I put the "testWS.asmx" file in my FTP’s Webservice folder to try to order it via browser. Inbound, I’m not getting it.
I am in doubt if I need to share all the Asp.net project files I created or if I need to do something completely different.
Follow the error print:
After inserting, in the Web.Config file, the tag that enables the display of the error message, I got the following page when trying to order the file "testeWS.asmx" by the browser:
Code of Web.config
<configuration>
<system.web>
<customErrors mode="Off"/><customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime targetFramework="4.6.1"/>
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
</compilers>
</system.codedom>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ApplicationInsightsWebTracking"/>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
preCondition="managedHandler"/>
</modules>
</system.webServer>
</configuration>
Web FTP
The files I generated when publishing the project in ASP.Net are as follows on FTP:
I uploaded all the files generated in the ASP.Net project publication process by Visual Studio.
Is there an error? Try to share all the files that make up the application.
– gato
Simply putting a file on your FTP will not work. You will need to generate the "Publish" of the files, probably configure your IIS on the FTP server and then put the "Publish" files there.
– Leandro Amarilha
@Leandroamarilha I published the project in a folder of my computer and sent all the files to a folder of my FTP. Even doing so, the error persists.
– Hudson Rodrigues
@Hudsonrodrigues how local worked, what can be is that there is a server configuration error. Temporarily try to activate in the settings of Web.config to show the error that is giving. In the message when loading the page shows how to do this
– Leandro Amarilha
@Leandroamarilha edited the post with the new error screen. configured the Web.config file to display the error message.
– Hudson Rodrigues
@Hudsonrodrigues now seems to be another problem, checks whether there is more than one in the Web.config file
<customErrors mode="Off"/><customErrors mode="Off"/>
– Leandro Amarilha
@Leandroamarilha only has what I added.
– Hudson Rodrigues
In addition to the file
asmx
you need all the files inside the folderbin
. Also, this webservice is in the folder root web server?– Jéf Bueno
@jbueno updated the post with the files I put in FTP. They are the same files that were generated when publishing the project in Visual Studio.
– Hudson Rodrigues
It turns out you need to create a virtual directory in your hosting
– Jéf Bueno
@jbueno how would I do that? Could be more specific, thank you.
– Hudson Rodrigues
You can’t be more specific. You need to create a virtual directory for your application, that’s how IIS works. I can’t show this using prints because I don’t use Kinghost services.
– Jéf Bueno