Commit b9f90288 by Patryk Czarnik

Ujednolicenie definicji namespace-ów i WSDL

parent 861ce5fd
......@@ -13,8 +13,11 @@ import sklep.model.Order;
import sklep.model.Product;
// Na taki interfejs mówi się "service endpoint interface" (SEI)
@WebService
@WebService(name="Sklep",
targetNamespace=Sklep.NAMESPACE)
public interface Sklep {
static final String NAMESPACE = "http://sklep.alx.pl/";
@WebResult(name="product")
List<Product> wszystkieProdukty() throws DBException;
......
......@@ -11,29 +11,22 @@ import jakarta.xml.ws.WebServiceClient;
import jakarta.xml.ws.WebServiceFeature;
import sklep.soap.Sklep;
/**
* This class was generated by Apache CXF 3.5.2-jbossorg-4
* 2023-05-24T16:08:33.585+02:00
* Generated source version: 3.5.2-jbossorg-4
*
*/
@WebServiceClient(name = "SklepService",
wsdlLocation = "http://localhost:8080/PC31-SoapSerwer/Sklep?wsdl",
targetNamespace = "http://soap.sklep/")
@WebServiceClient(name="SklepService",
wsdlLocation=SklepService.ADRES_WSDL,
targetNamespace=Sklep.NAMESPACE)
public class SklepService extends Service {
final static String ADRES_WSDL = "http://localhost:8080/soap_serwer/SklepService?wsdl";
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://soap.sklep/", "SklepService");
public final static QName SklepPort = new QName("http://soap.sklep/", "SklepPort");
public final static QName SERVICE = new QName(Sklep.NAMESPACE, "SklepService");
public final static QName SklepPort = new QName(Sklep.NAMESPACE, "SklepPort");
static {
URL url = null;
try {
url = new URL("http://localhost:8080/PC31-SoapSerwer/Sklep?wsdl");
url = new URL(ADRES_WSDL);
} catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(SklepService.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "http://localhost:8080/PC31-SoapSerwer/Sklep?wsdl");
System.err.println("Can not initialize the default wsdl from " + ADRES_WSDL);
}
WSDL_LOCATION = url;
}
......@@ -50,38 +43,23 @@ public class SklepService extends Service {
super(WSDL_LOCATION, SERVICE);
}
public SklepService(WebServiceFeature ... features) {
public SklepService(WebServiceFeature... features) {
super(WSDL_LOCATION, SERVICE, features);
}
public SklepService(URL wsdlLocation, WebServiceFeature ... features) {
public SklepService(URL wsdlLocation, WebServiceFeature... features) {
super(wsdlLocation, SERVICE, features);
}
public SklepService(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
public SklepService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns Sklep
*/
@WebEndpoint(name = "SklepPort")
public Sklep getSklepPort() {
return super.getPort(SklepPort, Sklep.class);
}
/**
*
* @param features
* A list of {@link jakarta.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns Sklep
*/
@WebEndpoint(name = "SklepPort")
public Sklep getSklepPort(WebServiceFeature... features) {
return super.getPort(SklepPort, Sklep.class, features);
......
......@@ -16,7 +16,10 @@ import sklep.model.Order;
import sklep.model.Product;
import sklep.photo.PhotoUtil;
@WebService(endpointInterface="sklep.soap.Sklep")
@WebService(endpointInterface="sklep.soap.Sklep",
targetNamespace=Sklep.NAMESPACE,
serviceName="SklepService",
portName="SklepPort")
@MTOM
public class SklepImpl implements Sklep {
public List<Product> wszystkieProdukty() throws DBException {
......
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