我正在尝试创建一个使用Web服务的包。我一直在尝试从命令行创建包,如下所示:
wsimport -p gov.usda.nrcs.wcc.awdbWebService -s . ‘http://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL’
我收到此错误:
[ERROR] .\gov\usda\nrcs\wcc\awdbWebService\AreYouThere.java (The system cannot f
ind the path specified)
我之前没有从webservice创建过一个包,所以我很遗憾为什么我会收到这个错误。
网址包含数据:http://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL
编辑:::文件区域没有工作sicne它在c盘上。我创建了一个新目录并编译了所有内容,但是,我收到了这个错误:
f:\nrcs\gov\usda\nrcs\wcc\awdbWebService\package-info.java:1: error while writin
g gov.usda.nrcs.wcc.awdbWebService.package-info: could not create parent directo
ries
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.wcc.nrcs.usda.gov/n
s/awdbWebService")
^
1 error
compilation failed, errors should have been reported
编辑:::添加-verbose日志:
C:\Program Files\Java\jdk1.6.0_39\bin>wsimport -p gov.usda.nrcs.wcc.awdbWebServi
ce -s f:\nrcsws "http://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL" -ver
bose
parsing WSDL...
generating code...
gov\usda\nrcs\wcc\awdbWebService\AreYouThere.java
gov\usda\nrcs\wcc\awdbWebService\AreYouThereResponse.java
gov\usda\nrcs\wcc\awdbWebService\AveragesData.java
gov\usda\nrcs\wcc\awdbWebService\AveragesPeakData.java
gov\usda\nrcs\wcc\awdbWebService\AwdbWebService.java
gov\usda\nrcs\wcc\awdbWebService\AwdbWebService_Service.java
gov\usda\nrcs\wcc\awdbWebService\CentralTendencyData.java
gov\usda\nrcs\wcc\awdbWebService\CentralTendencyPeakData.java
gov\usda\nrcs\wcc\awdbWebService\CentralTendencyType.java
gov\usda\nrcs\wcc\awdbWebService\Configuration.java
gov\usda\nrcs\wcc\awdbWebService\Data.java
gov\usda\nrcs\wcc\awdbWebService\DataSource.java
gov\usda\nrcs\wcc\awdbWebService\DiagnosticException.java
gov\usda\nrcs\wcc\awdbWebService\DiagnosticStackTraceElement.java
gov\usda\nrcs\wcc\awdbWebService\DiagnosticTestResult.java
gov\usda\nrcs\wcc\awdbWebService\Diagnostics.java
gov\usda\nrcs\wcc\awdbWebService\Duration.java
gov\usda\nrcs\wcc\awdbWebService\Element.java
gov\usda\nrcs\wcc\awdbWebService\Forecast.java
gov\usda\nrcs\wcc\awdbWebService\ForecastEquation.java
gov\usda\nrcs\wcc\awdbWebService\ForecastEquationTerm.java
gov\usda\nrcs\wcc\awdbWebService\ForecastFull.java
gov\usda\nrcs\wcc\awdbWebService\ForecastPeriod.java
gov\usda\nrcs\wcc\awdbWebService\ForecastPeriodAverage.java
gov\usda\nrcs\wcc\awdbWebService\ForecastPeriodCentralTendency.java
gov\usda\nrcs\wcc\awdbWebService\ForecastPoint.java
gov\usda\nrcs\wcc\awdbWebService\GetAllForecastsForStation.java
gov\usda\nrcs\wcc\awdbWebService\GetAllForecastsForStationResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetAveragesData.java
gov\usda\nrcs\wcc\awdbWebService\GetAveragesDataResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetAveragesPeak.java
gov\usda\nrcs\wcc\awdbWebService\GetAveragesPeakResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetCentralTendencyData.java
gov\usda\nrcs\wcc\awdbWebService\GetCentralTendencyDataResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetCentralTendencyPeakData.java
gov\usda\nrcs\wcc\awdbWebService\GetCentralTendencyPeakDataResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetData.java
gov\usda\nrcs\wcc\awdbWebService\GetDataResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetElement.java
gov\usda\nrcs\wcc\awdbWebService\GetElementResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetElements.java
gov\usda\nrcs\wcc\awdbWebService\GetElementsResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecast.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastConfigurations.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastConfigurationsResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastEquations.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastEquationsMultiple.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastEquationsMultipleResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastEquationsResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastPeriodAverages.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastPeriodAveragesResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastPeriodCentralTendency.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastPeriodCentralTendencyResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastPeriods.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastPeriodsResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastPoint.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastPointResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastPoints.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastPointsResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastValue.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastValueResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecasts.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastsByPubDate.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastsByPubDateResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetForecastsResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetHeightDepths.java
gov\usda\nrcs\wcc\awdbWebService\GetHeightDepthsResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetHourlyData.java
gov\usda\nrcs\wcc\awdbWebService\GetHourlyDataResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetInstantaneousData.java
gov\usda\nrcs\wcc\awdbWebService\GetInstantaneousDataResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetPeakData.java
gov\usda\nrcs\wcc\awdbWebService\GetPeakDataResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetReservoirMetadata.java
gov\usda\nrcs\wcc\awdbWebService\GetReservoirMetadataMultiple.java
gov\usda\nrcs\wcc\awdbWebService\GetReservoirMetadataMultipleResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetReservoirMetadataResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetStationDataAssuredFlags.java
gov\usda\nrcs\wcc\awdbWebService\GetStationDataAssuredFlagsResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetStationElements.java
gov\usda\nrcs\wcc\awdbWebService\GetStationElementsResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetStationMetadata.java
gov\usda\nrcs\wcc\awdbWebService\GetStationMetadataMultiple.java
gov\usda\nrcs\wcc\awdbWebService\GetStationMetadataMultipleResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetStationMetadataResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetStations.java
gov\usda\nrcs\wcc\awdbWebService\GetStationsResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetUnitName.java
gov\usda\nrcs\wcc\awdbWebService\GetUnitNameResponse.java
gov\usda\nrcs\wcc\awdbWebService\GetUnits.java
gov\usda\nrcs\wcc\awdbWebService\GetUnitsResponse.java
gov\usda\nrcs\wcc\awdbWebService\HeightDepth.java
gov\usda\nrcs\wcc\awdbWebService\HourlyData.java
gov\usda\nrcs\wcc\awdbWebService\HourlyDataValue.java
gov\usda\nrcs\wcc\awdbWebService\InstantaneousData.java
gov\usda\nrcs\wcc\awdbWebService\InstantaneousDataFilter.java
gov\usda\nrcs\wcc\awdbWebService\InstantaneousDataValue.java
gov\usda\nrcs\wcc\awdbWebService\MonthAndDay.java
gov\usda\nrcs\wcc\awdbWebService\ObjectFactory.java
gov\usda\nrcs\wcc\awdbWebService\PeakData.java
gov\usda\nrcs\wcc\awdbWebService\Predictor.java
gov\usda\nrcs\wcc\awdbWebService\PredictorGroup.java
gov\usda\nrcs\wcc\awdbWebService\ReservoirMetadata.java
gov\usda\nrcs\wcc\awdbWebService\RunDiagnostics.java
gov\usda\nrcs\wcc\awdbWebService\RunDiagnosticsResponse.java
gov\usda\nrcs\wcc\awdbWebService\StationDataAssuredFlags.java
gov\usda\nrcs\wcc\awdbWebService\StationElement.java
gov\usda\nrcs\wcc\awdbWebService\StationMetaData.java
gov\usda\nrcs\wcc\awdbWebService\Unit.java
gov\usda\nrcs\wcc\awdbWebService\UnitSystem.java
gov\usda\nrcs\wcc\awdbWebService\package-info.java
compiling code...
javac -d C:\Program Files\Java\jdk1.6.0_39\bin\. -classpath C:\Program Files\Jav
a\jdk1.6.0_39\lib\tools.jar;C:\Program Files\Java\jdk1.6.0_39\classes -Xbootclas
spath/p:C:\Program Files\Java\jdk1.6.0_39\jre\lib\rt.jar;C:\Program Files\Java\j
dk1.6.0_39\jre\lib\rt.jar f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\AreYouThere
.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\AreYouThereResponse.java f:\nrc
sws\gov\usda\nrcs\wcc\awdbWebService\AveragesData.java f:\nrcsws\gov\usda\nrcs\w
cc\awdbWebService\AveragesPeakData.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebServi
ce\AwdbWebService.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\AwdbWebService
_Service.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\CentralTendencyData.jav
a f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\CentralTendencyPeakData.java f:\nrc
sws\gov\usda\nrcs\wcc\awdbWebService\CentralTendencyType.java f:\nrcsws\gov\usda
\nrcs\wcc\awdbWebService\Configuration.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebS
ervice\Data.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\DataSource.java f:\n
rcsws\gov\usda\nrcs\wcc\awdbWebService\DiagnosticException.java f:\nrcsws\gov\us
da\nrcs\wcc\awdbWebService\DiagnosticStackTraceElement.java f:\nrcsws\gov\usda\n
rcs\wcc\awdbWebService\DiagnosticTestResult.java f:\nrcsws\gov\usda\nrcs\wcc\awd
bWebService\Diagnostics.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\Duration
.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\Element.java f:\nrcsws\gov\usda
\nrcs\wcc\awdbWebService\Forecast.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebServic
e\ForecastEquation.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\ForecastEquat
ionTerm.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\ForecastFull.java f:\nrc
sws\gov\usda\nrcs\wcc\awdbWebService\ForecastPeriod.java f:\nrcsws\gov\usda\nrcs
\wcc\awdbWebService\ForecastPeriodAverage.java f:\nrcsws\gov\usda\nrcs\wcc\awdbW
ebService\ForecastPeriodCentralTendency.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWeb
Service\ForecastPoint.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetAllFore
castsForStation.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetAllForecastsF
orStationResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetAveragesDat
a.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetAveragesDataResponse.java f
:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetAveragesPeak.java f:\nrcsws\gov\usd
a\nrcs\wcc\awdbWebService\GetAveragesPeakResponse.java f:\nrcsws\gov\usda\nrcs\w
cc\awdbWebService\GetCentralTendencyData.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWe
bService\GetCentralTendencyDataResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWeb
Service\GetCentralTendencyPeakData.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebServi
ce\GetCentralTendencyPeakDataResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebSe
rvice\GetData.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetDataResponse.ja
va f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetElement.java f:\nrcsws\gov\usda
\nrcs\wcc\awdbWebService\GetElementResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awd
bWebService\GetElements.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetEleme
ntsResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetForecast.java f:\
nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetForecastConfigurations.java f:\nrcsws
\gov\usda\nrcs\wcc\awdbWebService\GetForecastConfigurationsResponse.java f:\nrcs
ws\gov\usda\nrcs\wcc\awdbWebService\GetForecastEquations.java f:\nrcsws\gov\usda
\nrcs\wcc\awdbWebService\GetForecastEquationsMultiple.java f:\nrcsws\gov\usda\nr
cs\wcc\awdbWebService\GetForecastEquationsMultipleResponse.java f:\nrcsws\gov\us
da\nrcs\wcc\awdbWebService\GetForecastEquationsResponse.java f:\nrcsws\gov\usda\
nrcs\wcc\awdbWebService\GetForecastPeriodAverages.java f:\nrcsws\gov\usda\nrcs\w
cc\awdbWebService\GetForecastPeriodAveragesResponse.java f:\nrcsws\gov\usda\nrcs
\wcc\awdbWebService\GetForecastPeriodCentralTendency.java f:\nrcsws\gov\usda\nrc
s\wcc\awdbWebService\GetForecastPeriodCentralTendencyResponse.java f:\nrcsws\gov
\usda\nrcs\wcc\awdbWebService\GetForecastPeriods.java f:\nrcsws\gov\usda\nrcs\wc
c\awdbWebService\GetForecastPeriodsResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awd
bWebService\GetForecastPoint.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\Get
ForecastPointResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetForecas
tPoints.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetForecastPointsRespons
e.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetForecastResponse.java f:\nr
csws\gov\usda\nrcs\wcc\awdbWebService\GetForecastValue.java f:\nrcsws\gov\usda\n
rcs\wcc\awdbWebService\GetForecastValueResponse.java f:\nrcsws\gov\usda\nrcs\wcc
\awdbWebService\GetForecasts.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\Get
ForecastsByPubDate.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetForecastsB
yPubDateResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetForecastsRes
ponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetHeightDepths.java f:\nr
csws\gov\usda\nrcs\wcc\awdbWebService\GetHeightDepthsResponse.java f:\nrcsws\gov
\usda\nrcs\wcc\awdbWebService\GetHourlyData.java f:\nrcsws\gov\usda\nrcs\wcc\awd
bWebService\GetHourlyDataResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebServic
e\GetInstantaneousData.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetInstan
taneousDataResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetPeakData.
java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetPeakDataResponse.java f:\nrcs
ws\gov\usda\nrcs\wcc\awdbWebService\GetReservoirMetadata.java f:\nrcsws\gov\usda
\nrcs\wcc\awdbWebService\GetReservoirMetadataMultiple.java f:\nrcsws\gov\usda\nr
cs\wcc\awdbWebService\GetReservoirMetadataMultipleResponse.java f:\nrcsws\gov\us
da\nrcs\wcc\awdbWebService\GetReservoirMetadataResponse.java f:\nrcsws\gov\usda\
nrcs\wcc\awdbWebService\GetStationDataAssuredFlags.java f:\nrcsws\gov\usda\nrcs\
wcc\awdbWebService\GetStationDataAssuredFlagsResponse.java f:\nrcsws\gov\usda\nr
cs\wcc\awdbWebService\GetStationElements.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWe
bService\GetStationElementsResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebServ
ice\GetStationMetadata.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetStatio
nMetadataMultiple.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetStationMeta
dataMultipleResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetStationM
etadataResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetStations.java
f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetStationsResponse.java f:\nrcsws\g
ov\usda\nrcs\wcc\awdbWebService\GetUnitName.java f:\nrcsws\gov\usda\nrcs\wcc\awd
bWebService\GetUnitNameResponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\
GetUnits.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\GetUnitsResponse.java f
:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\HeightDepth.java f:\nrcsws\gov\usda\nr
cs\wcc\awdbWebService\HourlyData.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService
\HourlyDataValue.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\InstantaneousDa
ta.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\InstantaneousDataFilter.java
f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\InstantaneousDataValue.java f:\nrcsws
\gov\usda\nrcs\wcc\awdbWebService\MonthAndDay.java f:\nrcsws\gov\usda\nrcs\wcc\a
wdbWebService\ObjectFactory.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\Peak
Data.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\Predictor.java f:\nrcsws\go
v\usda\nrcs\wcc\awdbWebService\PredictorGroup.java f:\nrcsws\gov\usda\nrcs\wcc\a
wdbWebService\ReservoirMetadata.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\
RunDiagnostics.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\RunDiagnosticsRes
ponse.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\StationDataAssuredFlags.ja
va f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\StationElement.java f:\nrcsws\gov\
usda\nrcs\wcc\awdbWebService\StationMetaData.java f:\nrcsws\gov\usda\nrcs\wcc\aw
dbWebService\Unit.java f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\UnitSystem.jav
a f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\package-info.java
f:\nrcsws\gov\usda\nrcs\wcc\awdbWebService\package-info.java:1: error while writ
ing gov.usda.nrcs.wcc.awdbWebService.package-info: could not create parent direc
tories
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.wcc.nrcs.usda.gov/n
s/awdbWebService")
^
1 error
compilation failed, errors should have been reported
C:\Program Files\Java\jdk1.6.0_39\bin>
答案 0 :(得分:2)
奇怪它对我有用。请尝试以下方法:
wsimport -p gov.usda.nrcs.wcc.awdbWebService -s . http://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL
wsimport -p gov.usda.nrcs.wcc.awdbWebService -s . services.wsdl
请告诉我上述哪项有效,或者您是否还遇到问题!
根据评论中引用的讨论更新
看起来这与this bug有关,但我不确定。无论哪种方式,解决方案都是分两步完成:
命令行:
C:\>mkdir nrcs
C:\>mkdir nrcs\src
C:\>mkdir nrcs\bin
C:\>wsimport -s C:\nrcs\src -p gov.usda.nrcs.wcc.awdbWebService -Xnocompile -verbose http://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL
C:\>javac -d C:\nrcs\bin C:\nrcs\src\gov\usda\nrcs\wcc\awdbWebService\*.java
C:\>jar cf C:\nrcs\nrcs.jar -C C:\nrcs\bin .
我还添加了一个jar步骤,以便可以将生成的jar添加到Java项目中。