Skip to main content

Using the SOAP Wizard with an Existing WSDL

Using the SOAP Wizard with an Existing WSDL

In some cases, the WSDL has been designed already and it is necessary to create a web service that matches the WSDL; this is known as WSDL-first development. In InterSystems IRIS, there are three steps to this development:

  1. Use the SOAP Wizard to read the WSDL and to generate the web service and all supporting classes.

    This wizard can also generate web client classes (which is more common).

    For information on using this wizard, see Using the SOAP Wizard. Follow the steps described in that section and also select the Create Web Service option within the wizard.

    Or use the %SOAP.WSDL.ReaderOpens in a new tab class as described in Using the %SOAP.WSDL.Reader Class.

  2. Examine the generated classes to see if you need to change any %StringOpens in a new tab values in the method signatures.

    When the wizard reads a WSDL, it assumes that any string-type input or output can be represented in InterSystems IRIS as %StringOpens in a new tab, which is not always true. In rare cases, some strings might exceed the maximum length string limit.

    See Adjusting the Generated Classes for Extremely Long Strings.

  3. Edit the methods in the generated web service so that they perform the desired actions.

    Each method is initially a stub like the following example:

    Method Add(a As Test.ns2.ComplexNumber, b As Test.ns2.ComplexNumber) As Test.ns2.ComplexNumber 
    [ Final, SoapAction = "https://www.mynamespace.org/GSOAP.AddComplexWS.Add", 
    SoapBindingStyle = document, SoapBodyUse = literal, WebMethod ]
    {
     // Web Service Method Implementation Goes Here.
    }

    The wizard includes compiler keywords such as Final and SoapBindingStyle. You should not change the values of these keywords.

If the WSDL includes WS-Policy elements, the wizard also generates a configuration class for the web service. The default configuration class name is the web service name, with Config appended to it. For information on WS-Policy, see Securing Web Services.

FeedbackOpens in a new tab