I'm working on Open Network Video Interface Forum-Java project and following the steps described in the ONVIF Application Programmer's Guide.
I have generated sources from the wsdls
provided in ONVIF site. I'm able to retrieve the live stream URI using the media.wsdl
. Now I have an issue with recording. The codes that I have tried is given below:
RecordingService recording_ervice = new RecordingService();
RecordingPort record_port = recording_ervice.getRecordingPort();
BindingProvider bindingProvider = (BindingProvider) record_port;
// Add a security handler for the credentials
final Binding binding = bindingProvider.getBinding();
List<Handler> handlerList = binding.getHandlerChain();
if (handlerList == null) {
handlerList = new ArrayList<Handler>();
}
handlerList.add(new RecordStream.SecurityHandler());
// binding.setHandlerChain(handlerList);
// Set the actual web services address instead of the mock service
Map<String, Object> requestContext = bindingProvider.getRequestContext();
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + deviceip + "/onvif/media_service");
requestContext.put(BindingProvider.USERNAME_PROPERTY, user);
requestContext.put(BindingProvider.PASSWORD_PROPERTY, pass);
Recordings recordings = record_port.getRecordings();
The above code on run gives an error as:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Method 'ns11:GetServiceCapabilities' not implemented: method name or namespace not recognized
I also tried with media service, then the error is:
Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 405: Method Not Allowed