Skip to content

Commit

Permalink
updated WSDL and some general tidyup
Browse files Browse the repository at this point in the history
  • Loading branch information
briansjavablog committed Jun 13, 2019
1 parent b0821a5 commit cca6c6b
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 147 deletions.
27 changes: 12 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,15 @@
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand All @@ -70,15 +66,16 @@
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>src/generated/java</sourceRoot>
<sourceRoot>${basedir}/src/generated/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/Accounts.wsdl</wsdl>
<wsdl>${basedir}/src/main/resources/wsdl/Accounts.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
Expand All @@ -90,4 +87,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.demo;
package com.blog.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication(scanBasePackages= { "com.demo.config", "com.demo.service" })
@SpringBootApplication(scanBasePackages= { "com.blog.demo.config", "com.blog.demo.service" })
public class Application {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.demo.config;
package com.blog.demo.config;

import javax.xml.ws.Endpoint;

Expand All @@ -13,7 +13,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import com.demo.service.AccountServiceEndpoint;
import com.blog.demo.service.AccountServiceEndpoint;

@Configuration
public class ApplicationConfig {
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/blog/demo/service/AccountService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.blog.demo.service;

import com.blog.demo.webservices.accountservice.AccountDetailsRequest;
import com.blog.demo.webservices.accountservice.AccountDetailsResponse;

public interface AccountService {

AccountDetailsResponse getAccountDetails(AccountDetailsRequest parameters);
}
30 changes: 30 additions & 0 deletions src/main/java/com/blog/demo/service/AccountServiceEndpoint.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.blog.demo.service;

import javax.jws.WebService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.blog.demo.webservices.accountservice.AccountDetailsRequest;
import com.blog.demo.webservices.accountservice.AccountDetailsResponse;

@Service
@WebService(portName = "Accounts", serviceName = "Accounts",
endpointInterface = "com.briansdevblog.accounts.AccountService",
targetNamespace = "http://www.briansjavablog.com/AccountService/")
public class AccountServiceEndpoint implements AccountService {

private AccountService accountService;

@Autowired
public AccountServiceEndpoint(@Qualifier("accountServiceImpl") AccountService accountService) {
this.accountService = accountService;
}

@Override
public AccountDetailsResponse getAccountDetails(AccountDetailsRequest parameters) {

return accountService.getAccountDetails(parameters);
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.demo.service;
package com.blog.demo.service;

import org.springframework.stereotype.Service;

import com.blog.samples.webservices.accountservice.Account;
import com.blog.samples.webservices.accountservice.AccountDetailsRequest;
import com.blog.samples.webservices.accountservice.AccountDetailsResponse;
import com.blog.samples.webservices.accountservice.EnumAccountStatus;
import com.blog.samples.webservices.accountservice.ObjectFactory;
import com.blog.demo.webservices.accountservice.Account;
import com.blog.demo.webservices.accountservice.AccountDetailsRequest;
import com.blog.demo.webservices.accountservice.AccountDetailsResponse;
import com.blog.demo.webservices.accountservice.EnumAccountStatus;
import com.blog.demo.webservices.accountservice.ObjectFactory;

@Service
public class AccountServiceImpl implements AccountService {
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/com/demo/service/AccountService.java

This file was deleted.

30 changes: 0 additions & 30 deletions src/main/java/com/demo/service/AccountServiceEndpoint.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://com/blog/samples/webservices/accountservice" xmlns:account="http://webservices.samples.blog.com" targetNamespace="http://com/blog/samples/webservices/accountservice" elementFormDefault="qualified">
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://com/blog/demo/webservices/accountservice"
xmlns:account="http://webservices.demo.blog.com"
targetNamespace="http://com/blog/demo/webservices/accountservice"
elementFormDefault="qualified">
<xsd:complexType name="Account">
<xsd:sequence>
<xsd:element name="AccountNumber" type="xsd:string"/>
Expand Down
21 changes: 11 additions & 10 deletions src/main/resources/wsdl/Accounts.wsdl
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://www.briansjavablog.com/Accounts/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Accounts"
targetNamespace="http://www.briansjavablog.com/Accounts/"
xmlns:accounts="http://com/blog/samples/webservices/accountservice">
xmlns:tns="http://www.briansdevblog.com/Accounts/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Accounts"
targetNamespace="http://www.briansdevblog.com/Accounts/"
xmlns:accounts="http://com/blog/demo/webservices/accountservice">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://com/blog/samples/webservices/accountservice"
schemaLocation="../schema/AccountsService.xsd">
<xsd:import namespace="http://com/blog/demo/webservices/accountservice"
schemaLocation="../schema/AccountService.xsd">
</xsd:import>
</xsd:schema>
</wsdl:types>
Expand All @@ -17,13 +18,13 @@
<wsdl:message name="AccountDetailsResponse">
<wsdl:part element="accounts:AccountDetailsResponse" name="parameters" />
</wsdl:message>
<wsdl:portType name="Accounts">
<wsdl:portType name="AccountService">
<wsdl:operation name="GetAccountDetails">
<wsdl:input message="tns:AccountDetailsRequest" />
<wsdl:output message="tns:AccountDetailsResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AccountsServiceSoapBinding" type="tns:Accounts">
<wsdl:binding name="AccountServiceSoapBinding" type="tns:AccountService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetAccountDetails">
Expand All @@ -37,8 +38,8 @@
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AccountsService">
<wsdl:port binding="tns:AccountsServiceSoapBinding" name="AccountsPort">
<wsdl:service name="AccountService">
<wsdl:port binding="tns:AccountServiceSoapBinding" name="AccountsPort">
<soap:address
location="http://localhost:8080/apache-cfx-demo/services/accounts" />
</wsdl:port>
Expand Down
27 changes: 0 additions & 27 deletions src/main/webapp/WEB-INF/beans.xml

This file was deleted.

33 changes: 0 additions & 33 deletions src/main/webapp/WEB-INF/web.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.blog.samples.webservices.accountservice.AccountDetailsRequest;
import com.blog.samples.webservices.accountservice.AccountDetailsResponse;
import com.blog.samples.webservices.accountservice.EnumAccountStatus;
import com.blog.samples.webservices.accountservice.ObjectFactory;
import com.briansjavablog.accounts.Accounts;
import com.blog.demo.webservices.accountservice.AccountDetailsRequest;
import com.blog.demo.webservices.accountservice.AccountDetailsResponse;
import com.blog.demo.webservices.accountservice.EnumAccountStatus;
import com.blog.demo.webservices.accountservice.ObjectFactory;
import com.briansdevblog.accounts.AccountService;
import com.demo.config.TestConfig;

@RunWith(SpringJUnit4ClassRunner.class)
Expand All @@ -23,7 +23,7 @@ public class AccountServiceEndpointTest {

@Autowired
@Qualifier("accountServiceClient")
private Accounts accountsServiceClient;
private AccountService accountsServiceClient;
private AccountDetailsRequest accountDetailsRequest;

@Before
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/demo/config/TestConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import com.briansjavablog.accounts.Accounts;
import com.demo.service.AccountServiceEndpoint;
import com.blog.demo.service.AccountServiceEndpoint;
import com.briansdevblog.accounts.AccountService;

@Configuration
@ComponentScan("com.demo.service")
@ComponentScan("com.blog.demo.service")
public class TestConfig {

private static final String SERVICE_URL = "http://localhost:8080/services/accounts";

@Bean("accountServiceClient")
public Accounts accountServiceClient() {
public AccountService accountServiceClient() {

JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
jaxWsProxyFactoryBean.setServiceClass(Accounts.class);
jaxWsProxyFactoryBean.setServiceClass(AccountService.class);
jaxWsProxyFactoryBean.setAddress(SERVICE_URL);
return (Accounts) jaxWsProxyFactoryBean.create();
return (AccountService) jaxWsProxyFactoryBean.create();
}

@Bean(name=Bus.DEFAULT_BUS_ID)
Expand Down

0 comments on commit cca6c6b

Please sign in to comment.