I want to call a web service from C#. I have added the WS by adding service reference. The WS has generated automatically the code below.
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="getIdentiteRequest", WrapperNamespace="http://serviceobject.exemple.fr", IsWrapped=true)]
public partial class getIdentiteRequest
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://serviceobject.exemple.fr", Order=0)]
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public Oscar.Web.WebService.Model request;
public getIdentiteRequest()
{ }
public getIdentiteRequest(MyProgram.Web.WebService.Model request)
{
this.request = request;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="getIdentiteResponse", WrapperNamespace="http://serviceobject.exemple.fr", IsWrapped=true)]
public partial class getIdentiteResponse
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://serviceobject.exemple.fr", Order=0)]
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public Oscar.Web.Intuiz.IdentiteResponse @return;
public getIdentiteResponse()
{
}
public getIdentiteResponse(MyProgram.Web.WebService.IdentiteResponse @return)
{
this.@return = @return;
}
}
I want now to call this web service in my program but I cannot understand how to do this. I have added below my effort to call this class:
getIdentiteRequest getIdentite = new getIdentiteRequest();
Model request = new Model();
request.identification = "UseId";
request.searchId = "123456789";
getIdentiteRequest.request = request;
getIdentiteResponse getIdentiteAltaN4R = new getIdentiteResponse();
var response = getIdentiteAltaN4R.@return;
I would be thankful if someone can indicate to me how I can call / use this web service.
Thank you in advance.