Generating Java or C# classes from the WSDL document

Do you use Java or C#. Then you can generate classes from the test or the production WSDL document in Eclipse or Visual Studio. To find SAS API endpoints, see Signing web service.

To generate Java code in Eclipse Java EE IDE for web developers

  1. In Eclipse, create a new Java project.
  2. Right-click the project folder and then click New, Other.
  3. In the New window, expand Web Services, select Web Service Client, and click Next.
  4. Next, paste the WSDL URL in the Service definition textbox, drag the slider up to Test Client, and click Finish.

If Eclipse cannot access the WSDL URL, use a local copy of the WSDL file. See Referencing a local copy of the SAS WSDL below.

To generate C# code in Visual Studio

  1. Create a new project.
  2. In the Solution Explorer, right-click and select Add Service Reference.
  3. In the Add Service Reference window, click Advanced.
  4. In the Service Reference Settings window, click Add Web Reference.
  5. In the URL field, enter the URL for the WSDL.
  6. Click Add Reference.

If Eclipse cannot access the WSDL URL, use a local copy of the WSDL file. See Referencing a local copy of the SAS WSDL below.

Referencing a local copy of the SAS WSDL

Does Eclipse or Visual Studio returns errors when you use the WSDL URL to add a web service client or web reference? You will need to use a local copy of the WSDL instead.

Getting a local copy of the SAS WSDL

  1. Browse to WSDL endpoint.
  2. Save the WSDL page to your computer as a wsdl file.
  3. In the WSDL, find the <xsd:import> element, browse to the URL located in the schemaLocation attribute, and save this page in the same location where you saved the WSDL file.
  4. Open your local copy of the WSDL and update the<xsd:import> element's schemaLocation attribute to the path of the page you saved in step 3.
  5. Save and close the WSDL file.

We use cookies to ensure that we give you the best experience on our website. By using this site, you agree to the Terms of Service.