In this post i will discuss how to consume a WSDL which has references to remote schema's through URL references.
Most of the times the development boxes are not in the DMZ of the network because of various security reasons and this will make consuming third party vendor WSDL's hosted outside of the intranet a bit painful in webMethods. In order to over come this problem we can edit the WSDL locally by modifying the URL/URI locations to either include the XSD's in the WSDL or to give a file reference to the locally downloaded locations.
Steps:
1. Download the WSDL and the XSD's from the remote location from a box where you can access them.
2. Now copy all these files to the target package resources directory.
Ex ..\integrationserver\pacakgeName\resources
3. Open the WSDL in eclipse or an XML editor and remove the URL references to the XSD's to a file location using the "file://"
ex:
before the change:
After the change:
<xsd:import namespace="http://remote.service.functionality.pogeneration.google.com/" schemaLocation="file:///D:/SoftwareAG/IntegrationServer/packages/packageName/resources/POGenerationWebService_schema1.xsd"/>
or
<xsd:import namespace="http://remote.service.functionality.pogeneration.google.com/" schemaLocation="file:///../POGenerationWebService_schema1.xsd"/>
4. Repeat for all the XSD references and validate the WSDL in eclipse.
5. If the WSDL is valid after the changes then go to Developer and consume the wsdl.
The reason for them being put in the resources directory is to make sure that all the artifacts are bundled in the same package and can be ported during the deployment.
Cons:
Most of the times the development boxes are not in the DMZ of the network because of various security reasons and this will make consuming third party vendor WSDL's hosted outside of the intranet a bit painful in webMethods. In order to over come this problem we can edit the WSDL locally by modifying the URL/URI locations to either include the XSD's in the WSDL or to give a file reference to the locally downloaded locations.
Steps:
1. Download the WSDL and the XSD's from the remote location from a box where you can access them.
2. Now copy all these files to the target package resources directory.
Ex ..\integrationserver\pacakgeName\resources
3. Open the WSDL in eclipse or an XML editor and remove the URL references to the XSD's to a file location using the "file://"
ex:
before the change:
<xsd:import namespace="http://remote.service.functionality.pogeneration.google.com/" schemaLocation="POGenerationWebService_schema1.xsd" />
After the change:
<xsd:import namespace="http://remote.service.functionality.pogeneration.google.com/" schemaLocation="file:///D:/SoftwareAG/IntegrationServer/packages/packageName/resources/POGenerationWebService_schema1.xsd"/>
or
<xsd:import namespace="http://remote.service.functionality.pogeneration.google.com/" schemaLocation="file:///../POGenerationWebService_schema1.xsd"/>
4. Repeat for all the XSD references and validate the WSDL in eclipse.
5. If the WSDL is valid after the changes then go to Developer and consume the wsdl.
The reason for them being put in the resources directory is to make sure that all the artifacts are bundled in the same package and can be ported during the deployment.
Cons:
- Maintaining a new version of the WSDL than the one from the client.
- Maintaining the schemas up to date from the client.
No comments:
Post a Comment