locked
webservice response error utf-8 RRS feed

  • Question

  • User-506497988 posted

    consume wsdl in web app issue

    7 hours, 17 minutes ago|LINK|83.110.102.190

    Hi All

    I consumed web service in my web apps the wsdl 

    https://www.sdtps.gov.ae/DTPSTestIntegrationService/ShjrerdIntegrationServicePort?WSDL

    when i run the web page which i passed string to return the status in this webservice below error coming (check below my c# code and screenshot from request and response in soupui tools):

    System.ServiceModel.ProtocolException: 'The content type text/html; charset="utf-8" of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 950 bytes of the response were: '<html>
    <head><title>
    Web Services
    </title></head>
    <body>
    <h1>Web Services</h1>
    <table width='100%' border='1'>
    <tr>
    <td>
    Endpoint
    </td>
    <td>
    Information
    </td>
    </tr>
    <tr>
    <td>
    <table border="0"><tr><td>Service Name:</td><td>{http://integration.esi.dtps.gov.ae/}ShjrerdIntegrationService</td></tr><tr><td>Port Name:</td><td>{http://integration.esi.dtps.gov.ae/}ShjrerdIntegrationServicePort</td></tr></table>
    </td>
    <td>
    <table border="0"><tr><td>Address:</td><td>http://www.sdtps.gov.ae:80/DTPSTestIntegrationService/ShjrerdIntegrationServicePort</td></tr><tr><td>WSDL:</td><td><a href="http://www.sdtps.gov.ae:80/DTPSTestIntegrationService/ShjrerdIntegrationServicePort?wsdl">http://www.sdtps.gov.ae:80/DTPSTestIntegrationService/ShjrerdIntegrationServicePort?wsdl</a></td></tr><tr><td>Implementation class:</td><td>ae.gov.dtps.esi.integration.ShjrerdIntegrationService</td></tr></table>
    </td>
    </tr>
    </table>
    </body>
    </html>
    '.'

    --end of error message

    public void CheckData()
        {
            ServiceReference1.ShjrerdIntegrationServicePortTypeClient client = new ServiceReference1.ShjrerdIntegrationServicePortTypeClient();
            client.Endpoint.Behaviors.Add(new CustomEndpointBehavior());
            
    
            ds = getDataSet("select * from rs_OWNERSHIP_vouchers where rs_sitemap_sts = 1");
            if (Checkdataset(ds))
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                  
    
                    ServiceReference1.transactionVO mo1 = client.getTransactionDetail(dr["RS_SITETRXNO"].ToString());
    
                    if (Convert.ToInt16(mo1.statusId) >= 4)
                    {
                        DataSet dsserial = getDataSet("select nvl(max(rsr_serial),0)+1 into v_ser from real_adm.RS_SITEMAP_REQUESTS where RSR_RSO_ID =" + dr["rso_id"]);
                        int msg = ret = InsertUpdateData("insert into real_adm.RS_SITEMAP_REQUESTS (RSR_RSO_ID, RSR_SERIAL, RSR_DATE,    RSR_STATUS, RSR_SITETRXNO,RSR_NOTES,rsr_mapurl) values(" + dr["rso_id"] + "," + dsserial.Tables[0].Rows[0]["v_ser"] + ",sysdate," + Convert.ToInt16(mo1.statusId) + "," + dr["RS_SITETRXNO"].ToString() + ",'تم انجاز المعاملة من التخطيط'," + mo1.finalProductUrl + ") ");
                        int msg2 = ret = InsertUpdateData("update real_adm.rs_ownership_vouchers set RS_SITEMAP_STS=" + Convert.ToInt16(mo1.statusId) + ", RS_SITEMAP_DT=sysdate,  where rso_id=" + dr["rso_id"]);
                        Response.Write(mo1.statusAr);
                        Response.Write(mo1.statusEn);
                        Response.Write(mo1.statusId);
    
    
    
                    }
                }
            }
    
        }
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:int="http://integration.esi.dtps.gov.ae/">
    <soapenv:Header>
          <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
             <wsse:UsernameToken wsu:Id="UsernameToken-4" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsse:Username>dsharjah</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">D@shj2020</wsse:Password>
             </wsse:UsernameToken>
          </wsse:Security>
       </soapenv:Header>
       <soapenv:Body>
          <int:getTransactionDetail>
             <!--Optional:-->
             <trxNo>4012020001810149</trxNo>
          </int:getTransactionDetail>
       </soapenv:Body>
    </soapenv:Envelope>
    Tuesday, February 9, 2021 4:10 AM

All replies