I have built a Visual Studio project to consume a a 3rd party web service. The goal is to export CSV data. This is my first time consuming a web service so not sure what I am doing.
Here is the information that the web service has provided me (some info changed to protect my data):
Web Services Page, WSDL, and DataSource for Web Services Export:
https://reportservices.credtest.com/reports/ExportService.asmx
Encrypted Connection String:
GG3FakeStringgvwkdR4aCjKiu591-aUB2cfN18cYlNyqcpLD0V291y1gnZawA__
Query for Dataset Export:
<Query>
<SoapAction>
https://reportservices.credtest.com/ExportDataSet
</SoapAction>
<Method Namespace="https://reportservices.credtest.com/" Name="ExportDataSet">
<Parameters>
<Parameter Name="connection" Type="String">
<DefaultValue>
GG3FakeStringgvwkdR4aCjKiu591-aUB2cfN18cYlNyqcpLD0V291y1gnZawA__
</DefaultValue>
</Parameter>
<Parameter Name="start_date" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="end_date" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param1" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param2" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param3" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="true">
ExportDataSetResponse{}/ExportDataSetResult{}/diffgram{}/NewDataSet{}/Table{CPT_Code,Description,Other_Code,CPT_Modifier,Service_ID,Service,Service_Description,Program_ID,Program,Pgm_Dsc,Start_Minutes,End_Minutes,Matrix_ID,Start_Age,End_Age,Claim_Format,Credential_Group,RollUp_Code,Rate,Deaf_Rate,Fixed_Units,First_Unit_Minutes,Unit_Minutes,Unit_Multiplier}
</ElementPath>
</Query>
Query for XML Export:
<Query>
<SoapAction>
https://reportservices.credtest.com/ExportXML
</SoapAction>
<Method Namespace="https://reportservices.credtest.com/" Name="ExportXML">
<Parameters>
<Parameter Name="connection" Type="String">
<DefaultValue>
GG3FakeStringgvwkdR4aCjKiu591-aUB2cfN18cYlNyqcpLD0V291y1gnZawA__
</DefaultValue>
</Parameter>
<Parameter Name="start_date" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="end_date" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param1" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param2" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param3" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="true">
ExportXMLResponse{}/ExportXMLResult{}/diffgram{}/NewDataSet{}/Table{CPT_Code,Description,Other_Code,CPT_Modifier,Service_ID,Service,Service_Description,Program_ID,Program,Pgm_Dsc,Start_Minutes,End_Minutes,Matrix_ID,Start_Age,End_Age,Claim_Format,Credential_Group,RollUp_Code,Rate,Deaf_Rate,Fixed_Units,First_Unit_Minutes,Unit_Minutes,Unit_Multiplier}
</ElementPath>
</Query>
Here is the description of what is happening.
Every time I try to add a Connected service I get an error, either when adding the service (WCF) or when doing a build (gRPC or OpenAPI).
I go to Connected Services > Manage Connected Services
This opens the Service References (OpenAPI, gRPC, WCF Web Service) window. I click on “Add a new service reference”. This opens the Add Service Reference window and shows 3 choices to pick from (OpenAPI, gRPC, WCF Web Service). I have tried both OpenAPI and gRPC and get errors when doing a build. WCF gives me an error during the
If I choose Open API then the “Add a new OpenAPI service reference” window opens. I fill out the form with the following information:
URL: https://reportservices.credtest.com/reports/ExportService.asmx (link changed to protect my data) Namespace: CredNS Class Name: CredCN Code Generation Language: C#
Severity : Error Code: MSB3073
Description: The command ""C:\Users\dwoodard.nuget\packages\nswag.msbuild\13.0.5\build../tools/Win/NSwag.exe" openapi2csclient /className:CredCN /namespace:CredNS /input:C:\Users\dwoodard\source\repos\CredibleCoreWebApp\CredibleCoreWebApp\OpenAPIs\ExportService2.asmx /output:obj\ExportService2Client.cs " exited with code -1
Project CredibleCoreWebApp File: C:\Users\dwoodard.nuget\packages\nswag.apidescription.client\13.0.5\build\NSwag.ApiDescription.Client.targets
Line 28 Column 5 Suppression State
If I choose gRPC then the “Add a new gRPC service reference” window opens. I fill out the form with the following information:
URL: https://reportservices.credtest.com/reports/ExportService.asmx Select the type of class to be generated: Client (I have also tried server and “Client and Server”)
I get the result “Successfully added service Reference(s)”. If I click on “view generated code” then I get the following error: Unable to get the generated codefiles for gRPC service reference ExportService2. You may need to build the project first.
I immediately do a build and get 82 errors. Error #1: Severity : Error Code:
Description: \src\github\grpc\workspace_protoc_windows_x64\third_party\protobuf\src\google\protobuf\compiler\parser.cc:648] No syntax specified for the proto file: Protos/ExportService2.asmx. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
Project: CredibleCoreWebApp
File: C:\Users\dwoodard\source\repos\CredibleCoreWebApp\CredibleCoreWebApp[libprotobuf WARNING T
Line: 1 Column: 1 Suppression State:
The many errors following are like this:
Expected top-level statement (e.g. "message").
Need space between number and identifier.
"e" must be followed by exponent.
WCF Gives errors when trying to add so never succeeds.
I enter the URI: https://reportservices.credtest.com/reports/ExportService.asmx
Click GO
Services: reports/ExportService.asmx (automatically populated)
Status: Warning: One or more errors occurred.
Error Details:
Cannot import wsdl:port\r\nDetail: \r\nXPath to Error Source: //wsdl:definitions[@targetNamespace='https://www.credtest.com/']/wsdl:service[@name='ExportService']/wsdl:port[@name='ExportServiceHttpPost']
Cannot import wsdl:binding\r\nDetail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled.\r\nXPath to Error Source: //wsdl:definitions[@targetNamespace='https://www.credtest.com/']/wsdl:binding[@name='ExportServiceHttpPost']
Cannot import wsdl:port\r\nDetail: \r\nXPath to Error Source: //wsdl:definitions[@targetNamespace='https://www.credtest.com/']/wsdl:service[@name='ExportService']/wsdl:port[@name='ExportServiceHttpGet']
Cannot import wsdl:binding\r\nDetail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled.\r\nXPath to Error Source: //wsdl:definitions[@targetNamespace='https://www.credtest.com/']/wsdl:binding[@name='ExportServiceHttpGet']