How to share a webservice through an FTP?

Asked

Viewed 242 times

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

inserir a descrição da imagem aqui

Files generated by the project

In the Asp.net project folder, the files were generated as print below:

inserir a descrição da imagem aqui

The highlighted file (testeWS) is in . asmx format.

Method of the webservice

inserir a descrição da imagem aqui

Project executed by Visual Studio

inserir a descrição da imagem aqui

Note that the method (testWebService) appears at the beginning of the page.

After I click on the method link, the following page appears:

inserir a descrição da imagem aqui

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:

inserir a descrição da imagem aqui

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:

inserir a descrição da imagem aqui

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=\&quot;Web\&quot; /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:

inserir a descrição da imagem aqui

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.

  • 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.

  • @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.

  • @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

  • @Leandroamarilha edited the post with the new error screen. configured the Web.config file to display the error message.

  • @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"/>

  • @Leandroamarilha only has what I added.

  • In addition to the file asmx you need all the files inside the folder bin. Also, this webservice is in the folder root web server?

  • @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.

  • It turns out you need to create a virtual directory in your hosting

  • @jbueno how would I do that? Could be more specific, thank you.

  • 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.

Show 7 more comments

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.