Results 1 to 6 of 6

Thread: REST API doc error: Can't read from server.

  1. #1
    Join Date
    Mar 2016
    Posts
    3

    Default REST API doc error: Can't read from server.

    I install as below tutorial:
    https://www.wowza.com/forums/content...ngine-REST-API

    I extract and open index.html in folder RESTAPIDocumentationWebpage, it shows:
    Can't read from server. It may not have the appropriate access-control-origin settings.

    I also search other topics and try to change port 8089 -> 8099 and restart server and press explore button with address http://localhost:8099/api-docs but the same issue occurs
    when I access http://localhost:8099/api-docs via browser directly, web page shows
    {"info":null,"apiVersion":"1.0.0","apis":[{"b":"Application Operations","path":"/v2/servers/{serverName}/vhosts/{vhostName}/applications","description":"Application Operations"},{"b":"Machine Level Current Statistics","path":"/v2/machine/monitoring/current","description":"Machine Level Current Statistics"},{"b":"Machine Level Historic Statistics","path":"/v2/machine/monitoring/historic","description":"Machine Level Historic Statistics"},{"b":"Server Licenses","path":"/v2/servers/{serverName}/licenses","description":"Server Licenses"},{"b":"Server Listeners","path":"/v2/servers/{serverName}/listeners","description":"Server Listeners"},{"b":"Server log4j system","path":"/v2/servers/{serverName}/log4j","description":"Server log4j system"},{"b":"Server MediaCache","path":"/v2/servers/{serverName}/mediacache","description":"Server MediaCache"},{"b":"Server MediaCasters","path":"/v2/servers/{serverName}/mediacasters","description":"Server MediaCasters"},{"b":"Server Monitoring","path":"/v2/servers/{serverName}/monitoring","description":"Server Monitoring"},{"b":"Server Publishers","path":"/v2/servers/{serverName}/publishers","description":"Server Publishers"},{"b":"REST information","path":"/restinfo","description":"REST information"},{"b":"Servers Configuration","path":"/v2/servers","description":"Servers Configuration"},{"b":"Server Status","path":"/v2/servers/{serverName}/status","description":"Server Status"},{"b":"Server Transcoder","path":"/v2/servers/{serverName}/transcoder","description":"Server Transcoder"},{"b":"Server Tuning","path":"/v2/servers/{serverName}/tune","description":"Server Tuning"},{"b":"Server Users","path":"/v2/servers/{serverName}/users","description":"Server Users"},{"b":"VHost Operations","path":"/v2/servers/{serverName}/vhosts","description":"VHost Operations"}],"swaggerVersion":"1.2","authorizations":null}
    This is my Server.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <Root version="2">
    	<Server>
    		<Name>Wowza Streaming Engine</Name>
    		<Description>Wowza Streaming Engine is robust, customizable, and scalable server software that powers reliable streaming of high-quality video and audio to any device, anywhere.</Description>
    		<RESTInterface>
    			<Enable>true</Enable>
    			<IPAddress>*</IPAddress>
    			<Port>8087</Port>
    			<!-- none, basic, digest-->
    			<AuthenticationMethod>none</AuthenticationMethod>
    			<DiagnosticURLEnable>true</DiagnosticURLEnable>
    			<SSLConfig>
    				<Enable>false</Enable>
    				<KeyStorePath></KeyStorePath>
    				<KeyStorePassword></KeyStorePassword>
    				<KeyStoreType>JKS</KeyStoreType>
    				<SSLProtocol>TLS</SSLProtocol>
    				<Algorithm>SunX509</Algorithm>
    				<CipherSuites></CipherSuites>
    				<Protocols></Protocols>
    			</SSLConfig>
    			<IPWhiteList>127.0.0.1</IPWhiteList>
    			<IPBlackList></IPBlackList>
    			<EnableXMLFile>false</EnableXMLFile>
    			<DocumentationServerEnable>true</DocumentationServerEnable>
    			<DocumentationServerPort>8099</DocumentationServerPort>
    			<!-- none, basic, digest-->
    			<DocumentationServerAuthenticationMethod>none</DocumentationServerAuthenticationMethod>
    			<Properties>
    			    <Name>restUserHTTPHeaders</Name>
    				<Value>Access-Control-Allow-Origin:*|Access-Control-Allow-Methods:OPTIONS,GET,PUT,DELETE,POST|Access-Control-Allow-Headers:Content-Type</Value>
    			</Properties>
    		</RESTInterface>
    		<CommandInterface>
    			<HostPort>
    				<ProcessorCount>${com.wowza.wms.TuningAuto}</ProcessorCount>
    				<IpAddress>*</IpAddress>
    				<Port>8083</Port>
    			</HostPort>
    		</CommandInterface>
    		<AdminInterface>
    			<!-- Objects exposed through JMX interface: Server, VHost, VHostItem, Application, ApplicationInstance, MediaCaster, Module, Client, MediaStream, SharedObject, Acceptor, IdleWorker -->
    			<ObjectList>Server,VHost,VHostItem,Application,ApplicationInstance,MediaCaster,Module,IdleWorker</ObjectList>
    		</AdminInterface>
    		<Stats>
    			<Enable>true</Enable>
    		</Stats>
    		<!-- JMXUrl: service:jmx:rmi://localhost:8084/jndi/rmi://localhost:8085/jmxrmi -->
    		<JMXRemoteConfiguration>
    			<Enable>false</Enable>
    			<IpAddress>localhost</IpAddress> <!-- set to localhost or internal ip address if behind NAT -->
    			<RMIServerHostName>localhost</RMIServerHostName> <!-- set to external ip address or domain name if behind NAT -->
    			<RMIConnectionPort>8084</RMIConnectionPort>
    			<RMIRegistryPort>8085</RMIRegistryPort>
    			<Authenticate>true</Authenticate>
    			<PasswordFile>${com.wowza.wms.ConfigHome}/conf/jmxremote.password</PasswordFile>
    			<AccessFile>${com.wowza.wms.ConfigHome}/conf/jmxremote.access</AccessFile>
    			<SSLSecure>false</SSLSecure>
    		</JMXRemoteConfiguration>
    		<UserAgents>Shockwave Flash|CFNetwork|MacNetwork/1.0 (Macintosh)</UserAgents>
    		<Streams>
    			<DefaultStreamPrefix>mp4</DefaultStreamPrefix>
    		</Streams>
    		<ServerListeners>
    			<ServerListener>
    				<BaseClass>com.wowza.wms.mediacache.impl.MediaCacheServerListener</BaseClass>
    			</ServerListener>
    			<!--
    			<ServerListener>
    				<BaseClass>com.wowza.wms.plugin.loadbalancer.ServerListenerLoadBalancerListener</BaseClass>
    			</ServerListener>
    			-->
    			<!--
    			<ServerListener>
    				<BaseClass>com.wowza.wms.plugin.loadbalancer.ServerListenerLoadBalancerSender</BaseClass>
    			</ServerListener>
    			-->
    		</ServerListeners>
    		<VHostListeners>
    			<!--
    			<VHostListener>
    				<BaseClass></BaseClass>
    			</VHostListener>
    			-->
    		</VHostListeners> 
    		<HandlerThreadPool>
    			<PoolSize>${com.wowza.wms.TuningAuto}</PoolSize>
    		</HandlerThreadPool>
    		<TransportThreadPool>
    			<PoolSize>${com.wowza.wms.TuningAuto}</PoolSize>
    		</TransportThreadPool>
    		<RTP>
    			<DatagramStartingPort>6970</DatagramStartingPort>
    			<DatagramPortSharing>false</DatagramPortSharing>
    		</RTP>
    		<Manager>
    			<!-- Properties defined are used by the Manager -->
    			<Properties>
    			</Properties>
    		</Manager>
    		<Transcoder>
    			<PluginPaths>
    				<QuickSync></QuickSync>
    			</PluginPaths>
    		</Transcoder>
    		<!-- Properties defined here will be added to the IServer.getProperties() collection -->
    		<Properties>
    		</Properties>
    	</Server>
    </Root>
    Could you please give me some suggestions for this issue?
    Thanks for your time.

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    Hello

    You might try whitelisting all ips in your xml to ensure that isn't the issue:
    <IPWhiteList>*</IPWhiteList>
    Keep the port at 8089 and restart Wowza and reload the index.html page. Should you continue to see problems, zip up your conf/ and logs/ directories and send them to support here.

    Thanks,
    Matt

  3. #3
    Join Date
    Mar 2016
    Posts
    3

    Default

    hi Matt,
    Thanks for your support, I modified Server doesn't work, in log, I can see API document server started

    RESTDocumentationServer: Bind attempt ([any]:8089)	-	-	
    RESTDocumentationServer: Bind successful ([any]:8089)	-	
    Wowza REST Documentation Server started	-	-	-	6.809	
    RESTDocumentationServer: Using configs from:C:/Program Files
    RESTDocumentationServer: BasicAuth:No	-	-	-	6.809
    Beside my account is trial version, I can't access to support side, and I'm investigating this tool for my company before purchasing official one. Is there anything I can do with my situation?
    Last edited by triallag; 03-28-2016 at 05:47 PM.

  4. #4
    Join Date
    May 2013
    Posts
    680

    Default

    Hello

    I just noticed in your Server.xml file that is missing the <Property> tag. So do the following:

    			<Properties>
    			    <Name>restUserHTTPHeaders</Name>
    				<Value>Access-Control-Allow-Origin:*|Access-Control-Allow-Methods:OPTIONS,GET,PUT,DELETE,POST|Access-Control-Allow-Headers:Content-Type</Value>
    			</Properties>
    Change this to:

    <Properties>
      <Property>	
         <Name>restUserHTTPHeaders</Name>
         <Value>Access-Control-Allow-Origin:*|Access-Control-Allow-Methods:OPTIONS,GET,PUT,DELETE,POST|Access-Control-Allow-Headers:Content-Type</Value>
      </Property>	
    </Properties>
    Let me know your progress.

    Thanks,
    Matt

  5. #5
    Join Date
    Mar 2016
    Posts
    3

    Default

    Dear Matt,
    My bad, I mix tab <Properties> and <Property>, it works now. You save my day.
    Thanks you very much

  6. #6
    Join Date
    May 2013
    Posts
    680

    Default

    Great, glad that helped. Thanks for the update.

    Matt

Similar Threads

  1. What is the "REST API is not licensed" error cause?
    By arrial in forum Wowza Streaming Engine REST API
    Replies: 5
    Last Post: 03-03-2016, 09:08 AM
  2. Replies: 1
    Last Post: 12-10-2015, 09:18 AM
  3. Replies: 1
    Last Post: 04-23-2015, 02:30 PM
  4. Replies: 1
    Last Post: 06-24-2013, 06:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •