Dears I am accessing and work serice using SoapUi tool successful but when call web service using .net client i got following error "Element ClaimDetails from namespace cannot have child contents to be deserialized as an object. Please use XmlNode[] to deserialize this pattern of XML". My Web Method defination like this
Public Function getResults(ByVal UserName As String, ByVal Password As String, ByRef RegNo As String, ByRef ChassisNo As String, ByRef EngineNo As String, ByVal policyNo As String, ByVal insurerName As String, <system.runtime.interopservices.outattribute()> ByRef ClaimDetails As Object) As String
My Code:
protected void BTN_Go_Click(object sender, EventArgs e)
{
try
{
String[] objClaimDtl = { };
IIBClaint.IBWebServiceClient objClient = new IIBClaint.IBWebServiceClient();
IIBClaint.getResultsRequest objResultrequest = new IIBClaint.getResultsRequest(new IIBClaint.getResultsRequestBody(TXT_UserName.Text, TXT_Password.Text, TXT_RegisterNo.Text, TXT_ChassisNo.Text, TXT_EnginNo.Text, TXT_PolicyNo.Text, TXT_InsurerName.Text));
IIBClaint.getResultsResponse objresponce = new IIBClaint.getResultsResponse(new IIBClaint.getResultsResponseBody("RJ146218", "", "", "", objClaimDtl));
HttpWebRequest webRequest = (HttpWebRequest)System.Net.WebRequest.Create(ConfigurationManager.AppSettings["ServiceURL"]);
webRequest.Proxy = System.Net.WebRequest.DefaultWebProxy;
string localProxyUserName = ConfigurationManager.AppSettings["ProxyUserName"];
string localProxyPassword = ConfigurationManager.AppSettings["ProxyUserPassword"];
string localProxyDomainName = ConfigurationManager.AppSettings["ProxyDomainName"];
webRequest.Proxy.Credentials = new NetworkCredential(localProxyUserName, localProxyPassword, localProxyDomainName);
objresponce = objClient.getResults(objResultrequest);
}
catch (Exception ex)
{
TXT_Responce.Text = ex.InnerException.Message;
}
}
b>Service WSDL :b>
"<wsdl:definitions name="IIBWebService" targetnamespace="http://localhost:9096/IIBWebService/" xmlns:wsdl="#unknown"><wsdl:types><xsd:schema targetnamespace="http://localhost:9096/IIBWebService/" xmlns:xsd="#unknown"><xsd:element name="getResults"><xsd:complextype><xsd:sequence><xsd:element name="UserName" type="xsd:string" /><xsd:element name="Password" type="xsd:string" /><xsd:element name="RegNo" type="xsd:string" /><xsd:element name="ChassisNo" type="xsd:string" /><xsd:element name="EngineNo" type="xsd:string" /><xsd:element name="policyNo" type="xsd:string" /><xsd:element name="insurerName" type="xsd:string" /></xsd:sequence></xsd:complextype></xsd:element><xsd:element name="getResultsResponse"><xsd:complextype><xsd:sequence><xsd:element name="Authentication" type="xsd:string" /><xsd:element name="RegNo" type="xsd:string" /><xsd:element name="ChassisNo" type="xsd:string" /><xsd:element name="EngineNo" type="xsd:string" /><xsd:element name="ClaimDetails" nillable="true" soapenc:arraytype="xsd:string[]" xmlns:soapenc="#unknown" /></xsd:sequence></xsd:complextype></xsd:element></xsd:schema></wsdl:types><wsdl:message name="getResultsRequest"><wsdl:part name="parameters" element="tns:getResults">
</wsdl:part></wsdl:message><wsdl:message name="getResultsResponse"><wsdl:part name="parameters" element="tns:getResultsResponse">
</wsdl:part></wsdl:message><wsdl:porttype name="IIBWebService"><wsdl:operation name="getResults"><wsdl:input message="tns:getResultsRequest">
</wsdl:input><wsdl:output message="tns:getResultsResponse">
</wsdl:output></wsdl:operation></wsdl:porttype><wsdl:binding name="IIBWebServiceSOAP" type="tns:IIBWebService"><soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="#unknown" /><wsdl:operation name="getResults"><soap:operation soapaction="http://localhost:9096/IIBWebService/getResults" xmlns:soap="#unknown" /><wsdl:input><soap:body use="literal" xmlns:soap="#unknown" /></wsdl:input><wsdl:output><soap:body use="literal" xmlns:soap="#unknown" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="IIBWebService"><wsdl:port name="IIBWebServiceSOAP" binding="tns:IIBWebServiceSOAP"><soap:address location="http://iib.gov.in/IIBWebServicesV3.0/services/IIBWebService/" xmlns:soap="#unknown" /></wsdl:port></wsdl:service></wsdl:definitions>"