Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7028933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:28:19+00:00 2026-05-28T00:28:19+00:00

I’m creating a system that uses two web services and a client to provide

  • 0

I’m creating a system that uses two web services and a client to provide an interface for a travel agent. There is a flight booking web service, which stores the available flights within an xml document (based on a schema) and provides methods to retrieve the offers or book a given flight. There is also a travel agent service which consumes the flight booking service and a currency conversion service in order to provide the user prices in a specific currency. Then the client will consume the travel agency service in order to view and book available flights.

My issue is getting the flight information from the flight booking service to the travel agency service, and onwards to the client. The schema used for the offer list is used within both web services and the client. The xml document containing the offers is unmarshalled within the flight booking service to become an object of OffersType. I want to return this object to the travel agency so that operations can be performed on it, and then it returned to the client. However when accessing the method in the travel agency program it only returns flightbooking.OffersType, which can’t be cast into the local OffersType. Is there a way to do this? Or do I need to create a new OffersType which uses the information from the remote OffersType?

So for example, on the flight booking web service:

@WebMethod(operationName = "getOffers")
public OffersType getOffers() {
     try {
        javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(this.getClass().getPackage().getName());
        javax.xml.bind.Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
        offers = (OffersType) unmarshaller.unmarshal(new java.io.File("\\resources\\CurrentOffers.xml")); //NOI18N
    } catch (javax.xml.bind.JAXBException ex) {
        // XXXTODO Handle exception
        java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
    }
    return offers;
}

with offers being an instance of OffersType.

Then on the travel agency side:

private OffersType getOffers() {
    OffersType ret = new OffersType();
    flightbooking.FlightBookingWS port = service.getFlightBookingWSPort();
    return port.getOffers();
}

but obviously that doesn’t work, as the returned object is an instance of flightbooking.OffersType.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:28:20+00:00Added an answer on May 28, 2026 at 12:28 am

    If you are using Java on both the server and client, I would use Jersey + Jackson on both ends. You can as long as you have the model on both sides, and they’re annotated up properly, you can just pass it from one side to another.

    There are many examples online, but I’d start with this SO question: How to reuse Jersey's JSON/JAXB for serialization?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.