I have a synchronous request to be made to another webservice before making the call to target endpoint and I’m using javascript to construct this request.
When I test the constructed request in SOAPUI , I get the expected response
However, when I use the below in javascript -
var myResult = httpClient.get(“https://development.avalara.net/Tax/TaxSvc.asmx/v2”,reqcont);
I get below as response . how to use httpClient in order to pass the request along with URL to get valid response ?
#content{ FONT-SIZE: 0.7em; PADDING-BOTTOM: 2em; MARGIN-LEFT: 30px}BODY{MARGIN-TOP: 0px; MARGIN-LEFT: 0px; COLOR: #000000; FONT-FAMILY: Verdana; BACKGROUND-COLOR: white}P{MARGIN-TOP: 0px; MARGIN-BOTTOM: 12px; COLOR: #000000; FONT-FAMILY: Verdana}PRE{BORDER-RIGHT: #f0f0e0 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #f0f0e0 1px solid; MARGIN-TOP: -5px; PADDING-LEFT: 5px; FONT-SIZE: 1.2em; PADDING-BOTTOM: 5px; BORDER-LEFT: #f0f0e0 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f0f0e0 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e5e5cc}.heading1{MARGIN-TOP: 0px; PADDING-LEFT: 15px; FONT-WEIGHT: normal; FONT-SIZE: 26px; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 3px; MARGIN-LEFT: -30px; WIDTH: 100%; COLOR: #ffffff; PADDING-TOP: 10px; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #003366}.intro{MARGIN-LEFT: -15px}TaxSvc ServiceTaxSvc Service
You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
svcutil.exe http://development.avalara.net/Tax/TaxSvc.svc?wsdl
You can also access the service description as a single file:
http://development.avalara.net/Tax/TaxSvc.svc?singleWsdl
This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:
C#
class Test { static void Main() { TaxSvcClient client = new TaxSvcClient(); // Use the 'client' variable to call operations on the service. // Always close the client. client.Close(); } } Visual Basic
Class Test Shared Sub Main() Dim client As TaxSvcClient = New TaxSvcClient() ' Use the 'client' variable to call operations on the service. ' Always close the client. client.Close() End Sub End Class