SOAP in Java

FBlack11

Mitglied
Hallo,

ich weiss man soll hier nicht ohne konkrete Lösungsvorschläge posten, aber ich bin ziemlich verzweifelt. Ich muss innerhalb von Java SOAP einsetzen um Daten abzufragen. Bin ziemlicher Anfänger und finde im Netz nichts für mich verständliches und die Zeit läuft mir davon. Es geht darum diesen Service einzubinden: http://www.iban-bic.com/fileadmin/SOAP-Schnittstelle.pdf

Was mir nicht hilft:
Ein komplett fertiger Code, denn dadurch liegt es zwar vor, aber ich verstehe es nach wie vor nicht.

Was mir hilft:
Eine Schritt-für-Schritt-Anleitung, die ich nachvollziehen kann, damit ich verstehe was wann wie getan wird.

Wenn das für hier zuviel ist gebe ich gern auf Anfrage meine Mail-Adresse weiter. Ich hoffe das mir hier irgendwer helfen kann, ich weiss sonst nicht was ich tun soll und davon hängt nicht wenig für mich ab.

Danke im voraus, hoffentlich kann mir jemand helfen.

Ein verzweifelter Anfänger
 

mvitz

Top Contributor
Im groben musst du folgende Dinge erledigen:

  1. Dich für ein Java SOAP Framework entscheiden
  2. Mithilfe des Frameworks und der WSDL (Befindet sich in dem PDF ganz am Schluss) Java Code generieren
  3. Deinen Client schreiben und dabei die generierten Klassen nutzen

Mit Axis2 (das wäre dann Schritt 1) geht das ungefähr so Apache Axis2 - Apache Axis2 User's Guide- Creating Clients (Schritt 2). Schritt 3 kannst du dann nochmal hier posten wie du das versucht hast.
 

FBlack11

Mitglied
Versuche mich daran mittels Eclipse. Dieses meldet mir aber mir unverständliche Fehler:

Java:
<wsdl:portType name="IBAN CalculatorPortType">
	<wsdl:operation name="validate_iban">
		<wsdl:documentation>
			Validates the given IBAN. The user ID and password you need to pass with the request are the same
			you use for logging in as a premium user. This service is available to all premium users who have paid
			their subscription fee. For more details on the subscription model, see www.iban-bic.com.<br>
			Output fields are:<br>
			iban: the IBAN that was validated.<br>
			result: 'passed' or 'failed' - for a valid or invalid IBAN<br>
			checks: an array of the checks performed (can contain elements such as 'length', 'bank_code',
			'account_number', 'iban_checksum').<br>
			bic_candidates: an array of BICs that are associated with the given national bank code. May be empty
			or may contain one or more elements. The BICstruct element has the attributes bic, wwwcount,
			sampleurl, and city. If a wwwcount greater than zero is given, the BIC was harvested from the Web
			(and found on as many pages as indicated by wwwcount, for example at the URL given by sampleurl).
			If wwwcount is zero, the BIC comes from a national bank or the ECB. If city is given, this also
			indicates that the BIC comes from a national bank or the ECB. The given city does not necessarily
			reflect the location of the given branch - it can also be the location of the headquarters.<br>
			country: the ISO country code (first two letters of the IBAN)<br>
			bank_code: the national bank code. Part of the BIC for NL (where no national bank code exists).<br>
			bank: bank name, if known<br>
			bank_address: some address data, if known<br>
			bank_url: URL of website, if known<br>
			branch: branch name, if known<br>
			branch_code: branch code, if known<br>
			account_number: the national bank account number<br>
			account_validation_method: name of the validation algorithm for the national account number<br>
			account_validation: for German or Swiss account numbers, an explanation (in German)<br>
			length_check: 'passed' or 'failed' - for the right number of characters for the given country<br>
			account_check (not provided for every country): 'passed' or 'failed' (checksum validation; if the
			algorithm is unknown, or if there is no checksum, the result is 'passed' or empty).<br>
			bank_code_check (not provided for every country): lookup of national bank code was successful
			('passed') or not ('failed')<br>
			iban_checksum_check: 'passed' or 'failed' (correctness of the two digits right after the country code in
			the IBAN)<br>
			data_age (not given for all countries): age of the BIC and other bank-related data (not defined for data
			harvested from the Web). Format: yyyymmdd.<br>
			IBANformat: a string describing the IBAN format for the given country, for example: 'DEkk BBBB
			BBBB CCCC CCCC CC'.<br>
			formatcomment: an explanation of the IBANformat string, for example: 'B = sort code (BLZ), C =
			account No.'<br>
			balance: the number of remaining calculations you can do before having to recharge your account. This
			does not apply to customers with a subscription which includes an unlimited number of calculations.
		</wsdl:documentation>
...
</wsdl:portType>

