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 7558163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:18:08+00:00 2026-05-30T12:18:08+00:00

This is an interesting problem, and I will do my best to explain. If

  • 0

This is an interesting problem, and I will do my best to explain. If you have any questions, please ask.

I have written a WCF service that is suppose to communicate with a JAVA client. This service was created via contract first from a WSDL. Now, according to the WCF test client everything works, even testing on a PHP client works as well. But when it comes to the Java client, the request messages and subsequent response messages fail to return: I get a null object SOAP fault. Here is were I think the problem lies:

According to the XSD and WSDL, I have a DateTime value that I am suppose to take in. This dateTime value from the client is of form: 2012-01-01T12:00:00.00Z. Unfortunately, this input is not valid with the built in .NET datetime. So, to get around this, I changed my code to take in a string datatype, convert that string to a Datetime to send it to the database, get a response from the database in that dateTime and convert it back to a string for the response to return a value that is like the one that was inputted.

I built a logger to check to see if the messages were being sent to and from my wcf service. From that, I have identified that messages from the client were not being received. My only guess is that it is because of the datetime issue.

Is there a way to take in a dateTime datatype in the format: 2012-01-01T12:00:00.000Z? If i can, then that will mean that the request will match my datatype and maybe it will work.

Here is some code:

    public partial class findSeatsRequest
{

    [MessageBodyMemberAttribute(Namespace="http://soa.cs.uwf.edu/airlineData", Order=0, Name="departAirport")]
    public string DepartAirport;

    [MessageBodyMemberAttribute(Namespace="http://soa.cs.uwf.edu/airlineData", Order=1, Name="arriveAirport")]
    public string ArriveAirport;

    [MessageBodyMemberAttribute(Namespace="http://soa.cs.uwf.edu/airlineMessage", Order=2, Name="earliestDepartTime")]
    public string EarliestDepartTime;

    [MessageBodyMemberAttribute(Namespace="http://soa.cs.uwf.edu/airlineMessage", Order=3, Name="latestDepartTime")]
    public string LatestDepartTime;

    [MessageBodyMemberAttribute(Namespace="http://soa.cs.uwf.edu/airlineMessage", Order=4, Name="minimumSeatsAvailable")]
    public int MinimumSeatsAvailable;

    [MessageBodyMemberAttribute(Namespace="http://soa.cs.uwf.edu/airlineMessage", Order=5, Name="maximumFlightsToReturn")]
    public int MaximumFlightsToReturn;

    public findSeatsRequest()
    {
    }

    public findSeatsRequest(string departAirport, string arriveAirport, string earliestDepartTime, string latestDepartTime, int minimumSeatsAvailable, int maximumFlightsToReturn)
    {
        this.DepartAirport = departAirport;
        this.ArriveAirport = arriveAirport;
        this.EarliestDepartTime = earliestDepartTime;
        this.LatestDepartTime = latestDepartTime;
        this.MinimumSeatsAvailable = minimumSeatsAvailable;
        this.MaximumFlightsToReturn = maximumFlightsToReturn;
    }
}


    public partial class findSeatsResponse
{

    [MessageBodyMemberAttribute(Namespace="http://soa.cs.uwf.edu/airlineData", Order=0, Name="flight")]
    [XmlElementAttribute("flight")]
    public System.Collections.Generic.List<flightType> Flight;

    public findSeatsResponse()
    {
    }

