0
Answer

How to consume Third party Webservice in Silverlight

krishna prasad

krishna prasad

10y
1.1k
1

I am trying to use TaxCloud webservices (https://taxcloud.net/) for getting TaxRates,in my LocalHost  in Silverlight



I added TaxCloud Webservice reference in my project and trying to access Lookup function.

Address of Webservice : https://api.taxcloud.net/1.0/Taxcloud/

By using following service we will TaxRate for the selected address. I am passing values as below

Dim TaxCloudService As New TaxServiceReference.TaxCloudSoapClient

Dim Address As New Goldcrm.BillingAdvisor.TaxServiceReference.Address

Address.Address1 = "1666 6th Street"

Address.City = "Boulder"

Address.State = "CO"

Address.Zip4 = 80302

TaxCloudService.LookupAsync("370D0480", "81C1F6F1-E3EF-41FD-95CD-AFF50740F6D2", "", "", Nothing, Address, Nothing, False, Nothing, Nothing)

I am able to access and run Webservice but on completed event I am getting following error message

An error occurred while trying to make a request to URI 'https://api.taxcloud.net/1.0/TaxCloud.asmx'.

This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services.

You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent.

This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute.

We already have ClientAccessPolicy.xml in GSP.WEB root

<?xml version="1.0" encoding="utf-8"?>

<access-policy>

<cross-domain-access>

<policy>

<allow-from http-request-headers="*">

<domain uri="http://*"/>

<domain uri="https://*"/>

</allow-from>

<grant-to>

<resource path="/" include-subpaths="true"/>

</grant-to>

</policy>

</cross-domain-access>

</access-policy>