Click here to Skip to main content
15,924,317 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
who make web services if my website want to communicate with another website? If third party make web services how we use it? Kindly explain web services process.
Posted

Please refer the Link


First give asmx file reference to your solution they you can access the web methods in that.
 
Share this answer
 
v2
Comments
Ayush Nautiyal 21-Mar-14 5:32am    
I didn't try yet. It will be better if you make me understand by your own code.
Ayush Nautiyal 21-Mar-14 5:39am    
Thanks Sir....... Just trying..
1.If you are using a 3rd party Web Service or your own service, the communication between your site and the web service is the same. You simply have to add in your web application from Visual Studio the reference to the web service (URL), and this will automatically generate the stubs needed by your web application to communicate with the Web Service.
2.Then in your web application code, you have to include a using statement related to the Web Service, and you could use the methods provided by the Web Service.
3.To create your own web service you could see the first solution above or search on MSDN.
 
Share this answer
 
Hai
if u use web service for add,insert,select or update data in ur database using ur web service method,the same webservice method can use for add,insert,select or update data in ur database or own databse using others website.just pass ur web service page or u pass or web service link to other website.
using web service can share or communicate database or own databse not share ur website,instead they write query for insert,select,update or delete just use ur web service method, just they pass parameter in ur web service method
 
Share this answer
 
v2
example This is the web reference URL of DHL SERVICE http://service.ecocoma.com/shipping/dhl.asmx[^]


in your solution click add web reference

one window opens enter URL and press "GO"

give your own name to the reference you add.

I gave "DHLService" as name

then in code behind


C#
protected void Page_Load(object sender, EventArgs e)
       {
           if (!IsPostBack)
           {
               try
               {
                   CalulateShippingPrice();
               }
               catch (Exception ex)
               {
               }
           }


       }

       private void CalulateShippingPrice()
       {
           DHLService.Shipping ShippingRate = new DHLService.Shipping();
           DHLService.Shipping ExtendedShippingRate = new DHLService.Shipping();
           DHLService.Options DHlOptions = new DHLService.Options();

           try
           {
               // For GetDHLRate
               string KeyID = string.Empty;
               string DomainID = string.Empty;
               string SenderAddress = string.Empty;
               string SenderCity = string.Empty;
               string SenderState = string.Empty;
               string SenderPostalCode = string.Empty;
               string SenderCountry = string.Empty;
               string ReceiverCity = string.Empty;
               string ReceiverState = string.Empty;
               string ReceiverPostalCode = string.Empty;
               string ReceiverCountry = string.Empty;
               string Weight = string.Empty;
               string ProtectionValue = string.Empty;
               //For GetExtendedDHLRate
               DHlOptions.ShipDate = string.Empty;
               DHlOptions.ShipmentType1 = string.Empty;
               DHlOptions.ShipmentType2 = string.Empty;
               DHlOptions.Length = string.Empty;
               DHlOptions.Width = string.Empty;
               DHlOptions.Height = string.Empty;
               DHlOptions.AdditionalProtectionCode = string.Empty;
               DHlOptions.SpecialService = string.Empty;
               DHlOptions.CODPaymentCode = string.Empty;
               DHlOptions.CODPaymentValue = string.Empty;
               DHlOptions.OverrideCode = string.Empty;
               DHlOptions.TransactionTrace = string.Empty;
               DHlOptions.ContentDesc = string.Empty;
               DHlOptions.DutiableFlag = string.Empty;
               DHlOptions.CustomsValue = string.Empty;
               DHlOptions.Mode = string.Empty;
               DHlOptions.Sort = string.Empty;
               using (DHLService.DHL_Service DHLObj = new DHLService.DHL_Service())
               {
                   ShippingRate = DHLObj.GetDHLRate(KeyID, DomainID, SenderAddress, SenderCity, SenderState, SenderPostalCode, SenderCountry, ReceiverCity, ReceiverState, ReceiverPostalCode, ReceiverCountry, Weight, ProtectionValue);
                   ExtendedShippingRate = DHLObj.GetExtendedDHLRate(KeyID, DomainID, SenderAddress, SenderCity, SenderState, SenderPostalCode, SenderCountry, ReceiverCity, ReceiverState, ReceiverPostalCode, ReceiverCountry, Weight, ProtectionValue, DHlOptions);
               }
           }
           catch (Exception ex)
           {
           }

       }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900