title: Register services with basic authentication fails
body: <p>We try to publish a service, this fails into a 401 error. The endpoint and WSDL are protected with basic authentication. It looks like that the authentication fails, we have set the option "Endpoint Security Scheme" and entered valid credentials.</p>
  
  <p>Note: The WSDL endpoint is working the a normal browser.
  Note: We are using WSO2 AM 1.6.0</p>
  
  <p>Here is the stack dump.</p>
  
  <pre><code>2014-01-22 15:10:26,929 [-] [http-nio-9443-exec-33] ERROR APIMWSDLReader  Error occurs when change the addres URL of the WSDL
  2014-01-22 15:10:26,929 [-] [http-nio-9443-exec-33] ERROR APIUtil Failed to reset the WSDL : http://myhost.nl:8080/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl
  org.wso2.carbon.apimgt.api.APIManagementException:  Error occurs when change the addres URL of the WSDL
          at org.wso2.carbon.apimgt.impl.utils.APIMWSDLReader.readAndCleanWsdl(APIMWSDLReader.java:103)
          at org.wso2.carbon.apimgt.impl.utils.APIUtil.createWSDL(APIUtil.java:767)
          at org.wso2.carbon.apimgt.impl.APIProviderImpl.createAPI(APIProviderImpl.java:1111)
          at org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPI(APIProviderImpl.java:368)
          at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.addAPI(UserAwareAPIProvider.java:45)
          at org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_addAPI(APIProviderHostObject.java:475)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
          at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
          at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
          at org.jaggeryjs.rhino.publisher.modules.api.c3._c_anonymous_1(/publisher/modules/api/add.jag:6)
          at org.jaggeryjs.rhino.publisher.modules.api.c3.call(/publisher/modules/api/add.jag)
          at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
          at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
          at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
          at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
          at org.jaggeryjs.rhino.publisher.modules.api.c0._c_anonymous_1(/publisher/modules/api/module.jag:5)
          at org.jaggeryjs.rhino.publisher.modules.api.c0.call(/publisher/modules/api/module.jag)
          at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_anonymous_1(/publisher/site/blocks/item-add/ajax/add.jag:113)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_script_0(/publisher/site/blocks/item-add/ajax/add.jag:4)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
          at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.exec(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:570)
          at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
          at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:432)
          at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
          at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
          at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
          at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
          at org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
          at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
          at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
          at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56)
          at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
          at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
          at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
          at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:744)
  Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Unable to resolve imported document at 'http://myhost.nl/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl'.: java.io.IOException: Server returned HTTP response code: 401 for URL: http://myhost.nl/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl
          at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2259)
          at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2207)
          at org.wso2.carbon.apimgt.impl.utils.APIMWSDLReader.readWSDLFile(APIMWSDLReader.java:128)
          at org.wso2.carbon.apimgt.impl.utils.APIMWSDLReader.readAndCleanWsdl(APIMWSDLReader.java:84)
          ... 66 more
  Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://myhost.nl/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)
          at java.net.URL.openStream(URL.java:1037)
          at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(StringUtils.java:158)
          at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2238)
          ... 69 more
  2014-01-22 15:10:26,942 [-] [http-nio-9443-exec-33] ERROR UserAwareAPIProvider Error while performing registry transaction operation
  org.wso2.carbon.apimgt.api.APIManagementException: Failed to reset the WSDL : http://myhost.nl/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl
          at org.wso2.carbon.apimgt.impl.utils.APIUtil.createWSDL(APIUtil.java:787)
          at org.wso2.carbon.apimgt.impl.APIProviderImpl.createAPI(APIProviderImpl.java:1111)
          at org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPI(APIProviderImpl.java:368)
          at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.addAPI(UserAwareAPIProvider.java:45)
          at org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_addAPI(APIProviderHostObject.java:475)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
          at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
          at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
          at org.jaggeryjs.rhino.publisher.modules.api.c3._c_anonymous_1(/publisher/modules/api/add.jag:6)
          at org.jaggeryjs.rhino.publisher.modules.api.c3.call(/publisher/modules/api/add.jag)
          at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
          at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
          at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
          at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
          at org.jaggeryjs.rhino.publisher.modules.api.c0._c_anonymous_1(/publisher/modules/api/module.jag:5)
          at org.jaggeryjs.rhino.publisher.modules.api.c0.call(/publisher/modules/api/module.jag)
          at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_anonymous_1(/publisher/site/blocks/item-add/ajax/add.jag:113)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_script_0(/publisher/site/blocks/item-add/ajax/add.jag:4)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
          at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.exec(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:570)
          at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
          at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:432)
          at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
          at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
          at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
          at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
          at org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
          at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
          at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
          at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56)
          at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
          at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
          at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
          at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:744)
  Caused by: org.wso2.carbon.apimgt.api.APIManagementException:  Error occurs when change the addres URL of the WSDL
          at org.wso2.carbon.apimgt.impl.utils.APIMWSDLReader.readAndCleanWsdl(APIMWSDLReader.java:103)
          at org.wso2.carbon.apimgt.impl.utils.APIUtil.createWSDL(APIUtil.java:767)
          ... 65 more
  Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Unable to resolve imported document at 'http://myhost.nl/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl'.: java.io.IOException: Server returned HTTP response code: 401 for URL: http://myhost.nl/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl
          at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2259)
          at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2207)
          at org.wso2.carbon.apimgt.impl.utils.APIMWSDLReader.readWSDLFile(APIMWSDLReader.java:128)
          at org.wso2.carbon.apimgt.impl.utils.APIMWSDLReader.readAndCleanWsdl(APIMWSDLReader.java:84)
          ... 66 more
  Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://myhost.nl/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)
          at java.net.URL.openStream(URL.java:1037)
          at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(StringUtils.java:158)
          at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2238)
          ... 69 more
  2014-01-22 15:10:26,946 [-] [http-nio-9443-exec-33] ERROR APIProviderHostObject Error while adding the API- leesaanvraag-1.0
  org.wso2.carbon.apimgt.api.APIManagementException: Error in adding API :leesaanvraag
          at org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPI(APIProviderImpl.java:381)
          at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.addAPI(UserAwareAPIProvider.java:45)
          at org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_addAPI(APIProviderHostObject.java:475)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
          at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
          at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
          at org.jaggeryjs.rhino.publisher.modules.api.c3._c_anonymous_1(/publisher/modules/api/add.jag:6)
          at org.jaggeryjs.rhino.publisher.modules.api.c3.call(/publisher/modules/api/add.jag)
          at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
          at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
          at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
          at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
          at org.jaggeryjs.rhino.publisher.modules.api.c0._c_anonymous_1(/publisher/modules/api/module.jag:5)
          at org.jaggeryjs.rhino.publisher.modules.api.c0.call(/publisher/modules/api/module.jag)
          at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_anonymous_1(/publisher/site/blocks/item-add/ajax/add.jag:113)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_script_0(/publisher/site/blocks/item-add/ajax/add.jag:4)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
          at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.exec(/publisher/site/blocks/item-add/ajax/add.jag)
          at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:570)
          at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
          at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:432)
          at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
          at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
          at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
          at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
          at org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
          at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
          at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
          at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56)
          at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
          at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
          at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
          at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:744)
  Caused by: org.wso2.carbon.apimgt.api.APIManagementException: Error while performing registry transaction operation
          at org.wso2.carbon.apimgt.impl.AbstractAPIManager.handleException(AbstractAPIManager.java:666)
          at org.wso2.carbon.apimgt.impl.APIProviderImpl.createAPI(APIProviderImpl.java:1147)
          at org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPI(APIProviderImpl.java:368)
          ... 63 more
  Caused by: org.wso2.carbon.apimgt.api.APIManagementException: Failed to reset the WSDL : http://myhost.nl/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl
          at org.wso2.carbon.apimgt.impl.utils.APIUtil.createWSDL(APIUtil.java:787)
          at org.wso2.carbon.apimgt.impl.APIProviderImpl.createAPI(APIProviderImpl.java:1111)
          ... 64 more
  Caused by: org.wso2.carbon.apimgt.api.APIManagementException:  Error occurs when change the addres URL of the WSDL
          at org.wso2.carbon.apimgt.impl.utils.APIMWSDLReader.readAndCleanWsdl(APIMWSDLReader.java:103)
          at org.wso2.carbon.apimgt.impl.utils.APIUtil.createWSDL(APIUtil.java:767)
          ... 65 more
  Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Unable to resolve imported document at 'http://myhost.nl:8080/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl'.: java.io.IOException: Server returned HTTP response code: 401 for URL: http://myhost.nl/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl
          at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2259)
          at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2207)
          at org.wso2.carbon.apimgt.impl.utils.APIMWSDLReader.readWSDLFile(APIMWSDLReader.java:128)
          at org.wso2.carbon.apimgt.impl.utils.APIMWSDLReader.readAndCleanWsdl(APIMWSDLReader.java:84)
          ... 66 more
  Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://myhost.nl:8080/orawsv/SNL_OWNER/WSO_AANVRAGEN/LEES_AANVRAAG?wsdl
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)
          at java.net.URL.openStream(URL.java:1037)
          at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(StringUtils.java:158)
          at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2238)
          ... 69 more
  2014-01-22 15:10:26,951 [-] [http-nio-9443-exec-33] ERROR add:jag org.wso2.carbon.apimgt.api.APIManagementException: Error while adding the API- leesaanvraag-1.0
  </code></pre>
  
  <p>Could this be related to ISSUE:</p>
  
  <p><a href="https://wso2.org/jira/browse/APIMANAGER-1841" rel="nofollow">https://wso2.org/jira/browse/APIMANAGER-1841</a></p>