Calling Web Service
I have to make a Web Service request using SOAP in non WSDL mode. I found that I cannot use Web Service Task in SSIS and have to use Script task for this. I found sample code in API documentaion written in php. Can somebody help me convert this php to c#. class touchwoodclient{ public $outputErrors = false; public $exitOnError = false; protected $client = null; public function __construct($accountid, $key, $url = 'https://www.everywhere.com/api/'){ $this->outputErrors = $this->exitOnError = true; $this->client = new SoapClient(null, array( 'location' => $url, 'uri' => 'urn://touchwood.api' )); $result = $this->client->authorize($accountid, $key); if(!is_bool($result)) $result = $this->converToArray($result); if(!empty($result['error'])) $this->outputError($result['error']); $this->outputErrors = $this->exitOnError = false; } public function __destruct(){ if(is_object($this->client)) $this->client = null; } public function listAvailableMethods(){ $result = $this->converToArray($this->client->listAvailableMethods()); if(!empty($result['error'])) $this->outputError($result['error']); return $result; } public function getEventList(){ $result = $this->converToArray($this->client->getEventList()); if(!empty($result['error'])) $this->outputError($result['error']); return $result; } Thanks,
April 12th, 2011 2:20pm

Based on my experience there must be a WSDL or one can be generated. In one other instance I needed to consume a WebService in HTTP mode (get and post were used). Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
April 12th, 2011 2:54pm

Thanks alot ArthurZ!!! Consuming Web service is really giving me hard time. I do not have the WSDL file. By looking at the php code it seems that it is making SOAP request in non WSDL mode. I want to do the same in SSIS, if possible by using Web Service Task, if not then by using the Script task. The service URL is given as https://everywhere.com/api/ (This is not the real URL) . I have to pass ID and Key as the credentials. If I try using the URL in Add Service Reference then it errors saying : The HTML document does not contain Web service discovery information. Metadata contains a reference that cannot be resolved: 'https://www.everywhere.com/api/'. Metadata contains a reference that cannot be resolved: 'https://www.everywhere.com/api/'. If the service is defined in the current solution, try building the solution and adding the service reference again. Any suggestions. Thanks,
April 12th, 2011 3:54pm

use Disco.exe (http://msdn.microsoft.com/en-us/library/cy2a3ybs.aspx) to see if the service is avaialble to you and then Read on how to explore WebServices - http://msdn.microsoft.com/en-us/library/0c515353%28v=vs.90%29.aspx You may need to ask the third party to generate the WSDL for you to use in SSIS WebService task. If the WebService is not discoverable then you cannot use it.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
April 13th, 2011 3:43pm

Thanks for your patience!!! I really appreciated your dedication in helping others. I used the Disco.exe to see if the service is available to me.It gives the error : The HTML document does not contain Web Service Discovery Information. I read on how to explore Webservices and when I use the url, https://www.everywhere.com/api/?wsdl it errors out saying <SOAP-ENV:Envelope><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>WSDL generation is not supported yet</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> Isnt it possible to make SOAP request without WSDL ? Thanks alot!!!!
April 13th, 2011 7:19pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics