Web service

Discussion in 'ASP.NET / ASP.NET Core' started by maddyrafi, Apr 28, 2012.

  1. Please ask the question again because it makes no sense.
     
  2. Webservice error

    i have one form like transport information, in that form i have 3 textbox, in 1st textbox i put trichy in 2nd textbox i put chennai in 3rd textbox enter date and give search means the search want to search in this http://www.ticketgoose.com/ website and give me result in my form gridview how will i do this ?

    i mean i want to fetch database from other website and show me the result to my web form ?
     
  3. Having imported the service reference, this works for me:

    Code:
    public partial class WebForm1 : System.Web.UI.Page
        {        
            protected void ExecuteButtonClick(object sender, EventArgs e)
            {
                using(var svcClient = new TGTravelServiceClient())
                {
                    svcClient.Endpoint.Address = new EndpointAddress("http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl");
                    var tripDetails = svcClient.getTripDetailsV2("userId", "pwd", "originStationId", "destinationStationId", "01/05/2012", "scheduleId");
                }
            }
        }
     
  4. kindly tel me step by step procedure pls, i am trying this from last 2weeks, i take 3 textbox, 2 textbox i put place source and destination, and another textbox i put date and give search na ?

    i want to write this in search button ?

    pls tel me where i want to write this code ? is this is working ?

    It shows error like this:

    The type or namespace name 'TGTravelServiceClient' could not be found (are you missing a using directive or an assembly reference?)
     
  5. this coding was worked for you ? if yes means pls tel me the solution pls...
    myself its not working here... it shows error like this....

    protected void Button1_Click(object sender, EventArgs e)
    {
    using (var svcClient = new TGTravelServiceClient())
    {
    svcClient.Endpoint.Address = new EndpointAddress("http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl");
    var tripDetails = svcClient.getTripDetailsV2("userId", "pwd", "originStationId", "destinationStationId", "01/05/2012", "scheduleId");
    }
    }

    Error is The type or namespace name 'TGTravelServiceClient' could not be found (are you missing a using directive or an assembly reference?)

    Pls provide me solution pls
     
  6. i give like this... right click solution explorer and then click Add Service Reference. in url i paste this url http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl and give ok and namespace is servicereference; i am use namespace like this using ServiceReference; and i run means it show error like this... what will i do ?

    Error:

    An endpoint configuration section for contract 'ServiceReference.TGTravelService' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.

    My code is

    protected void Button1_Click(object sender, EventArgs e)
    {
    using (var svcClient = new TGTravelServiceClient())
    {
    svcClient.Endpoint.Address = new EndpointAddress("http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl");
    var tripDetails = svcClient.getTripDetailsV2("userId", "pwd", "originStationId", "destinationStationId", "01/05/2012", "scheduleId");
    }
    }

    Now what will i do ? pls give me solution pls...
     
  7. You have duplicate entries for the service in your web.config probably because you've attempted to add the service reference to the web service more than once. I suggest you delete the service reference from the project AND completely delete the <system.serviceModel> section from your web.config and start again.

    Try that. If it doesn't work for you let me know and I'll attach a complete working sample as a zip file to this thread so you can see physically something that is setup correctly and works.
     
  8. its not work dear... kindly send me zip file to my mail id pls [email protected], i tried from since 30min
     
  9. kindly rply me after you send mail, and give me procedure how to view output that pls
     
  10. i have retry the project like this...
    i create new web.config file is
    <connectionStrings>
    <add name="travel" connectionString="Server=AVAIL2-PC;Initial Catalog=travel;Integrated Security=true"/>
    </connectionStrings>

    and add service reference here, and put namespace is

    using System.ServiceModel;
    using System.Data.SqlClient;
    using ServiceReference1;

    in default.aspx design page i take 3 textbox and 1gridview and 1 button
    and write coding in button like this:

    protected void Button1_Click(object sender, EventArgs e)
    {
    using (var svcClient = new TGTravelServiceClient())
    {
    svcClient.Endpoint.Address = new EndpointAddress("http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl");
    var tripDetails = svcClient.getTripDetailsV2("[email protected]", "samerafi", "originStationId", "destinationStationId", "01/05/2012", "scheduleId");

    GridView1.DataSource = tripDetails;
    GridView1.DataBind();
    }
    }
    when i give input fromplace yoplace and date and give search means it shows runtime error like this:

    Error: Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource.

    so pls send me the .rar file of this project that you already told. my mail id is [email protected],
     
  11. Here you go - I've attached it to this thread and not emailed it to directly so the community might benefit from this in future.

    This is a working sample however I never did have valid credentials to call this web service and I notice there is something strange about the required date format for the travelDate parameter on the getTripDetailsV2 method. I can't help you with these issues, you'll need to speak to the web service host to get detailed web service documentation and valid client credentials.
     

    Attached Files:

  12. Error when i run this app.

    Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
    Error in web config: <compilation debug="true" targetFramework="4.0">

    i am using VS2008, how to run here...
     
  13. This project was created with VS2010 and targets .NET4.0. You'll need to convert it to .NET3.5 / VS2008 format if you don't have VS2010. I'm not doing that for you and my support on this ends here. Good luck Googling how to do this or getting someone else to do this for you.
     
  14. Error in web reference

    i add this web reference like this: http://staging.ticketgoose.com/bookb...ces/TGSWS?wsdl

    right click solution explorer click add web reference and put this link in that web reference url

    http://staging.ticketgoose.com/bookb...ces/TGSWS?wsdl and click go button and web reference name is com.ticketgoose.staging and click add reference, and finally click the .wsdl file and view in browser means i t shows error like this:

    HTTP Error 403 - Forbidden.

    --------------------------------------------------------------------------------

    Version Information: ASP.NET Development Server 9.0.0.0

    but i want to bring this http://staging.ticketgoose.com/bookb...ces/TGSWS?wsdl in my browser how ?
     
  15. Error in ur zip file

    i converted your zip file 4.0 to 3.5 here when i run the aplication it shows error like this:

    Parser Error Message: Could not load type 'TestWebApplication.WebForm'.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="~/WebForm.aspx" Inherits="TestWebApplication.WebForm" %>
     
  16. Final Error

    I try your app it shows error like this ?
    Error:

    The type or namespace name 'TGTravelService' does not exist in the namespace 'TestWebApplication' (are you missing an assembly reference?)


    using TestWebApplication.TGTravelService;
    Error
    and 2nd error:

    Error: Type 'TestWebApplication.WebForm' already defines a member called 'ExecuteButtonClick' with the same parameter types
     
  17. In post 17 and post 18 the 2 post i have error pls clear the error
     
  18. There are no errors / problems with the .NET 4.0 solution zip file attached to post #13 in this thread. Any errors you're seeing now have been introduced by you in your own code and I can't support that. Please refer to my previous post #15, this is my final post in this thread.
     
  19. Error

    i have converted your zip file into 3.5, when i run the app it show error like this kindly solve this one error ? i didnt put any my personal code. this is ur app only when i am run the app it shows error like this: what i do ?

    Error: Could not load type 'TestApplication.WebForm'.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="~/WebForm.aspx.cs" Inherits="TestApplication.WebForm"%>
     
  20. mjp

    mjp

    I don't think Joe is going to respond again. You're asking an awful lot and then saying things like "pls clear the error," which kind of sounds like instructions to an employee. As far as I know, Joe does not work for you. He was trying to help you, but you seem to be demanding solutions and then ignoring the advice you're getting. That's not how it works.
     
  21. Dear

    Sorry
     

Share This Page