Layer7 API Management

Expand all | Collapse all

WSDL and schemas

Jump to Best Answer
  • 1.  WSDL and schemas

    Posted 02-24-2017 04:09 AM

    Hi,

     

    I have wsdl file with related schema files. Now I need to call REST API https://<myhostname>:8443/restman/1.0/services to create SOAP service with the wsdl file and schema files. In the POST request body, I construct the <L7:Service> xml with policy, wsdl and schemas, following the same response structure with when I run GET method. The service can be created and the operations are correct when I view from Policy Manager. But when I load the wsdl from SOAPUI, there is no any field in the request part.

    If I publish service with wsdl from Policy Manager, all the fields can be shown in request in SOAPUI. 

    For both ways(created by REST API or published with wsdl), the wsdl part from https://<hostname>:8443/restman/1.0/services?name=serviceName are the same with original wsdl, the schema part like:

     

    <wsdl:definitions name="insight" targetNamespace="http://ca.com/customerinsights/v1">
    <wsdl:types>
      <xsd:schema>
          <xsd:import namespace="http://ca.com/customerinsights-types/v1" schemaLocation="schemas/customer_insights_v1.xsd"/>
          <xsd:import namespace="http://ca.com/enterprise/common-types/v1" schemaLocation="common-schemas/service_common.xsd"/>
      <xsd:schema>
    </wsdl:types>

     

    But the schema_location are different from https://<hostname>:8443/serviceName?wsdl.  

    If the service is created by REST API, the schema location is the same as above, which is a static value so the schema can't be loaded. If the service is published by wsdl, the schema location is updated with URL likes below. I think that's why I can see request fields in this case.

     

    schemaLocation="https://<hostname>:8443/ssg/wsdl/customer_insights_v1.xsd?serviceoid=c3a8cee02186ed9cdd0e76ad86b547cd&servdocoid=c3a8cee02186ed9cdd0e76ad86b5480e"

     

    So how can I call REST API to create service to make sure all the fields can be loaded and displayed in SOAPUI?

     

    Thanks

    Yang



  • 2.  Re: WSDL and schemas
    Best Answer

    Posted 02-26-2017 06:41 PM

    I am not quite sure, but it seems you have multiple xsd files, make sure they are available. (if my memory is right, you need to import them into Manage Global Resources, and the schemaLocation needs to be correct -- try only the xsd file name after you import them to Manage Global Resources)



  • 3.  Re: WSDL and schemas

    Posted 03-21-2017 10:50 PM

    Hi Zhijun,

     

    Thanks. I finally make it work by adding all required schema to the request xml. The root cause of my early issue is some schema location URLs are wrong in the request xml. The URL has to be absolute path and can't be relative path. No need to import schema to Global Resources. 

     

    Thanks

    Yang