ECGrid Forums  

Go Back   ECGrid Forums > Electronic Commerce > ECGridOS > ECGridOS Developer

ECGridOS Developer Development related posts.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2013, 09:56 AM
joblesspoet joblesspoet is offline
New Member
 
Join Date: Mar 2013
Posts: 12
Default Issue using web service

Hi,

I'm using web services in PHP i'm facing issue kindly help me out if you have any solution.
Code:
$soap_request  = '<?xml version="1.0" encoding="utf-8"?>\n';
  $soap_request .= '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">\n';
  $soap_request .= '<soap:Body>\n';
  $soap_request .= '    <Login xmlns="http://ecgridos.net/">\n';
  $soap_request .= '        <LoginName>string</LoginName>\n';
  $soap_request .= '        <Password>string</Password>\n';
  $soap_request .= '    </Login>\n';
  $soap_request .= '  </soap:Body>\n';
  $soap_request .= '</soap:Envelope>';

  $header = array(
    "Content-Type: text/xml; charset=utf-8",
    "Accept: text/xml",
    "Cache-Control: no-cache",
    "Pragma: no-cache",
    "SOAPAction: 'http://ecgridos.net/Login'",
    "Content-length: ".strlen($soap_request),
  );

  $soap_do = curl_init();
  curl_setopt($soap_do, CURLOPT_URL, "https://ecgridos.net/v2.3/prod/ECGridOS.asmx/Login" );
  curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
  curl_setopt($soap_do, CURLOPT_TIMEOUT,        10);
  curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
  curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
  curl_setopt($soap_do, CURLOPT_POST,           true );
  curl_setopt($soap_do, CURLOPT_POSTFIELDS,     $soap_request);
  curl_setopt($soap_do, CURLOPT_HTTPHEADER,     $header);
    $res = curl_exec($soap_do);
  if($res === false) {
    $err = 'Curl error: ' . curl_error($soap_do);
    curl_close($soap_do);
    print $err;
  } else {
    curl_close($soap_do);
    print 'Operation completed without any errors';
  }
  
  echo $res;
If i remove content type option from header(array) it is giving me error LoginName parameter is missing

If i add the content type option in header(array) it is showing "Request format is invalid: text/xml; charset=utf-8"

any help will be appreciated

Thanks
Reply With Quote
  #2  
Old 03-27-2013, 11:00 AM
Todd Gould's Avatar
Todd Gould Todd Gould is offline
Loren Data Corp.
 
Join Date: May 2005
Location: Loren Data Corp.
Posts: 303
Send a message via Skype™ to Todd Gould
Default

I personally do not use PHP and all my SOAP requests are handled by the SDK that I used (Visual Studio 2008).

In addtion to here, I would post this type of query in a PHP SOAP forum.

-=tg=-
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get started? Todd Gould ECGridOS Developer 9 03-18-2014 03:46 PM
LoginName Length Issue Todd Gould ECGridOS Developer 0 06-03-2011 10:27 AM


All times are GMT -4. The time now is 07:40 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
ECGrid® is a registered service mark of Loren Data Corp.