locked
Can we explain webservices without proxy.if yes RRS feed

  • Question

  • User-784548771 posted

    Hi,

    Can we explain webservices without proxy.if yes.How?

    Regards

    Tuesday, October 1, 2013 1:25 PM

Answers

  • User2019981500 posted

    but if your system doen't webapi because of old version 3.5 then you can use cross domain call using jquery or javascript/ajax

    here is link http://alvinabad.wordpress.com/2009/02/13/feb13/

    this  is just idea but fact is that server need to be configured to all cross configured calls

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 1, 2013 1:44 PM
  • User2019981500 posted

    Hi depends on requirement and how critical it is?.

    what if you don't have any wayout?

    FYI

    JSON-P (JSONP)

    One such mechanism which can request content cross-domain is the <script> tag. In December 2005, Bob Ippolito formally proposed JSONP (later dubbed JSON-P, or JSON-with-padding) as a way to leverage this property of <script> tags to be able to request data in the JSON format across domains. JSON-P works by making a <script> element (either in HTML markup or inserted into the DOM via JavaScript), which requests to a remote data service location. The response (the loaded "JavaScript" content) is the name of a function pre-defined on the requesting web page, with the parameter being passed to it being the JSON data being requested. When the script executes, the function is called and passed the JSON data, allowing the requesting page to receive and process the data.

    Example:

    function handle_data(data) {
       // `data` is now the object representation of the JSON data
    }
    
    
    ---
    http://some.tld/web/service?callback=handle_data:
    ---
    handle_data({"data_1": "hello world", "data_2": ["the","sun","is","shining"]});
    

    As you can see, the remote web service knew what function name to call based on being told the function name in the URL that made the request. As long as that function is in fact defined in the requesting page, it will be called and passed the data it was asking for.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 1, 2013 1:53 PM

All replies

  • User753101303 posted

    Hi,

    Some context would likely help. Is this a web service you'll create or one that you have to use ? The kind of web service will make a difference :

    - if you are forced to use a SOAP based web service, using a proxy class will be likely much easier (as this is based on more or less complex XML messages)
    - if you want something lightweight, you could use for example http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api that relies just on usual HTTP requests

     

    Tuesday, October 1, 2013 1:40 PM
  • User2019981500 posted

    but if your system doen't webapi because of old version 3.5 then you can use cross domain call using jquery or javascript/ajax

    here is link http://alvinabad.wordpress.com/2009/02/13/feb13/

    this  is just idea but fact is that server need to be configured to all cross configured calls

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 1, 2013 1:44 PM
  • User-784548771 posted

    Thankseverybody

    Hi shabirhakim1,do you think that is good approach?

    regards

    Tuesday, October 1, 2013 1:50 PM
  • User2019981500 posted

    Hi depends on requirement and how critical it is?.

    what if you don't have any wayout?

    FYI

    JSON-P (JSONP)

    One such mechanism which can request content cross-domain is the <script> tag. In December 2005, Bob Ippolito formally proposed JSONP (later dubbed JSON-P, or JSON-with-padding) as a way to leverage this property of <script> tags to be able to request data in the JSON format across domains. JSON-P works by making a <script> element (either in HTML markup or inserted into the DOM via JavaScript), which requests to a remote data service location. The response (the loaded "JavaScript" content) is the name of a function pre-defined on the requesting web page, with the parameter being passed to it being the JSON data being requested. When the script executes, the function is called and passed the JSON data, allowing the requesting page to receive and process the data.

    Example:

    function handle_data(data) {
       // `data` is now the object representation of the JSON data
    }
    
    
    ---
    http://some.tld/web/service?callback=handle_data:
    ---
    handle_data({"data_1": "hello world", "data_2": ["the","sun","is","shining"]});
    

    As you can see, the remote web service knew what function name to call based on being told the function name in the URL that made the request. As long as that function is in fact defined in the requesting page, it will be called and passed the data it was asking for.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 1, 2013 1:53 PM
  • User-784548771 posted

    Thank you very  much.always great help.

    Tuesday, October 1, 2013 1:59 PM