PUBLICAR WEBSERVICE

ARNALDOCRUZ 28/06/2011 02:44:51
#377899
Boa noite

colegas fiz um webservice que consulta uma tabela em um banco de dados mysql.
na minha maquina funciona perfeitamente, porem quando public no provedor de internet não funciona.

instalado na mi nha maquina

Mysql 5.1
Conector Mysql 6.3.7

fiz a referencia a dll mySql.Data

no arquivo asmx

Imports MySql.Data.MySqlClient

Dim conectado As Boolean = False
Dim conn As New MySqlConnection
Dim myCommand As New MySqlCommand

Public Function Conection(ByVal login As String, ByVal senha As String) As Boolean
Try
Na conexão localhost
[ô]Dim log As String = login
[ô]Dim Senh As String = senha
[ô]Dim connectionString As String = [Ô]server=localhost;database=Supersys;uid=[Ô] & log & [Ô];pwd=[ô][Ô] & Senh & [Ô][ô][Ô]
[ô]conn = New MySqlConnection(connectionString)
[ô]conn.Open()
[ô]Conection = True

[ô] Conexão no provedor de internet
Dim HOST As String = [Ô]IP DA MAQUINA RETIREI[Ô]
Dim USUARIO As String = login
Dim SENH As String = senha
Dim BANCO As String = login
Dim stringConexao As String = [Ô]Database=[Ô] + BANCO + [Ô];Data Source=[Ô] + HOST + [Ô];User Id=[Ô] + USUARIO + [Ô];Password=[Ô] + senha + [Ô]; pooling=false[Ô]
conn = New MySqlConnection(stringConexao)
conn.Open()
Conection = True
Catch
Conection = False
End Try
End Function

methodo pelo qual chamo o webservice

<WebMethod()> _
Public Function Acesso(ByVal login As String, ByVal senha As String, ByVal CodEmp As String) As String
Dim Retorno As String = [Ô][Ô]
If Conection([Ô]M euBanco[Ô], [Ô]963875214ABC[Ô]) Then
Dim Leitura As MySqlDataReader
Dim SQL As String = [Ô][Ô]
SQL = [Ô]Select * from tbllogin Where LOGIN=[ô][Ô] & login & [Ô][ô] And Senha=[ô][Ô] & senha & [Ô][ô][Ô]
myCommand.CommandType = CommandType.Text
myCommand.CommandText = SQL
myCommand.Connection = conn
Leitura = myCommand.ExecuteReader
If Leitura.Read Then
Leitura.Close()
SQL = [Ô]Select Validade,Pago from tbllibera Where CodEmp=[Ô] & CodEmp
myCommand.CommandType = CommandType.Text
myCommand.CommandText = SQL
myCommand.Connection = conn
Leitura = myCommand.ExecuteReader
If Leitura.Read Then
If Leitura([Ô]Pago[Ô]) = [Ô]1[Ô] Then
Retorno = FormatDateTime(Leitura([Ô]Validade[Ô]).ToString, DateFormat.ShortDate)
Else
Retorno = [Ô][Ô]
End If
Else
Retorno = [Ô][Ô]
End If
Leitura.Close()
conn.Clone()
conn.Dispose()
Else
Retorno = [Ô][Ô]
Leitura.Close()
conn.Clone()
conn.Dispose()
End If
End If
Acesso = Retorno
End Function

========================================
No projeto que chama o webservice

adionei a referecia ao serviço do webservice do provedor, aparece o methodo acesso.

Dim WS As New Wservico.Service1

Consulta ao webservice
Dim Bosta as string = WS.Acesso([Ô]login[Ô], [Ô]senha[Ô], [Ô]001[Ô]) - aqui acontece o erro

erro

unable to automatically step into the server.
Connection to the server machine [ô]supersyssistemas.com.br[ô] failed
O nome da rede especificado não está disponivel.


The request failed with HTTP status 408: Request Timeout.

alguem sabe o que pode está acontecendo

Obrigado
ARNALDOCRUZ 28/06/2011 12:27:10
#377931
Não colega, olhe que eu coloquei o modo da conexão localhost e o modo no provedor de internet.

e o erro é não está acontecendo a conexão com mysql, fiz um outro projeto só com a conexão, e retorna o mesmo erro.
NETMANIA 28/06/2011 14:02:41
#377944
Tente usar a string de conexão da seguinte maneira: [Ô]Database=[Ô] & BANCO & [Ô];Data Source=[Ô] & HOST & [Ô];User Id=[Ô] & USUARIO & [Ô];Password=[Ô] & senha

