function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VikVik 

An IOException was thrown trying to access the WSDL at the given URL

I am trying to access few methods exposed by Salesforce webservice. Endpoint - https://xyz.salesforce.com/services/Soap/class/abcWebService

 

I can easily do that using SOAPUI but when I am trying to do it through my client code(generated using wsdl2java) running in eclipse, I get below error

 

<09-Jun-2010 17:57:34 o'clock BST> <Info> <WebService> <BEA-220094> <An IOException was thrown trying to access the WSDL at the given URL.>
weblogic.webservice.wsdl.WSDLParseException: Failed to retrieve WSDL from https://xyz.salesforce.com/services/Soap/class/xyzService. Please check the URL and make sure that it is a valid XML file [java.net.UnknownHostException: cs1-api.salesforce.com]
    at weblogic.webservice.wsdl.DefinitionFactory.createDefinition(DefinitionFactory.java:161)
    at weblogic.webservice.wsdl.WSDLParser.<init>(WSDLParser.java:51)

Best Answer chosen by Admin (Salesforce Developers) 
VikVik

I am finally able to do this. Thanks for helping.

All Answers

SuperfellSuperfell

You should use a local copy of the WSDL.

VikVik

Thank You for response.

 

I created my jar using local copy of wsdl and wsdl is already inside the jar.  But in WS call, url will be called automatically.

Please advise?

SuperfellSuperfell

You won't be able to fetch the WSDL at runtime (because the request is not authenticated). You'll have to read your SOAP toolkit's docs on how to configure that.

VikVik

Thanks Simon

 

By saying that storing wsdl as local copy
  
Do you want us to
  
(i) Create a Salesforce service in local environment temporarily (later we can add code for authentication)
  
OR
  
(ii) Create a proper salesforce client and call salesforce service (Currently we are trying to use Stub/Proxy mechanism which is giving us error - Failed to retrieve WSDL. Are you proposing us to use Dynamic invocation mechanism in which we will hard code soap request)
SuperfellSuperfell

Do whatever you were doing before, but configure it to fetch the WSDL from a local file, not from the salesforce server.

VikVik

We are in position to provide Session ID to autheticate ourselves.

 

SessionHeader sh = new SessionHeader();
sh.setSessionId("00DS00000000gNs************************");

 

The problem is we are unable to retrieve the WSDL. When you say use it locally, I am not getting any help from google etc to see how can I access the WSDL locally. Do you mean deploy the Salesforce wsdl and make a service out of it and then access it. If yes, then what is the point of having Salesforce Service if we have to do all this locally?

 

Was anyone ever able to access Salesforce services using Java client generated from Salesforce wsdl?

Please share little more details about the approach to achieve this integration please.

 

Your help is appreciated, Thanks.

VikVik

I am finally able to do this. Thanks for helping.

This was selected as the best answer
BharathiCBharathiC

Hi

Could you please tell us how you solved ur issue? We are facing the same issue, accessing A Sharepoint WSDL but, from our Java client. And we are getting the below exception.

java.io.FileNotFoundException

at com.certicom.net.ssl.internal.HttpURLConnection.getInputStream(Unknown Source)

at weblogic.webservice.client.https.HttpsURLConnection.getInputStream(

at weblogic.webservice.tools.wsdlp.DefinitionFactory.createDefinition(

at weblogic.webservice.tools.wsdlp.WSDLParser.<init>(

at weblogic.webservice.WebServiceFactory.createFromWSDL(

at weblogic.webservice.core.rpc.ServiceImpl.<init>(

at com.citi.cmb.modms.webservices.client.sharepoint.Dws_Impl.<init>(

at com.citi.cmb.modms.webservices.client.sharepoint.DWSAuthenticationManager.sharePointDWSAuth(

 

weblogic.webservice.tools.wsdlp.WSDLParseException: Failed to retrieve WSDL from

at weblogic.webservice.tools.wsdlp.DefinitionFactory.createDefinition(

 

Thanks.