SOAP API - Invalid Content Type response

Tom Kerman
Tera Contributor

We have a Java application, which is using SOAP to interact with Service Now.

We recently recieved a report from one of aour customers that SOAP calls to the sys_user table were failing with the following error:

Invalid Content-Type:text/html

We were unable to reproduce it on our servers, it seems very specific to this customer's instance, and to the sys_user table and tables that extend it.

The SOAP request is something like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sys="https://ven03268.service-now.com/sys_user">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
          <sys:getRecords>         <__exclude_columns>accumulated_roles,active,agent_status,avatar,average_daily_fte,building,business_criticality,calendar_integration,city,company,correlation_id,cost_center,country,date_format,default_perspective,department,edu_status,email,employee_number,enable_multifactor_authn,failed_attempts,gender,geolocation_tracked,hashed_user_id,home_phone,hr_integration_source,internal_integration_user,introduction,last_login,last_login_device,last_login_time,last_name,last_password,last_position_update,latitude,ldap_server,location,locked_out,longitude,managed_domain,manager,middle_name,mobile_phone,name,notification,on_schedule,password_needs_reset,phone,photo,preferred_language,roles,schedule,source,state,street,sys_class_name,sys_created_by,sys_created_on,sys_domain,sys_domain_path,sys_mod_count,sys_updated_by,sys_updated_on,time_format,time_sheet_policy,time_zone,title,transaction_log,u_custom_column,user_name,user_password,vip,web_service_access_only,zip</__exclude_columns><__last_row>2</__last_row><__encoded_query>sys_id=309b4e601b3e41501b1610a41a4bcba7</__encoded_query>
           </sys:getRecords>

      </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The following headers are set:

SOAPAction=https://ven03268.service-now.com/sys_user/getRecords
Authorization=Basic xxxxxxx
Content-Type=text/xml; charset=utf-8
Connection=Keep-Alive
Accept=text/xml
Content-Length=1321

The SOAP call is using basic authentication with an administrator user.

Does anyone have any idea what might be causing this issue?

Many thanks,

1 REPLY 1

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Tom,

Not sure but maybe glide.soap.require_content_type_xml property is set and the content type returned is text/html instead of text/xml.

https://docs.servicenow.com/en-US/bundle/sandiego-platform-administration/page/administer/security/r...