Adding a Web Services interface to Wowza Server and integrate with .NET (dotNet)

https://www.wowza.com/docs/how-to-add-a-web-service-interface-to-wowza-media-server-and-integrate-with-net-dotnet

I really don’t know. Have not tried it with PHP. I guess I would dig in and see why it is not working.

BTW, I did update the wsdl URL on the post.

Charlie

Hi,

i have follow each step and checking for hours, but i still have a Class not found error from wsgen :frowning:

my objective is to call an wowza application method from an external server with a php script: a http get call to wowza for transmitting a message to a particular online user.

Maybe theyre are easyer solutions like checking a database or a text file from wowza application every minute (not very nice).

i’m working on wowza 2 server.

Thanks for your help,

Jerome.

I got “404 Not Found No context found for request” when I try to access “http://localhost:9091/wowzaprows?wsdl”.

I download a pre-built version of the web service from “https://www.wowza.com/downloads/forums/webservice/WebService.zip”, and then I do the following 3 steps:

1.Copy file lib/wms-plugin-wowzaserverws.jar to the [install-dir]/lib/ folder.

2.add the following properties to the container at the bottom of [install-dir]/conf/Server.xml:

wsIpAddress

localhost

wsPort

9091

Integer

wsServiceName

wowzaserverws

3.Edit conf/Server.xml and add the server listener to the section:

com.wowza.wms.plugin.test.ws.ServerListenerWowzaServerWS

After doing these steps, I restart Wowza Media Server, but only got the error as refered in the beginning.

I’m new to wowza and java, please help me. Thanks a lot!

I got “404 Not Found No context found for request” when I try to access “http://[ec2 IP]:9091/wowzaserverws?wsdl”.

  • Only change from documentation was my ip in the Property container
  • Added section to conf/Server.xml

When I browse to “http://[ec2 IP]:9091/wowzaserverws?wsdl” I consistently see the following error:

ERROR execute: java.util.concurrent.RejectedExecutionException

Once or twice, I’ve also seen:

ERROR WowzaServerWebService.host: com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Cannot assign requested address

Did i miss something in the configuration?

It is most likely easier to do this using a HTTPProvider. HTTPProviders are a way to add an HTTP interface to Wowza. Then yoiu should be able to call from PHP with a simple HTTP request.

Charlie

You can get the query parameters assocated with the HTTP request as part of the IHTTPRequest interface. I suggest you setup a test and play around with the API. It is pretty straight forward.

Charlie

Be sure you install the most recent patch:

https://www.wowza.com/devbuild.html

Charlie

I have not tried to run this on EC2. It does get pretty complicated fast. You may want to build this from source so you can make changes. Certainly EC2 may have problems trying to bind to localhost. So it might be better to bind to the internal IP adress.

Charlie

The IApplicationInstance.startMediaCasterStream does take two arguments:

appInstance.startMediaCasterStream(streamName, mediaCasterType);

But in this thread, the startMediaCasterStream method is a custom webmethod that takes 3 arguments starting with ApplicationInstance name which is used to get a reference to the application instance. Then, if you look into the body of the method, you will see the same as above:

appInstance.startMediaCasterStream(streamName, mediaCasterType);

Richard

Hi Charlie,

HTTP provider was my first choice but i thought that it was only made to get server information like this post : HTTProvider that returns detail server info.

I’m not sure about how to call a method of a specific running application and pass get parameters like that: mywowzaserver:1935?app=app_name&user=user_id&message=you_have_a_new_message

i know user_id because i manage session via mysql between php and WowzaServer.

Jerome.

i’ve succeded in using server info example for calling a client by adding this code to server info example code:

List<IClient> clients = appInstance.getClients();
Iterator<IClient> iter2 = clients.iterator();
 while(iter2.hasNext())
  {
  IClient client = iter2.next();
  if (!client.isConnected())
    continue;
  if ( (Integer.toString(appClient.getClientId())).equals(client_ref)  )
    client.call("server_message",null,"Hello from Wowza !");	
   }

it works but i suppose it could be possible if i know application name to directly call the target user without iteration over vhost, Application, ApplicationInstance ?

if i’m right, could you please help me for the correct syntax

Regards,

Jerome

Thanks for response!

Now I’ve install the most recent patch.

Finally, I found the 404 error generated because, url ‘http://localhost:9091/wowzaprows?wsdl’ should be ‘http://localhost:9091/wowzaserverws?wsdl’. the wsServiceName in the section is not the former but the latter.

However, another confused me is, when I run the following PHP code, I can’t get return value from the method getServerVersion(), the webbrowser echo nothing to me. yet the WowzaMediaServer2 window has the output like ‘…Developer 2.0.0.11 build23886’, which shows the calling to be effective.

<?php $client = new SoapClient("http://localhost:9091/wowzaserverws?wsdl"); $ver = $client->getServerVersion(); echo $ver; ?>

Any possible causes?


code of the getServerVersion() method is:

public String getServerVersion()

{

IServer server = Server.getInstance();

WMSLoggerFactory.getLogger(null).info("WowzaServerWebService.getServerVersion: "+server.getVersion());

return server.getVersion();

}

I found the cause of the problem.

The return value is a object, not a string, so the echo command dosen’t work.

I’ve successfully put this module into wowza and created a dll as per the instructions, I’ve got that into my .net project and can see the class just fine - infact I can recieve the getServerVersion() string perfectly.

I’m a little confused though about some of the arguments to the methods, particularly:

stopMediaCasterStream

and

startMediaCasterStream

for some reason stop requires 2 strings as arguments, and start requires 3, however when looking through the API these methods should only require 1 and 2 string arguments respectively.

Could someone explain how to use these please?

Dead on Charlie! When using EC2, the following webservice property has to be set to the internal IP on the instance & not the elastic IP or localhost. I’ll keep plugging away & let you know if I see any other oddities regarding webservice on EC2.

wsIpAddress

[INTERNAL IP]