Cannot access web service from VB.NET -


several months ago, wrote application in vb.net accesses cold fusion web service. web service (which sitting on cf server on cloud) set web reference in vb.net project. when execute built application on system running windows server 2003, has no problem whatever consuming web service.

fast forward today. attempting consume web service on adjacent win7 computer using same network/connection, , everytime run application either in vs2010 ide or built application, gives me error: "the underlying connection closed: connection closed unexpectedly."

i have made no changes either web service or vb.net code.

what causing such error?

here vb.net code consumes service:

 public function connectedtotheinternet() boolean     dim myservice = new testservice.testservicecfc()      try         myservice.echostring("hello")         connectedtotheinternet = true     catch ex exception         windows.forms.messagebox.show(ex.message)         connectedtotheinternet = false     end try  end function 

and here web service code:

<cfcomponent output="false">     <cffunction name="echostring" returntype="string" output="no" access="remote">         <cfargument name="input" type="string">         <cfreturn #arguments.input#>     </cffunction> </cfcomponenet> 

i have tried disabling windows firewall, had no effect.

not sure, try , add code permissions, role-based security , make sure application has permissions in code access server.

use genericidentity , genericpricipal keywords.

here example code

imports system imports system.security.principal  imports system.threading  public shared sub main() 'hard coded username dim strusername string = "admin"  'create genericidentity dim gidmyid new genericidentity(strusername) dim strmyrole string = "some role"  'create genericprincipal dim gplmyprincipal new genericprincipal(myidentity, myroles)  'store principal later use thread.currentprincipal = gplmyprincapal   end sub 

you can set see admin need tell server role defined allowed access web service.

the last bit of code call web service if have been authenticated

if(string.compare(gplmyprincapal, "domain\admin", true) = 0)     'enter code here else     msgbox("cannot connect", "error") end if 

not sure if worth go


Comments