You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

WCF Application Call from a Async CPM

Accepted answer
3
Views
1
Comments
edited Jul 24, 2017 6:26AM in Integrations and APIs 1 comment

Content

Hi,

I have WCF type application. I need to call this service from a async CPM.

Below is the code snippet I am trying. It gives a 400 Error(Bad request).

My applcation wsdl is http://****@****.com/SampleAPI/SampleAPIService.svc?wsdl

Please advice whether it is possible to call this type of application from a CPM?

Version

November 16

Code Snippet

             $headers = array('Content-Type: text/xml; charset="utf-8"','Content-Length: '.strlen($body),'Accept: text/xml','Cache-Control: no-cache','Pragma: no-cache','SOAPAction: "http://tempuri.org/SampleService/SampleFunction"');

			$body='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">   <soapenv:Header/><soapenv:Body><tem:SampleFunction><!--Optional:--><tem:EmailID>[email protected]</tem:EmailID><!--Optional:--><tem:IncidentID>12345678</tem:IncidentID><!--Optional:--><tem:contactID>87654321</tem:contactID></tem:SampleFunction></soapenv:Body></soapenv:Envelope>';
			
			$strUrl = "http://****@****.com/SampleAPI/SampleAPIService.svc?wsdl";
			echo $strUrl;
			load_curl();
			if(!extension_loaded('curl'))
				{
				dl('curl_php5.so');
				}
				$ch = curl_init();
				curl_setopt($ch, CURLOPT_URL, $strUrl);
				curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                               

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!