How to call web services from WSDL?

97 Views Asked by At

I have save the wsdl into my local computer, so I have create a new project with visual studio (c#) then I have import this file. So I have the WSDL into my project and I have PianoResidentialService under "Service Refereces" folder.

Now I want to try to call a web service. But I don't know how do this. I have try this code but now works.

public MainWindow()
{
    InitializeComponent();
    PianoAssistenzialeResidenzialeService.getPianoAssistenziale ws_PA = new PianoAssistenzialeResidenzialeService.getPianoAssistenziale();

}

If I try to get Inspect ws_PA, all field is null.

1

There are 1 best solutions below

0
On

You probably need to specify the endpoint:

ws_PA.URL = "http://some.server.com/endpoint/";

Then, you should call a method which is generated for the operation you want to call. (Remember that a webservice can have multiple operations.)

var result = ws_PA.Operation(parameters);

You might want to share the WSDL with us and tell us in more detail what you want to achieve.