0

I am trying to access the webservice methods hosted on my machine. I added the reference using "Add Web Refernce". When i try to create the object of the service but visual studio dont let me do so.....here`s the settings in he web.config

<applicationSettings>
    <Refernce.Properties.Settings>
        <setting name="Refernce_Hippa_HipaaService" serializeAs="String">
            <value>http://localhost/MDHipaaWS/HipaaService.asmx</value>
        </setting>
    </Refernce.Properties.Settings>
</applicationSettings>

i have imported the refernce in code behind but it still don`t let me create the object..

2 Answers2

1

Right click References within your project structure. Click "Add Service Reference". In the address field input your url, and click "Go". Inspect services in the listbox, then click OK when finished.

VIsual studio will then create a set of classes which you can use to communicate with your web service.

I would recommend using Service reference. See link below.

Check out this answer.

Community
  • 1
  • 1
scheien
  • 2,457
  • 1
  • 19
  • 22
  • used Add Service Reference but still problem remains. – Aamir Saleem Jan 10 '14 at 07:57
  • Could you try to uncheck the reuse types in references assemblies? I have experienced this problem myself some time ago, but I cant remember what I did to fix it right now. It does not create the classes at all? – scheien Jan 10 '14 at 08:01
  • i dont see any added classes but there is a Setting.setting file under properties – Aamir Saleem Jan 10 '14 at 08:07
  • Can you start over, remove all the things added by the first try. Then readd the service using service reference, and under advanced uncheck "Reuse types in referenced assemblies". – scheien Jan 10 '14 at 08:09
  • i`dont get it can u tell me exactly how to uncheck "Reuse types in reference assemblies" – Aamir Saleem Jan 10 '14 at 08:12
  • Click Advanced down to the bottom left in the Add Service Reference window. You should locate "Reuse types in refe....." in the middle of the Advanced dialog. – scheien Jan 10 '14 at 08:40
0

You could also use the SvcUtil.exe to generate the proxy classes to the service too.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74