I am new in c# and webservice, i did a ton of research and i am still stuck.
I must develop a simple windows form application which can consume a simple webservice, i have only the wsdl from webservice. I am using framework 4. I successfully added the webservice into my project with no problem. I just cannot know how i must call methods with inputs and outputs, i am not sure that methods are actually called...
I think that the key point is in the porttype :
- <wsdl:message name="getGreetingRequestMsg">
<wsdl:part name="getGreetingParameters" element="xsns:getGreeting" xmlns:xsns="http://WSSTestServiceLib/WSSTestOutboundService/V1" />
</wsdl:message>
- <wsdl:message name="getGreetingResponseMsg">
<wsdl:part name="getGreetingResult" element="xsns:getGreetingResponse" xmlns:xsns="http://WSSTestServiceLib/WSSTestOutboundService/V1" />
</wsdl:message>
- <wsdl:portType name="WSSTestOutboundService">
- <wsdl:operation name="getGreeting">
<wsdl:input name="getGreetingRequest" message="ns0:getGreetingRequestMsg" />
<wsdl:output name="getGreetingResponse" message="ns0:getGreetingResponseMsg" />
<wsdl:fault name="serviceErrors" message="ns1:serviceErrorsMsg" />
</wsdl:operation>
</wsdl:portType>
I don't know how to do inputs with my program with only this, i think it is in xml but i don't know how to do it.
Here is my code which signify absoluterly nothing because it is just for testing :
myws.WSSTestOutboundServiceHttpService CallWebService =
new myws.WSSTestOutboundServiceHttpService();
myws.getGreeting test1 = new myws.getGreeting();
CallWebService.getGreetingAsync(test1);
MessageBox.Show(test1.ToString());
myws.getGreetingResponse test2 = new myws.getGreetingResponse();
MessageBox.Show(test2.greeting);
WSSTestOutboundServiceClient
(or similar - definitely ending in...Client
) and that's your client-side code used to call the service. Instantiate one of those(whatever)Client
classes and you should find each of the web service methods as a method on that class, and you should be able to call these methods from your code