Java 1.8 & SOAP & Maven

DagobertDokate

DagobertDokate

Dauergast
137
Kennt sich hier jemand mit SOAP-Anbindung in kombination mit maven aus?

lg. Dagobert
 
In wie fern?
Was hat SOAP mit maven zu tun?

SOAP ist erst mal ein sehr schwammiger Begriff.

und maven ein build tool.

Ich weiß gerade nicht wie du beides so in kombination bringen willst das man deine Frage sinnvoll beantworten kann. ^^
 
Ganz easy...
Ich hab von SOAP mal so null plan :D
Jetzt habe ich eine .wsdl Datei von nem Service... Daraus versuche ich nun die classes zu bauen...
Ich hab es mit wsimport versucht -> sobald ich die wsdl Datei verschieben... bzw nen anderen rechner benutze läuft dies nicht mehr..

Also mit Maven dran -> hab ich das org.codehaus.mojo:axistools-maven-plugin genommen und guck es mir gerade an...

Jedoch scheint die wsdl fehlerhaft zu sein... (komtm von nem .net service glaube ich)

Immerhin hab ich jetzt nen plugin so konfiguriert das es schon mal so tut als würde es arbeiten

Code:
<project
	xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>de.bachelor</groupId>
	<artifactId>client</artifactId>
	<version>0.0.1-SNAPSHOT</version>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.version>1.8</java.version>
		<log.version>1.2.17</log.version>
	</properties>
	<dependencies>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>${log.version}</version>
		</dependency>
	</dependencies>
	<build>
		<resources>
			<resource>
				<directory>src/main/java</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>axistools-maven-plugin</artifactId>
				<version>1.4</version>
				<configuration>
					<wsdlFiles>
						<wsdlFile>InhabitationService.wsdl</wsdlFile>
					</wsdlFiles>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>wsdl2java</goal>
						</goals>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>javax.mail</groupId>
						<artifactId>mail</artifactId>
						<version>1.4</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings 
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.cxf
										</groupId>
										<artifactId>
											cxf-codegen-plugin
										</artifactId>
										<versionRange>
											[${cxf.version},)
										</versionRange>
										<goals>
											<goal>wsdl2java</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>

Jedoch bekomme ich noch folgenden Fehler:
Code:
[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building client 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- axistools-maven-plugin:1.4:wsdl2java (default-cli) @ client ---
[INFO] about to add compile source root
[INFO] Processing wsdl: D:\programmieren\bachelorarbeit\Client\src\main\wsdl\InhabitationService.wsdl
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.193 s
[INFO] Finished at: 2014-09-02T14:01:18+01:00
[INFO] Final Memory: 8M/124M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:axistools-maven-plugin:1.4:wsdl2java (default-cli) on project client: Error generating Java code from WSDL. Error running Axis: Emitter failure.  There is an undefined binding (NetTcpBinding_IInhabitationService) in the WSDL document.
[ERROR] Hint: make sure <port binding=".."> is fully qualified.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Aber jemand der wohl mehr Ahnung als ich davon hat guckt gerade mal drüber...
Eigentlich war meine Frage vorhin nur wie ne passende pom aussehen sollte...

lg. Dagobert
 
Also ich hab mein Webservice client einfach mit eclipse gebaut :D
Die wsdl sollte halt auf dem Server liegen und von da angesprochen werden.

In Eclipse halt im Project Explorer auf New -> Webservice Client -> URL zur WSDL eintippen -> finish müsste eigentlich schon reichen.

Eclipse generiert dir dann alle nötigen Klassen und du kannst einfach auf ein normales Java Object zurückgreifen um auf dem Service zu arbeiten.
 

Ähnliche Themen

D
Antworten
23
Aufrufe
2.614
Data2006
D
L
Antworten
4
Aufrufe
1.347
lonnie9020
L
M
  • maksimilian
Antworten
4
Aufrufe
996
maksimilian
M
Zurück
Oben Unten