I am generating the Onvif wsdls to JAVA client classes for android. The problem is: the schema has dependency to xop include, which migrated from http to https and generators can't handle redirect:
Retrieving schema at 'http://www.w3.org/2004/08/xop/include', relative to 'https://www.onvif.org/ver10/schema/onvif.xsd'.
[Fatal Error] include:1:1: Premature end of file.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:178)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.ksoap2.axis2.wsdl.WSDL2KSOAP2.main(Unknown Source)
The one solution is to remap offending namespace.
I had successfully run apache axf framework:
wsdl2java -xjc-Xbg -catalog "xml-catalog.xml" -autoNameResolution -verbose -client -d java_client $wsdl
with catalog file:
<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<rewriteURI uriStartString="http://www.onvif.org/onvif" rewritePrefix="onvif"/>
<rewriteURI uriStartString="http://docs.oasis-open.org" rewritePrefix="oasis-open"/>
<rewriteURI uriStartString="http://www.w3.org" rewritePrefix="w3"/>
</catalog>
This allows me to predownload schemas into filesystem and avoid online mess with https, by mapping the uris.
The problem is I am targeting android and most optimal way should be running ksoap android, for that I am trying to run wsdl2ksoap2-android to generate everything. Under the hood there is axis2 wsdl2java which seems does not have remaping functionality and does not support catalog. What is proper way should be replacing the schema? I am runing:
./wsdl2ksoap2.sh -uri https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl
Is there any way to fix http online schema, by allowing somehow to handle redirect from https to http?