HTTP Server Error 501 Not Implemented when calling an webservice (Doc ID 2274051.1)

Last updated on JUNE 20, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.4 and later
Information in this document applies to any platform.

Symptoms

Trying to create a custom servlet (TestWS) as below:

SQL> Declare
lServletName Varchar2(30) := 'TestWS';
Begin
DBMS_XDB.DeleteServletMapping(lServletName);
DBMS_XDB.DeleteServlet(lServletName);
DBMS_XDB.AddServlet (NAME => lServletName ,
LANGUAGE => 'C',
DISPNAME => 'Test Web Service',
DESCRIPT => 'ServLet for Test Web Service',
SCHEMA => 'XDB');
DBMS_XDB.AddServletSecRole(SERVNAME => lServletName,
ROLENAME => 'XDB_WEBSERVICES',
ROLELINK => 'XDB_WEBSERVICES');
DBMS_XDB.AddServletMapping (PATTERN => '/' || lServletName || '/*',
NAME => lServletName);
End;
/

SQL> create user SERVLET_TEST identified by test;

SQL> GRANT CONNECT to SERVLET_TEST;

SQL> GRANT RESOURCE to SERVLET_TEST;

SQL> GRANT XDB_WEBSERVICES TO SERVLET_TEST;

SQL> GRANT XDB_WEBSERVICES_OVER_HTTP TO SERVLET_TEST;

SQL> GRANT XDB_WEBSERVICES_WITH_PUBLIC to SERVLET_TEST;

SQL> create or replace function EXAMPLE_FUNC (INPUT VARCHAR2) return VARCHAR2
as
OUTPUT VARCHAR2(100);
begin
OUTPUT := 'Hello '||INPUT;

return OUTPUT;
end;
/

SQL> begin
dbms_network_acl_admin.create_acl('servlettest.xml', 'ACL for testing', 'SERVLET_TEST', true, 'connect');
end;
/

SQL> begin
dbms_network_acl_admin.assign_acl('servlettest.xml', '*');
end;
/

SQL> exec dbms_xdb.sethttpport(7711);

When the webservice is called, below error occurs:

 SQL> set long 100000
SELECT httpuritype('http://USERNAME:PASSWORD@HOSTNAME:PORT/TestWS/SERVLET_TEST/EXAMPLE_FUNC?wsdl').getXML()
FROM dual; SQL> 2
ERROR:
ORA-29273: HTTP request failed
ORA-29269: HTTP server error 501 - Not Implemented
ORA-06512: at "SYS.HTTPURITYPE", line 38
ORA-06512: at "SYS.HTTPURITYPE", line 108

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms