Closed zebity closed 1 year ago
Underlying issues is possibly that ONVIF is using a "dead-end" namespace for its binding definition: http://schemas.xmlsoap.org/soap/http
This gets redirected (multiple time) to a link which just contains empty file (mostly nulls).
Resolution was to change the server EndPoint create/public to explicity use SOAP 1.2 / HTTP Binding as per Jakarta specification:
Where String constant: SOAPBinding.SOAP12HTTP_BINDING == http://www.w3.org/2003/05/soap/bindings/HTTP/
EndPoint create/publish code change to create SOAP 1.2 service:
String soapver = SOAPBinding.SOAP11HTTP_BINDING;
if (ver.equals("12"))
soapver = SOAPBinding.SOAP12HTTP_BINDING;
String uri = "http://127.0.0.1:" + port + request;
Endpoint ep = Endpoint.create(soapver, device);
ep.publish(uri);
This works with both Javax and Jakarta namespace, with difference in import statements to reflect JavaEE vs JakartaEE cases.
See commit: f471f3b146021ccf462544a23eb15bbb61fe6441
Also more details on blog page Appendix "D. ONVIF SOAP Binding URL Goes to Dead End"
Issue:
Testing client and server code generation with JAX-WS SOAP Web Services it seems that the client is generating SOAP 1.2 requests while the server is providing SOAP 1.1 service.
SOAP 1.1 uses HTTP "Content-Type: text/xml" SOAP 1.2 uses HTTP "Content-Type: application/xml+soap"
Result is that get exception due to having incompatible media types
Need to either change client to use SOAP 1.1 or change server to use provide SOAP 1.2
Environment:
Ubuntu: 22.04 OpenJDK: 11
Maven Dependencies:
JAVA EE/JAKARTA TRANSITIONAL:
NOTE: Same problem using more current Jakarta dependencies
Testing:
via curl and generated Java code.
See here for details: ONVIF Web Services Client Consumption with Java