    public findSeatsResponse(System.Collections.Generic.List<flightType> flight)
    {
        this.Flight = flight;
    }
}

        public virtual findSeatsResponse findSeats(findSeatsRequest request)
    {
        string departAirport = request.DepartAirport;
        string arriveAirport = request.ArriveAirport;
        string earliestDepartTime = request.EarliestDepartTime;
        string latestDepartTime = request.LatestDepartTime;
        int minimumSeatsAvailable = request.MinimumSeatsAvailable;
        int maximumFlightsToReturn = request.MaximumFlightsToReturn;
        SqlCommand cmd = null;
        DataSet ds = new DataSet();
        List<flightType> flight = new List<flightType>();
        EventLogger log = new EventLogger();

        findSeatsRequest inValue = new findSeatsRequest();
        inValue.DepartAirport = departAirport;
        inValue.ArriveAirport = arriveAirport;
        inValue.EarliestDepartTime = earliestDepartTime;
        inValue.LatestDepartTime = latestDepartTime;
        inValue.MinimumSeatsAvailable = minimumSeatsAvailable;
        inValue.MaximumFlightsToReturn = maximumFlightsToReturn;

        string latestT = inValue.LatestDepartTime.Replace("T", " ");
        string latestZ = latestT.Replace("Z", "");
        DateTime _latestDepartTime = DateTime.ParseExact(latestZ, "yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture);

        string earliestT = inValue.EarliestDepartTime.Replace("T", " ");
        string earliestZ = earliestT.Replace("Z", "");
        DateTime _earliestDepartTime = DateTime.ParseExact(earliestZ, "yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture);

        log.WriteToDataBase(DateTime.Now, "FindSeats", 1, "This is the request: " + inValue);


        //Check Maximum Flights
        if (inValue.MaximumFlightsToReturn > 100 | inValue.MaximumFlightsToReturn < 0)
        {
            throw new FaultException(
                "You cannot select more than 100 flights to return, or the maximum flights to return is negative.",
                new FaultCode("OutOfRange"));
        }

        // Check Minimum Seats Available.
        if (inValue.MinimumSeatsAvailable < 0)
        {
            throw new FaultException(
                "You minimum seats available cannot be negative.",
                new FaultCode("OutOfRange"));
        }

        // Check for valid Departure Airport
        if (departAirport != null && departAirport != "ANY")
        {
            try
            {
                string strConn = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
                SqlConnection conn = new SqlConnection(strConn);

                conn.Open();

                string check = "SELECT DepartAirport FROM Flight WHERE DepartAirport='" + departAirport + "'";
                cmd = new SqlCommand(check, conn);
                cmd.CommandText = check;
                SqlDataReader depAirport;
                depAirport = cmd.ExecuteReader();

                if (depAirport.HasRows == false)
                {
                    throw new FaultException(
                        "Invalid Airport code used.",
                        new FaultCode("Invalid Text Entry"));
                }
            }
            finally
            {
                if (cmd != null)
                    cmd.Dispose();
            }
        }

        // Check for valid Arrival Airport
        if (arriveAirport != null && arriveAirport != "ANY")
        {
            try
            {
                string strConn = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
                SqlConnection conn = new SqlConnection(strConn);

                conn.Open();

                string check = "SELECT ArriveAirport FROM Flight WHERE ArriveAirport='" + arriveAirport + "'";
                cmd = new SqlCommand(check, conn);
                cmd.CommandText = check;
                SqlDataReader arrAirport;
                arrAirport = cmd.ExecuteReader();

                if (arrAirport.HasRows == false)
                {
                    throw new FaultException(
                        "Invalid Airport code used.",
                        new FaultCode("Invalid Text Entry"));
                }
            }
            finally
            {
                if (cmd != null)
                    cmd.Dispose();
            }
        }

        try
        {
            string strConn = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
            SqlConnection conn = new SqlConnection(strConn);

            conn.Open();

            cmd = new SqlCommand("usp_NewFindSeats", conn);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@DepartureAirport", inValue.DepartAirport));
            cmd.Parameters.Add(new SqlParameter("@ArrivalAirport", inValue.ArriveAirport));
            cmd.Parameters.Add(new SqlParameter("@EarliestDepTime", _earliestDepartTime));
            cmd.Parameters.Add(new SqlParameter("@LatestDepTime", _latestDepartTime));
            cmd.Parameters.Add(new SqlParameter("@minSeatsAvailable", inValue.MinimumSeatsAvailable));
            cmd.Parameters.Add(new SqlParameter("@maxFlightsRequested", inValue.MaximumFlightsToReturn));

            using (SqlDataReader sqlReader = cmd.ExecuteReader())
            {
                while (sqlReader.Read())
                {
                    flightType Flight = new flightType();

                    Flight.FlightId = sqlReader.GetString(0);
                    Flight.DepartAirport = sqlReader.GetString(1);
                    Flight.ArriveAirport = sqlReader.GetString(2);
                    Flight.DepartTime = sqlReader.GetDateTime(3).ToString("yyyy-MM-ddTHH:mm:ss.fffZ");
                    Flight.ArriveTime = sqlReader.GetDateTime(4).ToString("yyyy-MM-ddTHH:mm:ss.fffZ");
                    Flight.FlightSeatsAvailable = sqlReader.GetInt32(5);
                    Flight.FlightSeatPriceUSD = sqlReader.GetDouble(6);

                    flight.Add(Flight);
                }
            }
  • 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-30T12:18:10+00:00Added an answer on May 30, 2026 at 12:18 pm

    For this particular problem, the issue wasn’t anything I thought it was in the beginning. Firstly, had to use WrapperNames in my C# code’s request operations and the names I used were incorrect.

    Secondly, I needed to specify SOAP Body encoding which I had to do within my Interface layer.

     [XmlSerializerFormatAttribute(SupportFaults=true, Style=OperationFormatStyle.Document ,Use=OperationFormatUse.Literal)]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rather interesting problem. I have a parent page that will create
there's this interesting problem i can not solve myself. I will be very glad,
This is an interesting conundrum. We have a WPF app that has a Vista-like
Ok, this is an interesting problem I think I have a list of items
I have an interesting problem and would appreciate your thoughts for the best solution.
I have an interesting problem. Consider this class hierachy: class Base { public: virtual
I recently came in contact with this interesting problem. You are given a string
i have been reading this interesting article which is increasing my every growing confusion
This problem has been driving me mad. Here's the general gist: I have two
So I have an interesting problem: I have a string, and for the most

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.