Zum portType:
cvc-attribute.3: The value 'IBAN CalculatorPortType' of attribute 'name' on element 'wsdl:portType' is not valid with respect to its type, 'NCName'.
cvc-datatype-valid.1.2.1: 'IBAN CalculatorPortType' is not a valid value for 'NCName'.

Und für den mitkopierten documentation-Bereich:
Description Resource Path Location Type
The element type "br" must be terminated by the matching end-tag "</br>".

Habe keine Ahnung warum und welches <br> Eclipse da kritisiert und was den portType angeht, wie gesagt, bin noch nicht so firm.
 

FBlack11

Mitglied
Hab mich durchgewühlt. Nur kaum sind Fehler beseitigt präsentiert mir Eclipse neue, vorher nich dagewesene Fehler. Hier ist für mich (vorerst) Ende den Fahnenstange:

Java:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="https://ssl.ibanrechner.de/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="eap" targetNamespace="https://ssl.ibanrechner.de/">
  <wsdl:types>
    <xsd:schema targetNamespace="https://ssl.ibanrechner.de/">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>                        <<< 1
      <xsd:complexType name="ArrayOfString">
        <xsd:complexContent>
          <xsd:restriction base="SOAP-ENC:Array">
            <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
      <xsd:complexType name="BICStruct">
        <xsd:all>
          <xsd:element name="bic" type="xsd:string"/>                                   <<< 2
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="wwwcount" type="xsd:int"/>
          <xsd:element name="sampleurl" type="xsd:string"/>
        </xsd:all>
      </xsd:complexType>
      <xsd:complexType name="ArrayOfBICStruct">
        <xsd:complexContent>
          <xsd:restriction base="SOAP-ENC:Array">
            <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="BICStruct[]"/>      <<< 3
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
...

Bei allen drei jeweils:

s4s-att-invalid-value: Invalid attribute value for 'base' in element 'restriction'. Recorded reason: UndeclaredPrefix: Cannot resolve 'SOAP-ENC:Array' as a QName: the prefix 'SOAP-ENC' is not declared.

s4s-att-must-appear: Attribute 'base' must appear in element 'restriction'.

Hier verlässt mich mein noch recht bescheidenes Latein. Ich hoffe jemand kann mir weiterhelfen. Auf jeden Fall schonmal riesig Danke für die bisherigen Mühen.
 

FBlack11

