Hi devs I deployed a service which contains a wsdl written in accordance with wsdl 2.0 specification. In this wsdl an external schema file (.xsd ) is being imported. But I am bit puzzled about the correct importing methodology to be used here since I am getting some errors in the deployment of the service on as. But the same service with wsdl 1.1 works perfectly.
Normally according to the wsdl 1.1 the correct way to import a schema is as given below, when the wsdl and schema is there inside the META-INF. <wsdl:types> <wsdl:documentation>This is the schema definition</wsdl:documentation> <xsd:schema targetNamespace="http://xxx.org"> <xsd:import namespace="http://xxx.org/" schemaLocation="calculator.xsd"/> </xsd:schema> </wsdl:types> but according to the http://www.w3.org/TR/2007/REC-wsdl20-primer-20070626/#more-types-schema-import the same schema import methodology would not work for wsdl 2.0, Because it says that if we used the XML Schema's native xs:import element in an inlined schema, the schema components defined in the namespace will not available to the WSDL 2.0 definition. And when I deployed a service with wsdl 2.0 which has a schema import like given below, I got the following warning. <wsdl2:types> <xsd:schema targetNamespace="http://xxx.org"> <xsd:import namespace="http://xxx.org/" schemaLocation="calculator.xsd" /> </xsd:schema> </wsdl2:types> ----------------------------------------------------------------------------------------------------------------------------------------------- The Warning : Woden[Warning],0:0,WSDL521,Could not parse an inline schema in the WSDL at URL "jar:file://file:/home/isuru/webinar/wso2as-4.1.0/repository/deployment/server/axis2services/calculatorImportSchema.aar!/META-INF/calculator_import_schema.wsdl".,org.apache.ws.commons.schema.XmlSchemaException:Could not evaluate Schema Definition. This Schema contains Schema Imports that were not resolved Then as suggested in the wsdl 2.0 Primer I changed the wsdl import as given below. It is said that imports should not be include inside <schema> tags in wsdl 2.0. <wsdl2:types> <xsd:import namespace="http://xxx.org/" schemaLocation="calculator.xsd" /> </wsdl2:types> ------------------------------------------------------------------------------------------------------------------------------------------------- The Warning : Woden[Warning],0:0,WSDL504,Could not locate the schema document at URL "jar:file://file:/home/isuru/webinar/wso2as-4.1.0/repository/deployment/server/axis2services/calculatorImportSchema.aar!/META-INF/calculator.xsd",java.io.FileNotFoundException:JAR entry jar:file://file:/home/isuru/webinar/wso2as-4.1.0/repository/deployment/server/axis2services/calculatorImportSchema.aar!/META-INF/calculator.xsd not found in /home/isuru/webinar/wso2as-4.1.0/repository/deployment/server/axis2services/calculatorImportSchema.aar even though this deployment warning occurred when I do wsdl2java for this wsdl2.0 the stubs get created successfully. would like to get some thoughts on this matter. note : I have attached the service that I have been using to test schema imports (a service got from the QA team) Thank You Isuruw -- *Isuru Wimalasundera* Software Engineer; WSO2, Inc.; http://wso2.com, mobile: +94 77 920 5641
calculatorImportSchema.aar
Description: Binary data
_______________________________________________ Carbon-dev mailing list [email protected] http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