Quandio você publica o projeto no servidor, você está copiando o site simplemente ou usando o sistema de publicação do Visual Studio? Outra cosia, você está incluindo na compilação a cópia da DLL mysql.data.dll?
ARNALDOCRUZ 28/06/2011 16:11:20
#377962
eu usei a publicação do sistema, manualmente copiei a dll mysql.data.dll para pasta indicada pelo provedor.

no provedor a pasta indicada e WEB

a publicação ficou
web\bin

copiei a dll pra web e pra web\bin tentei colocando so na web, só na bin e mesmo assim não funcou.


agora como é que compila com a dll imbutida no exe ?
KERPLUNK 28/06/2011 17:08:19
#377969
Amigo, verifique o Web.Config, verifique pra que endereço está sendo apontado o webservice...
NETMANIA 28/06/2011 17:26:01
#377971
QUando eu vou publicar o WebService no site eu uso a ferramenta de publisher do Visual Studio que faz todo o processo (copia DLL se você marcar), páginas e coisas do tipo.
ARNALDOCRUZ 28/06/2011 19:24:58
#377980
sobre webconfig está como abaixo

<?xml version=[Ô]1.0[Ô] ?>
- <configuration>
- <configSections>
- <sectionGroup name=[Ô]system.web.extensions[Ô] type=[Ô]System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô]>
- <sectionGroup name=[Ô]scripting[Ô] type=[Ô]System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô]>
<section name=[Ô]scriptResourceHandler[Ô] type=[Ô]System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] requirePermission=[Ô]false[Ô] allowDefinition=[Ô]MachineToApplication[Ô] />
- <sectionGroup name=[Ô]webServices[Ô] type=[Ô]System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô]>
<section name=[Ô]jsonSerialization[Ô] type=[Ô]System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] requirePermission=[Ô]false[Ô] allowDefinition=[Ô]Everywhere[Ô] />
<section name=[Ô]profileService[Ô] type=[Ô]System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] requirePermission=[Ô]false[Ô] allowDefinition=[Ô]MachineToApplication[Ô] />
<section name=[Ô]authenticationService[Ô] type=[Ô]System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] requirePermission=[Ô]false[Ô] allowDefinition=[Ô]MachineToApplication[Ô] />
<section name=[Ô]roleService[Ô] type=[Ô]System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] requirePermission=[Ô]false[Ô] allowDefinition=[Ô]MachineToApplication[Ô] />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings />
<connectionStrings />
- <system.web>
- <!--

Set compilation debug=[Ô]true[Ô] to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict=[Ô]true[Ô] to disallow all data type conversions
where data loss can occur.
Set explicit=[Ô]true[Ô] to force declaration of all variables.


-->
- <compilation debug=[Ô]true[Ô] strict=[Ô]false[Ô] explicit=[Ô]true[Ô]>
- <assemblies>
<add assembly=[Ô]System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089[Ô] />
<add assembly=[Ô]System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089[Ô] />
<add assembly=[Ô]System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] />
<add assembly=[Ô]System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089[Ô] />
<add assembly=[Ô]MySql.Data, Version=6.3.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d[Ô] />
</assemblies>
</compilation>
<customErrors mode=[Ô]Off[Ô] />
- <pages>
- <namespaces>
<clear />
<add namespace=[Ô]System[Ô] />
<add namespace=[Ô]System.Collections[Ô] />
<add namespace=[Ô]System.Collections.Generic[Ô] />
<add namespace=[Ô]System.Collections.Specialized[Ô] />
<add namespace=[Ô]System.Configuration[Ô] />
<add namespace=[Ô]System.Text[Ô] />
<add namespace=[Ô]System.Text.RegularExpressions[Ô] />
<add namespace=[Ô]System.Linq[Ô] />
<add namespace=[Ô]System.Xml.Linq[Ô] />
<add namespace=[Ô]System.Web[Ô] />
<add namespace=[Ô]System.Web.Caching[Ô] />
<add namespace=[Ô]System.Web.SessionState[Ô] />
<add namespace=[Ô]System.Web.Security[Ô] />
<add namespace=[Ô]System.Web.Profile[Ô] />
<add namespace=[Ô]System.Web.UI[Ô] />
<add namespace=[Ô]System.Web.UI.WebControls[Ô] />
<add namespace=[Ô]System.Web.UI.WebControls.WebParts[Ô] />
<add namespace=[Ô]System.Web.UI.HtmlControls[Ô] />
</namespaces>
- <controls>
<add tagPrefix=[Ô]asp[Ô] namespace=[Ô]System.Web.UI[Ô] assembly=[Ô]System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] />
<add tagPrefix=[Ô]asp[Ô] namespace=[Ô]System.Web.UI.WebControls[Ô] assembly=[Ô]System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] />
</controls>
</pages>
- <!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode=[Ô]Windows[Ô] />
- <!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode=[Ô]RemoteOnly[Ô] defaultRedirect=[Ô]GenericErrorPage.htm[Ô]>
<error statusCode=[Ô]403[Ô] redirect=[Ô]NoAccess.htm[Ô] />
<error statusCode=[Ô]404[Ô] redirect=[Ô]FileNotFound.htm[Ô] />
</customErrors>

