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.
So how can I call REST API to create service to make sure all the fields can be loaded and displayed in SOAPUI?
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)
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.