Many times when we try to create Consumer Proxy for the external Web Service (URL), we get error while accessing the WSDL/Schema. The error can be because of firewall, trusted network, URL certification or authorization issues. But once all the network and authorization issues are resolved, if you still get error in WSDL/Schema, then it is highly possible that your Web Service URL has the link to Schema Location which it cannot identify at runtime wizard while creating the Consumer Proxy.
Say you are trying to create consumer proxy in SE80 like shown below.
You give the name and proceed with the Enterprise Services Create Wizard.
But you are stuck in the step “Enter the URL for accessing the WSDL/Schema”.
Errors can be like below: “500 Internal Server Error”.
Error can be like “500 SSL Peer Certificate Untrusted”.
Error in URL accessing the WSDL/Schema can also be for .XSD like below.
Sample xsd errors in WSDL URL:
“Error while uploading the xsd file(schema) in web services definition”
“File ContractService.xsd was not attached because it has an invalid file extension not allowed by the system settings”
“Exception occurred in communication framework: Error in HTTP Framework:500Internal Server Error”
“….xsd “ error
by the way XSD means XML Schema Definition
Most of the time, WSDL URL has the hyper link (URL) to the schema location. Instead of the definition , it has a URL link to schema location where we can see the actual schema definition and properties. In such Web Services, if we try to consume the WSDL URL, we get error. In order to avoid that error, we need to use the WSDL local file. Do not worry, the local WSDL file would be dynamic and would work exactly like the WSDL URL. But we need to do a small tweak in the local WSDL file.
We need to replace the link to schema location with the exact schema definition from the schema location URL in the WSDL local file. Once we have the complete schema definition replaced in the WSDL, we should be able to create the consumer proxy using the local WSDL file.
Below steps would demonstrate in details, how we can replace the xsd schema location with the exact xsd schema definition. We have taken the public dnb toolkit web service for our example.
Step 1 – Refer to below link for dnb WSDL
We are referring to GDP_V4.wsdl.
Step 2 – Open the Web Service
Step 3 – Save the Web Service as .txt file
Save the WSDL file as .txt in your local machine. Screenshot of the txt file opened in wordpad below.
Step 4 – Look for Key Word
Take a look at the either in the txt file (screenshot above) or on WSDL in browser (screenshot below).
Step 5 – Expand <xsd:schema> </xsd:schema>
<xsd:schema><xsd:import namespace=”http://www.dnb.com/DNB_WebServices/Providers/OrderAndInvestigations/GDP_V4/wsp_GDP_V4” schemaLocation=”https://toolkit-wsdl.dnb.com/ws/DNB_WebServices.Providers.OrderAndInvestigations.GDP_V4:wsp_GDP_V4?WSDL&fingerprint=P6DCJGGOL7NVDOIVFGQWX7EKOTZNG45M.xsd” /></xsd:schema>
Step 6 – Look for schemaLoation Key Word and schemaLocation Path
For this WSDL the schemaLocation path is:
Step 7 – Replace the xsd:schema in the WSDL file with the exact definition from the schemaLocation.
Open the schemaLocation Path URL in another Tab in the browser. It will give the full Type definition of the xsd:schema.
Do not forget to expand all before you copy the full definition.
Once it is expanded, it is no more yellow.
The easy way to expand all the sequence is by going to page source. Right click on any area and go to View page source
Step 8 – Copy XSD Schema Definition and Replace
Copy the full xsd:schema and replace in the original WSDL.txt file with the xsd:schema from the schemaLocation.
PS: Do not copy the first line of the page source (as marked in image above).
Tips: <xsd:schema> </xsd:schema> should be between <wsdl:types> </wsdl:types>.
Step 9 – Save the Web Service file with .WSDL extension
Step 10 – Choose the WSDL Source as Local File in the Wizard
Now, wherever you were trying to use the WSDL URL, replace it with your local WSDL file. The xsd schema error should be resolved.
Screenshot of sample Consumer Proxy we created.
This should fix the Web Service XSD Schema issue.