-->
- <httpHandlers>
<remove verb=[Ô]*[Ô] path=[Ô]*.asmx[Ô] />
<add verb=[Ô]*[Ô] path=[Ô]*.asmx[Ô] validate=[Ô]false[Ô] type=[Ô]System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] />
<add verb=[Ô]*[Ô] path=[Ô]*_AppService.axd[Ô] validate=[Ô]false[Ô] type=[Ô]System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] />
<add verb=[Ô]GET,HEAD[Ô] path=[Ô]ScriptResource.axd[Ô] type=[Ô]System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] validate=[Ô]false[Ô] />
</httpHandlers>
- <httpModules>
<add name=[Ô]ScriptModule[Ô] type=[Ô]System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] />
</httpModules>
</system.web>
- <system.codedom>
- <compilers>
- <compiler language=[Ô]vb;vbs;visualbasic;vbscript[Ô] extension=[Ô].vb[Ô] warningLevel=[Ô]4[Ô] type=[Ô]Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089[Ô]>
<providerOption name=[Ô]CompilerVersion[Ô] value=[Ô]v3.5[Ô] />
<providerOption name=[Ô]OptionInfer[Ô] value=[Ô]true[Ô] />
<providerOption name=[Ô]WarnAsError[Ô] value=[Ô]false[Ô] />
</compiler>
</compilers>
</system.codedom>
- <!--

The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.

-->
- <system.webServer>
<validation validateIntegratedModeConfiguration=[Ô]false[Ô] />
- <modules>
<remove name=[Ô]ScriptModule[Ô] />
<add name=[Ô]ScriptModule[Ô] preCondition=[Ô]managedHandler[Ô] type=[Ô]System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] />
</modules>
- <handlers>
<remove name=[Ô]WebServiceHandlerFactory-Integrated[Ô] />
<remove name=[Ô]ScriptHandlerFactory[Ô] />
<remove name=[Ô]ScriptHandlerFactoryAppServices[Ô] />
<remove name=[Ô]ScriptResource[Ô] />
<add name=[Ô]ScriptHandlerFactory[Ô] verb=[Ô]*[Ô] path=[Ô]*.asmx[Ô] preCondition=[Ô]integratedMode[Ô] type=[Ô]System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] />
<add name=[Ô]ScriptHandlerFactoryAppServices[Ô] verb=[Ô]*[Ô] path=[Ô]*_AppService.axd[Ô] preCondition=[Ô]integratedMode[Ô] type=[Ô]System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] />
<add name=[Ô]ScriptResource[Ô] preCondition=[Ô]integratedMode[Ô] verb=[Ô]GET,HEAD[Ô] path=[Ô]ScriptResource.axd[Ô] type=[Ô]System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35[Ô] />
</handlers>
</system.webServer>
- <runtime>
- <assemblyBinding xmlns=[Ô]urn:schemas-microsoft-com:asm.v1[Ô]>
- <dependentAssembly>
<assemblyIdentity name=[Ô]System.Web.Extensions[Ô] publicKeyToken=[Ô]31bf3856ad364e35[Ô] />
<bindingRedirect oldVersion=[Ô]1.0.0.0-1.1.0.0[Ô] newVersion=[Ô]3.5.0.0[Ô] />
</dependentAssembly>
- <dependentAssembly>
<assemblyIdentity name=[Ô]System.Web.Extensions.Design[Ô] publicKeyToken=[Ô]31bf3856ad364e35[Ô] />
<bindingRedirect oldVersion=[Ô]1.0.0.0-1.1.0.0[Ô] newVersion=[Ô]3.5.0.0[Ô] />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Sobre a publicação

como eu faço pra ublicar com as dll ?
ARNALDOCRUZ 30/06/2011 02:46:33
#378084
bom depois de muito penar recebi uma mensagem do provedor de internet dizendo que a falha estava na hospedagem, e que o erro tinha sido corrigido.

tentei novamente e tudo funcionou perfeitamente. não era erro no meu codigo e sim na hospedagem.

Tópico encerrado , respostas não são mais permitidas