Commit b9f90288 by Patryk Czarnik

Ujednolicenie definicji namespace-ów i WSDL

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