英文:
Generate classes java from a wsdl url - returning error 401
问题
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<!-- tag::wsdl[] -->
			<plugin>
				<groupId>org.jvnet.jaxb2.maven2</groupId>
				<artifactId>maven-jaxb2-plugin</artifactId>
				<version>0.14.0</version>
				<executions>
					<execution>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<schemaLanguage>WSDL</schemaLanguage>
					<generatePackage>ca.applications.linte.client.generate</generatePackage>
					<schemas>
						<schema>
							<url>http://localhost:8080/ws-consentement-sollicitation-web/ws/LNTEService.wsdl</url>
						</schema>
					</schemas>
				</configuration>
			</plugin>
			<!-- end::wsdl[] -->
		</plugins>
	</build>
英文:
I am trying to generate Java Classes from WSDL URL, but I am receiving an error 401.
I would like to know if I can configure it to input the username/password.
Obs.: If I download the .wsdl file and use it directly it works, but I would like to make something more automatic.
Here my code:
	<build>
			<plugins>
				<plugin>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-maven-plugin</artifactId>
				</plugin>
	      <!-- tag::wsdl[] -->
	      <plugin>
	          <groupId>org.jvnet.jaxb2.maven2</groupId>
	          <artifactId>maven-jaxb2-plugin</artifactId>
	          <version>0.14.0</version>
	          <executions>
	            <execution>
	              <goals>
	                <goal>generate</goal>
	              </goals>
	            </execution>
	          </executions>
	          <configuration>
	            <schemaLanguage>WSDL</schemaLanguage>
	            <generatePackage>ca.applications.linte.client.generate</generatePackage>
	            <schemas>
	              <schema>
	                <url>http://localhost:8080/ws-consentement-sollicitation-web/ws/LNTEService.wsdl</url>
	              </schema>
	            </schemas>
	          </configuration>
	      </plugin>
	      <!-- end::wsdl[] -->
				
			</plugins>
	</build>
答案1
得分: 2
这不受jaxb支持。请参考此答案:https://stackoverflow.com/questions/42137202/generate-a-schema-for-wsdl-with-http-authentication-and-the-maven-jaxb2-plugin。您可以尝试使用此中提到的方法。
英文:
This is not supported by jaxb. Please refer this answer: https://stackoverflow.com/questions/42137202/generate-a-schema-for-wsdl-with-http-authentication-and-the-maven-jaxb2-plugin. You could try using the hack mentioned in this.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论