org.springframework.ws.soap.client.core.SoapActionCallback Java Examples

The following examples show how to use org.springframework.ws.soap.client.core.SoapActionCallback. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CustomerClient.java    From cloud-native-microservice-strangler-example with GNU General Public License v3.0 6 votes vote down vote up
public UpdateCustomerResponse updateCustomerResponse(Profile profile) {

        UpdateCustomerRequest request = new UpdateCustomerRequest();

        Customer customer = new Customer();
        customer.setFirstName(profile.getFirstName());
        customer.setLastName(profile.getLastName());
        customer.setEmail(profile.getEmail());
        customer.setUsername(profile.getUsername());

        request.setCustomer(customer);

        log.info("Updating customer for " + customer.getUsername());

        return (UpdateCustomerResponse) getWebServiceTemplate()
                .marshalSendAndReceive(
                        String.format("%s/v1/customers", this.getDefaultUri()),
                        request,
                        new SoapActionCallback(ROOT_NAMESPACE + UPDATE_CUSTOMER_NAMESPACE));
    }
 
Example #2
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public XMLGregorianCalendar getEarliestMatchDatePerLeague(String leagueName) {
    GetEarliestMatchDatePerLeague request = new GetEarliestMatchDatePerLeague();
    request.setApiKey(apiKey);
    request.setLeague(leagueName);

    GetEarliestMatchDatePerLeagueResponse response =
            (GetEarliestMatchDatePerLeagueResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetEarliestMatchDatePerLeague"));

    return Optional.ofNullable(
            response.getGetEarliestMatchDatePerLeagueResult().
                    getContent().
                    getLeagueInformation().
                    getDate()).
            orElse(null);
}
 
Example #3
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public Collection<GetMatchLineupsDto> getMatchLineupsByFixtureMatchId(Integer fixtureMatchId) {
    GetMatchLineupsByFixtureMatchId request = new GetMatchLineupsByFixtureMatchId();
    request.setApiKey(apiKey);
    request.setMatchId(fixtureMatchId);

    GetMatchLineupsByFixtureMatchIdResponse response =
            (GetMatchLineupsByFixtureMatchIdResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetMatchLineupsByFixtureMatchId"));

    GetMatchLineupsXML getMatchLineupsByFixtureMatchIdXML =
            response.getGetMatchLineupsByFixtureMatchIdResult().getContent();

    Type listType = new TypeToken<List<GetMatchLineupsDto>>() {
    }.getType();

    return modelMapper.map(getMatchLineupsByFixtureMatchIdXML.getMatchLineup(), listType);
}
 
Example #4
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public Collection<GetMatchEventsDto> getMatchEventsByFixtureMatchId(Integer fixtureMatchId) {
    GetMatchEventsByFixtureMatchId request = new GetMatchEventsByFixtureMatchId();
    request.setApiKey(apiKey);
    request.setMatchId(fixtureMatchId);

    GetMatchEventsByFixtureMatchIdResponse response =
            (GetMatchEventsByFixtureMatchIdResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetMatchEventsByFixtureMatchId"));

    GetMatchEventsXML getMatchEventsXML =
            response.getGetMatchEventsByFixtureMatchIdResult().getContent();

    Type listType = new TypeToken<List<GetMatchEventsDto>>() {
    }.getType();

    return modelMapper.map(getMatchEventsXML.getMatchEvent(), listType);
}
 
Example #5
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetHistoricMatchesResultDto> getHistoricMatchesByTeamAndDateInterval(Integer teamId,
                                                                                 String startDate,
                                                                                 String endDate) {
    GetHistoricMatchesByTeamAndDateInterval request = new GetHistoricMatchesByTeamAndDateInterval();
    request.setApiKey(apiKey);
    request.setStartDateString(startDate);
    request.setEndDateString(endDate);
    request.setTeamId(teamId.toString());

    GetHistoricMatchesByTeamAndDateIntervalResponse response =
            (GetHistoricMatchesByTeamAndDateIntervalResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetHistoricMatchesByTeamAndDateInterval"));

    GetHistoricMatchesResultXML getHistoricMatchesResultXML =
            response.getGetHistoricMatchesByTeamAndDateIntervalResult().getContent();

    Type listType = new TypeToken<List<GetHistoricMatchesResultDto>>() {
    }.getType();

    return modelMapper.map(getHistoricMatchesResultXML.getMatch(), listType);
}
 
Example #6
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetHistoricMatchesResultDto> getHistoricMatchesByLeagueAndSeason(String leagueName,
                                                                             String season) {
    GetHistoricMatchesByLeagueAndSeason request = new GetHistoricMatchesByLeagueAndSeason();
    request.setApiKey(apiKey);
    request.setSeasonDateString(season);
    request.setLeague(leagueName);

    GetHistoricMatchesByLeagueAndSeasonResponse response =
            (GetHistoricMatchesByLeagueAndSeasonResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetHistoricMatchesByLeagueAndSeason"));

    GetHistoricMatchesResultXML getHistoricMatchesResultXML =
            response.getGetHistoricMatchesByLeagueAndSeasonResult().getContent();

    Type listType = new TypeToken<List<GetHistoricMatchesResultDto>>() {
    }.getType();

    return modelMapper.map(getHistoricMatchesResultXML.getMatch(), listType);
}
 
Example #7
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetHistoricMatchesResultDto> getHistoricMatchesByLeagueAndDateInterval(String leagueName,
                                                                                   String startDate,
                                                                                   String endDate) {
    GetHistoricMatchesByLeagueAndDateInterval request = new GetHistoricMatchesByLeagueAndDateInterval();
    request.setApiKey(apiKey);
    request.setLeague(leagueName);
    request.setStartDateString(startDate);
    request.setEndDateString(endDate);

    GetHistoricMatchesByLeagueAndDateIntervalResponse response =
            (GetHistoricMatchesByLeagueAndDateIntervalResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetHistoricMatchesByLeagueAndDateInterval"));

    GetHistoricMatchesResultXML getHistoricMatchesResultXML =
            response.getGetHistoricMatchesByLeagueAndDateIntervalResult().getContent();

    Type listType = new TypeToken<List<GetHistoricMatchesResultDto>>() {
    }.getType();

    return modelMapper.map(getHistoricMatchesResultXML.getMatch(), listType);
}
 
Example #8
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetHistoricMatchesResultDto> getHistoricMatchesByID(Integer matchId) {
    GetHistoricMatchesByID request = new GetHistoricMatchesByID();
    request.setApiKey(apiKey);
    request.setId(matchId);

    GetHistoricMatchesByIDResponse response =
            (GetHistoricMatchesByIDResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetHistoricMatchesByID"));

    GetHistoricMatchesResultXML getHistoricMatchesResultXML =
            response.getGetHistoricMatchesByIDResult().getContent();

    Type listType = new TypeToken<List<GetHistoricMatchesResultDto>>() {
    }.getType();

    return modelMapper.map(getHistoricMatchesResultXML.getMatch(), listType);
}
 
Example #9
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetHistoricMatchesResultDto> getHistoricMatchesByFixtureMatchID(Integer fixtureMatchId) {
    GetHistoricMatchesByFixtureMatchID request = new GetHistoricMatchesByFixtureMatchID();
    request.setApiKey(apiKey);
    request.setId(fixtureMatchId);

    GetHistoricMatchesByFixtureMatchIDResponse response =
            (GetHistoricMatchesByFixtureMatchIDResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetHistoricMatchesByFixtureMatchID"));

    GetHistoricMatchesResultXML getHistoricMatchesResultXML =
            response.getGetHistoricMatchesByFixtureMatchIDResult().getContent();

    Type listType = new TypeToken<List<GetHistoricMatchesResultDto>>() {
    }.getType();

    return modelMapper.map(getHistoricMatchesResultXML.getMatch(), listType);
}
 
Example #10
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public Collection<GetFixturesResultDto> getPlayOffFixturesByLeagueAndSeason(String leagueName, String season) {
    GetPlayoffFixturesByLeagueAndSeason request = new GetPlayoffFixturesByLeagueAndSeason();
    request.setApiKey(apiKey);
    request.setLeague(leagueName);
    request.setSeasonDateString(season);

    GetPlayoffFixturesByLeagueAndSeasonResponse response =
            (GetPlayoffFixturesByLeagueAndSeasonResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetPlayoffFixturesByLeagueAndSeason"));

    GetFixturesResultXML getFixturesResultXML =
            response.getGetPlayoffFixturesByLeagueAndSeasonResult().getContent();

    Type listType = new TypeToken<List<GetFixturesResultDto>>() {
    }.getType();

    return modelMapper.map(getFixturesResultXML.getMatch(), listType);
}
 
Example #11
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetFixturesResultDto> getFixturesByLeagueAndSeason(String leagueName, String season) {
    GetFixturesByLeagueAndSeason request = new GetFixturesByLeagueAndSeason();
    request.setApiKey(apiKey);
    request.setLeague(leagueName);
    request.setSeasonDateString(season);

    GetFixturesByLeagueAndSeasonResponse response =
            (GetFixturesByLeagueAndSeasonResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetFixturesByLeagueAndSeason"));

    GetFixturesResultXML getFixturesResultXML =
            response.getGetFixturesByLeagueAndSeasonResult().getContent();

    Type listType = new TypeToken<List<GetFixturesResultDto>>() {
    }.getType();

    return modelMapper.map(getFixturesResultXML.getMatch(), listType);
}
 
Example #12
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetFixturesResultDto> getFixturesByDateIntervalAndTeam(Integer teamId, String startDate,
                                                                   String endDate) {
    GetFixturesByDateIntervalAndTeam request = new GetFixturesByDateIntervalAndTeam();
    request.setApiKey(apiKey);
    request.setStartDateString(startDate);
    request.setEndDateString(endDate);
    request.setTeamId(teamId.toString());

    GetFixturesByDateIntervalAndTeamResponse response =
            (GetFixturesByDateIntervalAndTeamResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetFixturesByDateIntervalAndTeam"));

    GetFixturesResultXML getFixturesResultXML =
            response.getGetFixturesByDateIntervalAndTeamResult().getContent();

    Type listType = new TypeToken<List<GetFixturesResultDto>>() {
    }.getType();

    return modelMapper.map(getFixturesResultXML.getMatch(), listType);
}
 
Example #13
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetFixturesResultDto> getFixturesByDateIntervalAndLeague(String leagueName, String startDate,
                                                                     String endDate) {
    GetFixturesByDateIntervalAndLeague request = new GetFixturesByDateIntervalAndLeague();
    request.setApiKey(apiKey);
    request.setStartDateString(startDate);
    request.setEndDateString(endDate);
    request.setLeague(leagueName);

    GetFixturesByDateIntervalAndLeagueResponse response =
            (GetFixturesByDateIntervalAndLeagueResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetFixturesByDateIntervalAndLeague"));

    GetFixturesResultXML getFixturesResultXML =
            response.getGetFixturesByDateIntervalAndLeagueResult().getContent();

    Type listType = new TypeToken<List<GetFixturesResultDto>>() {
    }.getType();

    return modelMapper.map(getFixturesResultXML.getMatch(), listType);
}
 
Example #14
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetFixturesResultDto> getFixturesByDateInterval(String startDate, String endDate) {
    GetFixturesByDateInterval request = new GetFixturesByDateInterval();
    request.setApiKey(apiKey);
    request.setStartDateString(startDate);
    request.setEndDateString(endDate);

    GetFixturesByDateIntervalResponse response =
            (GetFixturesByDateIntervalResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetFixturesByDateInterval"));

    GetFixturesResultXML getFixturesResultXML = response.getGetFixturesByDateIntervalResult().getContent();

    Type listType = new TypeToken<List<GetFixturesResultDto>>() {
    }.getType();

    return modelMapper.map(getFixturesResultXML.getMatch(), listType);
}
 
Example #15
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetTopScorersResultDto> getTopScorersByGroupId(Integer group) {
    GetTopScorersByGroupId request = new GetTopScorersByGroupId();
    request.setApiKey(apiKey);
    request.setGroupId(group);

    GetTopScorersByGroupIdResponse response =
            (GetTopScorersByGroupIdResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetTopScorersByGroupId"));

    GetTopScorersResultXML getTopScorersResultXML = response.getGetTopScorersByGroupIdResult().getContent();

    Type listType = new TypeToken<List<GetTopScorersResultDto>>() {
    }.getType();

    return modelMapper.map(getTopScorersResultXML.getTopscorer(), listType);
}
 
Example #16
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetOddsResultDto> getNextMatchOddsByLeague(String leagueName) {
    GetNextMatchOddsByLeague request = new GetNextMatchOddsByLeague();
    request.setApiKey(apiKey);
    request.setLeague(leagueName);

    GetNextMatchOddsByLeagueResponse response =
            (GetNextMatchOddsByLeagueResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetNextMatchOddsByLeague"));

    GetNextMatchOddsByLeagueResultXML getNextMatchOddsByLeagueResultXML =
            response.getGetNextMatchOddsByLeagueResult().getContent();

    Type listType = new TypeToken<List<GetNextOddsResultDto>>() {
    }.getType();

    return modelMapper.map(getNextMatchOddsByLeagueResultXML.getOdds(), listType);
}
 
Example #17
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetLiveScoreResultDto> getLiveScore() {
    GetLiveScore request = new GetLiveScore();
    request.setApiKey(apiKey);

    GetLiveScoreResponse response = (GetLiveScoreResponse) getWebServiceTemplate().
            marshalSendAndReceive(
                    request,
                    new SoapActionCallback(
                            "http://xmlsoccer.com/GetLiveScore"));

    GetLiveScoreResultXML getLiveScoreResultXML = response.getGetLiveScoreResult().getContent();

    Type listType = new TypeToken<List<GetLiveScoreResultDto>>() {
    }.getType();

    return modelMapper.map(getLiveScoreResultXML.getMatch(), listType);
}
 
Example #18
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetLiveScoreResultDto> getLiveScoreByLeague(String leagueName) {
    GetLiveScoreByLeague request = new GetLiveScoreByLeague();
    request.setApiKey(apiKey);
    request.setLeague(leagueName);

    GetLiveScoreByLeagueResponse response = (GetLiveScoreByLeagueResponse) getWebServiceTemplate().
            marshalSendAndReceive(
                    request,
                    new SoapActionCallback(
                            "http://xmlsoccer.com/GetLiveScoreByLeague"));

    GetLiveScoreResultXML getLiveScoreResultXML = response.getGetLiveScoreByLeagueResult().getContent();

    Type listType = new TypeToken<List<GetLiveScoreResultDto>>() {
    }.getType();

    return modelMapper.map(getLiveScoreResultXML.getMatch(), listType);
}
 
Example #19
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetLeagueStandingsResultDto> getLeagueStandingsBySeason(String leagueName, String season) {
    GetLeagueStandingsBySeason request = new GetLeagueStandingsBySeason();
    request.setApiKey(apiKey);
    request.setLeague(leagueName);
    request.setSeasonDateString(season);

    GetLeagueStandingsBySeasonResponse response =
            (GetLeagueStandingsBySeasonResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetLeagueStandingsBySeason"));

    GetLeagueStandingsBySeasonResultXML getLeagueStandingsBySeasonResultXML =
            response.getGetLeagueStandingsBySeasonResult().getContent();

    Type listType = new TypeToken<List<GetLeagueStandingsResultDto>>() {
    }.getType();

    return modelMapper.map(
            getLeagueStandingsBySeasonResultXML.getTeamLeagueStanding(),
            listType);
}
 
Example #20
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetAllLeaguesResultDto> getAllLeagues() {
    GetAllLeagues request = new GetAllLeagues();
    request.setApiKey(apiKey);

    GetAllLeaguesResponse response = (GetAllLeaguesResponse) getWebServiceTemplate().
            marshalSendAndReceive(
                    request,
                    new SoapActionCallback(
                            "http://xmlsoccer.com/GetAllLeagues"));

    GetAllLeaguesResultXML getAllLeaguesResultXML = response.getGetAllLeaguesResult().getContent();

    Type listType = new TypeToken<List<GetAllLeaguesResultDto>>() {
    }.getType();

    return modelMapper.map(getAllLeaguesResultXML.getLeague(), listType);
}
 
Example #21
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetTeamResultDto> getAllTeams() {
    GetAllTeams request = new GetAllTeams();
    request.setApiKey(apiKey);

    GetAllTeamsResponse response = (GetAllTeamsResponse) getWebServiceTemplate().
            marshalSendAndReceive(
                    request,
                    new SoapActionCallback(
                            "http://xmlsoccer.com/GetAllTeams"));

    GetAllTeamsResultXML getAllTeamsResultXML = response.getGetAllTeamsResult().getContent();

    Type listType = new TypeToken<List<GetTeamResultDto>>() {
    }.getType();

    return modelMapper.map(getAllTeamsResultXML.getTeam(), listType);
}
 
Example #22
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetTeamResultDto> getAllTeamsByLeagueAndSeason(String leagueName, String season) {
    GetAllTeamsByLeagueAndSeason request = new GetAllTeamsByLeagueAndSeason();
    request.setApiKey(apiKey);
    request.setLeague(leagueName);
    request.setSeasonDateString(season);

    GetAllTeamsByLeagueAndSeasonResponse response =
            (GetAllTeamsByLeagueAndSeasonResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetAllTeamsByLeagueAndSeason"));

    GetAllTeamsByLeagueAndSeasonResultXML getAllTeamsResultXML =
            response.getGetAllTeamsByLeagueAndSeasonResult().getContent();

    Type listType = new TypeToken<List<GetTeamResultDto>>() {
    }.getType();

    return modelMapper.map(getAllTeamsResultXML.getTeam(), listType);
}
 
Example #23
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public GetPlayersResultDto getPlayersById(Integer playerId) {
    GetPlayerById request = new GetPlayerById();
    request.setApiKey(apiKey);
    request.setPlayerId(playerId);

    GetPlayerByIdResponse response = (GetPlayerByIdResponse) getWebServiceTemplate().marshalSendAndReceive(
            request,
            new SoapActionCallback(
                    "http://xmlsoccer.com/GetPlayerById"));

    GetPlayersByTeamResultXML getPlayersByTeamResultXML = response.getGetPlayerByIdResult().getContent();

    Optional<GetPlayersByTeamResultXML.Player> player = getPlayersByTeamResultXML.getPlayer().
            stream().
            findFirst();

    if (player.isPresent())
        return modelMapper.map(player.get(), GetPlayersResultDto.class);

    return null;
}
 
Example #24
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetPlayersResultDto> getPlayersByTeam(Integer teamId) {
    GetPlayersByTeam request = new GetPlayersByTeam();
    request.setApiKey(apiKey);
    request.setTeamId(teamId.toString());

    GetPlayersByTeamResponse response = (GetPlayersByTeamResponse) getWebServiceTemplate().
            marshalSendAndReceive(
                    request,
                    new SoapActionCallback(
                            "http://xmlsoccer.com/GetPlayersByTeam"));

    GetPlayersByTeamResultXML getPlayersByTeamResultXML = response.getGetPlayersByTeamResult().getContent();

    Type listType = new TypeToken<List<GetPlayersResultDto>>() {
    }.getType();

    return modelMapper.map(getPlayersByTeamResultXML.getPlayer(), listType);
}
 
Example #25
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetAllOddsResultDto> getAllOddsByFixtureMatchId(Integer fixtureMatchId) {
    GetAllOddsByFixtureMatchId request = new GetAllOddsByFixtureMatchId();
    request.setApiKey(apiKey);
    request.setFixtureMatchId(fixtureMatchId);

    GetAllOddsByFixtureMatchIdResponse response =
            (GetAllOddsByFixtureMatchIdResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetAllOddsByFixtureMatchId"));

    GetAllOddsXML getOddsByFixtureMatchIdResultXML = response.getGetAllOddsByFixtureMatchIdResult().
            getContent();

    Type listType = new TypeToken<List<GetAllOddsResultDto>>() {
    }.getType();

    return modelMapper.map(
            getOddsByFixtureMatchIdResultXML.getOddsList().getOdds(),
            listType);
}
 
Example #26
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetOddsResultDto> getOddsByFixtureMatchId(Integer fixtureMatchId) {
    GetOddsByFixtureMatchId request = new GetOddsByFixtureMatchId();
    request.setApiKey(apiKey);
    request.setFixtureMatchId(fixtureMatchId.toString());

    GetOddsByFixtureMatchIdResponse response = (GetOddsByFixtureMatchIdResponse) getWebServiceTemplate().
            marshalSendAndReceive(
                    request,
                    new SoapActionCallback(
                            "http://xmlsoccer.com/GetOddsByFixtureMatchId"));

    GetOddsByFixtureMatchIdResultXML getOddsByFixtureMatchIdResultXML =
            response.getGetOddsByFixtureMatchIdResult().getContent();

    Type listType = new TypeToken<List<GetOddsResultDto>>() {
    }.getType();

    return modelMapper.map(getOddsByFixtureMatchIdResultXML.getOdds(), listType);
}
 
Example #27
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 6 votes vote down vote up
@Override
public List<GetTopScorersResultDto> getTopScorersByLeagueAndSeason(String leagueName, String season) {
    GetTopScorersByLeagueAndSeason request = new GetTopScorersByLeagueAndSeason();
    request.setApiKey(apiKey);
    request.setLeague(leagueName);
    request.setSeasonDateString(season);

    GetTopScorersByLeagueAndSeasonResponse response =
            (GetTopScorersByLeagueAndSeasonResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetTopScorersByLeagueAndSeason"));

    GetTopScorersResultXML getTopScorersResultXML =
            response.getGetTopScorersByLeagueAndSeasonResult().getContent();

    Type listType = new TypeToken<List<GetTopScorersResultDto>>() {
    }.getType();

    return modelMapper.map(getTopScorersResultXML.getTopscorer(), listType);
}
 
Example #28
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 5 votes vote down vote up
@Override
public List<GetHistoricMatchesResultDto> getHistoricMatchesByTeamsAndDateInterval(Integer teamId1,
                                                                                  Integer teamId2,
                                                                                  String startDate,
                                                                                  String endDate) {
    GetHistoricMatchesByTeamsAndDateInterval request = new GetHistoricMatchesByTeamsAndDateInterval();
    request.setApiKey(apiKey);
    request.setStartDateString(startDate);
    request.setEndDateString(endDate);
    request.setTeam1Id(teamId1.toString());
    request.setTeam2Id(teamId2.toString());

    GetHistoricMatchesByTeamsAndDateIntervalResponse response =
            (GetHistoricMatchesByTeamsAndDateIntervalResponse) getWebServiceTemplate().
                    marshalSendAndReceive(
                            request,
                            new SoapActionCallback(
                                    "http://xmlsoccer.com/GetHistoricMatchesByTeamsAndDateInterval"));

    GetHistoricMatchesResultXML getHistoricMatchesResultXML =
            response.getGetHistoricMatchesByTeamsAndDateIntervalResult().getContent();

    Type listType = new TypeToken<List<GetHistoricMatchesResultDto>>() {
    }.getType();

    return modelMapper.map(getHistoricMatchesResultXML.getMatch(), listType);
}
 
Example #29
Source File: XmlSoccerServiceImpl.java    From xmlsoccer with MIT License 5 votes vote down vote up
@Override
public String checkApiKey(String apiKey) {
    CheckApiKey request = new CheckApiKey();
    request.setApiKey(apiKey);

    CheckApiKeyResponse response = (CheckApiKeyResponse) getWebServiceTemplate().
            marshalSendAndReceive(
                    request,
                    new SoapActionCallback(
                            "http://xmlsoccer.com/CheckApiKey"));

    return response.getCheckApiKeyResult();
}
 
Example #30
Source File: TicketAgentClient.java    From spring-ws with MIT License 5 votes vote down vote up
@SuppressWarnings("unchecked")
public List<BigInteger> listFlights() {
  ObjectFactory factory = new ObjectFactory();
  TListFlights tListFlights = factory.createTListFlights();

  JAXBElement<TListFlights> request = factory.createListFlightsRequest(tListFlights);

  // use SoapActionCallback to add the SOAPAction
  JAXBElement<TFlightsResponse> response =
      (JAXBElement<TFlightsResponse>) webServiceTemplate.marshalSendAndReceive(request,
          new SoapActionCallback("http://example.com/TicketAgent/listFlights"));

  return response.getValue().getFlightNumber();
}