Mitglied
So, habe inzwischen Axis2 installiert. Mein Problem ist SOAP-ENC, das bekomme ich nicht hin. Sobald ich das in die Definitions aufnehme funktioniert der Encoding-Namespace nicht mehr und in der Restriction ist ein nicht definierter complexType. Lasse ich es bei den Definitions weg ist SOAP-ENC ungebunden und dementsprechend nicht nutzbar. An dieser Stelle brauche ich wirklich Hilfe, hier komme ich nicht weiter.
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
T SOAP mit Java ohne HTTP Server möglich? XML & JSON 3
H soap message in java klasse speichern XML & JSON 10
M SOAP-Client funktioniert plötzlich nicht mehr XML & JSON 2
LimDul SOAP & Rest Service - Contract First XML & JSON 2
W Method Overloading SOAP-Schnittstelle XML & JSON 2
W Erzeugen einer Handlerklasse zum Abfangen von SOAP-Requests XML & JSON 13
L Soap Nachricht Content Encoding Gzip XML & JSON 6
X JDom für SOAP Dateien geeignet? XML & JSON 3
J SOAP auf HTTPS mit Authentifizierung XML & JSON 3
K Axis SOAP Client und https XML & JSON 3
F Erste Schritte: soap client XML & JSON 7
J Soap über Axis XML & JSON 3
W jaxws jaxb wsdl Java-Klassen generieren und binding.xml verwenden XML & JSON 1
iman XML Attribute mit JAVA einlesen mit Spring Batch XML & JSON 0
T Tags in XML Datei mit Java erstellen XML & JSON 3
E JAXB und java.nio.file.Path XML & JSON 4
B XML-Daten mit SAX Parser verarbeiten in Java XML & JSON 4
S Java REST Client + Json XML & JSON 8
L Lässt sich folgendes so oder so ähnlich mit Java und XML umsetzen XML & JSON 3
K XML Datei erstellen und Daten daraus in Java auslesen XML & JSON 6
L login - Java IOException jaas.config File or Directory not present XML & JSON 1
M Text eines Elements in XML Datei mit JAVA bearbeiten und kompletten Element-Zweig hinzufügen XML & JSON 16
J JSON zu Java mit der GSON Google API XML & JSON 0
B JAXB - java.util.Locale does not have a no-arg default constructor XML & JSON 2
E JAVA simple.JSONObject cannot be cast to simple.JSONArray XML & JSON 9
P Einheiten in Java XML & JSON 4
T Visualisierung von XML Dateien in einer Java SwingGui XML & JSON 11
A WSDL und Java XML & JSON 5
A XMLRPC für Java XML & JSON 3
S XML auf Java Klassen Mappen XML & JSON 10
N Java XML schreiben funktioniert nicht XML & JSON 1
B aus xsd Java Klassen generieren XML & JSON 3
MiMa Mehrfachvariablen in Java durch XML XML & JSON 4
Q XML-File als Objekt in Java XML & JSON 6
Q Konvertierung von json zum Java Objekt nach vorgegebenem Schema XML & JSON 3
AMStyles XPATH Befehl SVG Java XML & JSON 2
S Wie aktualisiert man den Java-Kode mit FOP1.0? XML & JSON 1
L XSL: Aufruf Java-class XML & JSON 11
N Java Code aus XML Datei generieren XML & JSON 8
GUI-Programmer java.io.File aus .jar beziehen XML & JSON 6
A Unterschiedliche Datenstruktur XML <-> Java mappen XML & JSON 9
R XSD aus Java Klassen erzeugen?? XML & JSON 2
N xsd pattern in java einlesen XML & JSON 6
M java.lang.RuntimeException: Failed to parse document XML & JSON 4
Q Atom/RSS-Feed lesen - per XSD zu Java-Code XML & JSON 4
S JAXB 2 und Java Annotationen/Interfaces generieren XML & JSON 3
N Google Wetter XML (nur current_condition) auslesen mit Java XML & JSON 15
F Einlesen von JDBC connection in Java von XML XML & JSON 4
D xsd->java mit Eclipse?! oder wie? XML & JSON 27
M Probleme mit XPath bei Java XML & JSON 5
_dp Java XML Parse error: findet end-tags nicht XML & JSON 10
V JAXB schema 2 java XML & JSON 3
S XJC --> Java-Objects compile Problem XML & JSON 4
G Mit JSON Java und C# verbinden XML & JSON 4
K XML Datei in ein Java package „einbinden" XML & JSON 3
H Java - XML - Rekursion - Verwirrung XML & JSON 6
F XML Datei in Java einlesen XML & JSON 4
J XSD > XML > Java XML & JSON 7
F XML mit Java XML & JSON 2
algorismi SVG Datein mit Batik in Java reinladen XML & JSON 3
S Java - Klassen erzeugen aus xsd bzw. wsdl XML & JSON 3
D ID's aus XML Datei rauslesen und in Java ausgeben XML & JSON 7
N value Wert einer XML Datei mit JAVA bearbeiten XML & JSON 21
Mike90 -xlsx Dateien in Java lesen XML & JSON 3
T StAX / SAX => Wie XML Datenstruktur in Java abbilden? XML & JSON 2
H XML plattformunabhängig/Open Source für Java XML & JSON 4
C Java-Imports bei Jaxb XML & JSON 8
slawaweis Problem mit XSLT (wahrscheinlich ein Bug in Java 6) XML & JSON 16
Fadi .classpath(XML) mit Java lesen XML & JSON 2
M Frage zu Erklärung im Online book "Java ist auch eine I XML & JSON 4
M Problem mit FOP in Java Programm XML & JSON 2
H Fop / Java /Fonts XML & JSON 6
H XSL Aufruf via Java mit neuen Fonts XML & JSON 9
T Java Klasse für gegebenes XML erstellen XML & JSON 4
M Xlink in Java-Objekt umwandeln XML & JSON 9
S Jdom+java webstart XML & JSON 4
P Einstieg in XML mit Java XML & JSON 3
G MS-Word Dokument mit Java erstellen XML & JSON 2
N AXIOM mit Java 1.4 XML & JSON 4
J DTD in Java integrieren? XML & JSON 3
L XML Datei in Java angeben Pfad? XML & JSON 3
G Problem mit XML-Schema Validierung mit Java XML & JSON 12
G XML mit JAVA an URL senden (http post) XML & JSON 12
D Java DOM Ausgabe ohne XML header XML & JSON 4
S XML Strings in JAVA einlesen, aber wie? XML & JSON 8
S Java 6 und Xerces-j-2-9 XML & JSON 3
E XML mit java einlesn XML & JSON 2
L mit Java eine HTML-Datei erstellen XML & JSON 3
O OpenDocument-Tabelle mit Java lesen und schreiben XML & JSON 3
G JAVA und DOM XML & JSON 2
M Java und XSLT: Performanz-Problem XML & JSON 5
P DTD -> Java XML & JSON 4
K xml --> sax --> java objekthierarchie XML & JSON 2
B DTD aus Java erzeugen XML & JSON 2
S JAVA XML Parser der einen String parst XML & JSON 3
K java + xpath -> performanceproblem XML & JSON 9
J schema-Validierung mit xerces und jdom: bug in java 1.4? XML & JSON 9
A Kann XML weitere XMLs inkludieren? Oder kann es Java? XML & JSON 5
vogella *Erledigt* XML und Java DOM Tutorial XML & JSON 3
C HTML-Befehle per Java entfernen XML & JSON 7

Ähnliche Java Themen

Neue Themen


Oben