我想在C代碼中使用web服務。我正在努力成爲一名客戶。我需要做一些Axis2java的工作,並從wsdl文件生成類。 我發現Axis2c使(.c)文件從wsdl文件生成。 我從here下載了它。解壓縮它。我爲AXIS2C_HOME創建了環境變量,並創建了AXIS2C_CLASSPATH。 但我無法使它工作。如何使用Axis2c從WSDL文件生成C文件
當我鍵入此命令:
WSDL2C -uri -ss -sd -d none -u -f -o
我得到這個錯誤:
echo off Error: Could not find or load main class org.apache.axis2.wsdl.WSDL2C
我怎麼能解決這個問題。請告訴我如何正確使用這個Axis2c工具。
預先感謝您。
@loentar:我安裝了Axis2/Java,併爲其設置了環境變量。我現在運行wsdl2c.bat我得到這個:
E:\dev\Tools\axis2c-bin-1.6.0-win32\bin\tools\wsdl2c>WSDL2C.bat E:\dev\Tools\axis2c-bin-1.6.0-win32\bin\tools\wsdl2c>echo off Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) where options include: -d32 use a 32-bit data model if available -d64 use a 64-bit data model if available -server to select the "server" VM The default VM is server. -cp -classpath A ; separated list of directories, JAR archives, and ZIP archives to search for class files. -D= set a system property -verbose:[class|gc|jni] enable verbose output -version print product version and exit -version: require the specified version to run -showversion print product version and continue -jre-restrict-search | -no-jre-restrict-search include/exclude user private JREs in the version search -? -help print this help message -X print help on non-standard options -ea[:...|:] -enableassertions[:...|:] enable assertions with specified granularity -da[:...|:] -disableassertions[:...|:] disable assertions with specified granularity -esa | -enablesystemassertions enable system assertions -dsa | -disablesystemassertions disable system assertions -agentlib:[=] load native agent library , e.g. -agentlib:hprof see also, -agentlib:jdwp=help and -agentlib:hprof=help -agentpath:[=] load native agent library by full pathname -javaagent:[=] load Java programming language agent, see java.lang.instrument -splash: show splash screen with specified image See http://www.oracle.com/technetwork/java/javase/documentation/index.html for m ore details.
後,我運行此命令:
E:\dev\Tools\axis2c-bin-1.6.0-win32\bin\tools\wsdl2c>WSDL2C.bat -uri hello.wsdl -u -uw E:\dev\Tools\axis2c-bin-1.6.0-win32\bin\tools\wsdl2c>echo off Unrecognized option: -uri Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
我能做些什麼? 我正在使用Windows 8的方式。
我仍然無法使它工作。我在上面的問題中解釋過。 – 2015-01-25 07:09:18