Adding Web Service


i working on windows home edition computer. web service located on same computer consuming application.

 

when attempting add web service in visual web developer home edition, followig error message:

 

there error downloading 'http://localhost/helloworldthreeservice/webservice.asmx'.
unable connect remote server
no connection made because target machine actively refused 127.0.0.1:80
metadata contains reference cannot resolved: 'http://localhost/helloworldthreeservice/webservice.asmx'.
could not connect http://localhost/helloworldthreeservice/webservice.asmx. tcp error code 10061: no connection made because target machine actively refused 127.0.0.1:80.
unable connect remote server
no connection made because target machine actively refused 127.0.0.1:80
if service defined in current solution, try building solution , adding service reference again.

 

 

 

 

 

in website project have used add web reference command add reference web service.  have been prompted web reference , have used web services in solution find service.  clicked on web service name dev web server launch , you'd list of methods in service.  right of information textbox says web reference name.  name going namespace name service (which different namespace used when creating service).  local service default localhost.  when click add button you'll see new folder in project along web service's description file.  description file sit in folder matches name of namespace of service.

 

app_webreferences

    localhost

        webservice1.discomap

 

so use service in own code you'd this:

 

code snippet

using localhost;

 

protected void page_load ( object sender, eventargs e )
{

   label lbl = new label();

   controls.add(lbl);

 

   service1 svc = new service1();

   lbl.text = svc.helloworld();

}

 

assuming have set website startup project should able run code , see results in page.

 

still, asmx file content doesn't right.  code should not in ~/app_code directory.  looks maybe you're trying create web service web site project.  need make sure create web service project.  unlike winforms can't change few project settings switch 1 project type another.  unfortunately more involved that.  easier create new web service project , drag , drop code across.

 

it looks might test solution you're playing with.  if , still can't things work feel free e-mail solution if want , i'll see if can't fix it'll run you.

 

michael taylor - 5/23/08

http://p3net.mvps.org



Archived Forums A-B  >  ASMX Web Services and XML Serialization



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'