Commit 632926c4 by Patryk Czarnik

GetCountryInfo - przygotowanie zapytania

parent c44f3645
package saaj_klient.countries;
import jakarta.xml.soap.*;
import javax.xml.namespace.QName;
import java.io.IOException;
public class GetCountryInfo {
public static void main(String[] args) {
String szukanyKraj = "PL";
final String NS = "http://www.oorsprong.org/websamples.countryinfo";
try {
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage request = mf.createMessage();
SOAPBody requestBody = request.getSOAPBody();
SOAPBodyElement fullCountryInfo = requestBody.addBodyElement(new QName(NS, "FullCountryInfo"));
SOAPElement parametr = fullCountryInfo.addChildElement(new QName(NS, "sCountryISOCode"));
parametr.setTextContent(szukanyKraj);
System.out.println("Zapytanie:");
request.writeTo(System.out);
} catch (SOAPException | IOException e) {
e.printStackTrace();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment