The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
PHP Web service
Discuss PHP Web service in the PHP Development forum on Dev Shed. PHP Web service PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

November 27th, 2012, 07:08 AM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 43 m 57 sec
Reputation Power: 0
|
|
|
PHP Web service
I am calling ASP.NET Web service using PHP 5.3 (SoapClient)
Below is my WebService code.
<soap:Body>
<CreateCustomerOrder xmlns="(url)/">
<co>
<Auth_String>string</Auth_String>
<Ext_SystemName>string</Ext_SystemName>
<Ext_SystemReferenceNumber>string</Ext_SystemReferenceNumber>
<Cust_Num>string</Cust_Num>
<Cust_Seq>int</Cust_Seq>
<Order_Date>dateTime</Order_Date>
<Cust_PO>string</Cust_PO>
<Whse>string</Whse>
<Ship_Code>string</Ship_Code>
<Taken_By>string</Taken_By>
<Item>string</Item>
<Cust_Item>string</Cust_Item>
<Qty_Ordered>string</Qty_Ordered>
<Due_Date>dateTime</Due_Date>
<Prom_Date>dateTime</Prom_Date>
<Price>string</Price>
<Notes>string</Notes>
</co>
</CreateCustomerOrder>
</soap:Body>
Below is my PHP code:
--------------------------------
$wsdl="url"; //IDOServiceClient URL
$client=new SoapClient($wsdl);
$param=array("Auth_String"=>"test", "Ext_SystemName" => "TestingApp","Ext_SystemReferenceNumber" => "Reference Number","Cust_Num" => "1","Cust_Seq" => 10,"Order_Date" => $today,"Cust_PO" => "KKPO0016","Whse" => "MAIN","Ship_Code" => "UPS","Taken_By" => "KK","Item" => "FG-GE-0991","Cust_Item" => "KK Cust Item 908","Qty_Ordered" => "1","Due_Date" => $_ndate,"Prom_Date" => $_ndate,"Price" => "1.4","Notes" => "Testing notes");
$res = $client->CreateCustomerOrder($param);
print_r($res);
-------------------------------
My problem is parameters are not passing to web service.
Can any one help me in this
|

November 27th, 2012, 11:38 AM
|
 |
Contributing User
|
|
Join Date: Sep 2002
Location: Seattle, U.S.A.
Posts: 712
 
Time spent in forums: 4 Days 11 h 4 m 59 sec
Reputation Power: 11
|
|
|
Use PHP tags please, its hard to read.
|

November 27th, 2012, 11:44 AM
|
 |
Contributing User
|
|
Join Date: Sep 2002
Location: Seattle, U.S.A.
Posts: 712
 
Time spent in forums: 4 Days 11 h 4 m 59 sec
Reputation Power: 11
|
|
|
It looks like you are doing it correctly, though there are a lot of parameters, so possibly passing something in incorrectly. Are you getting a response back? Or and error message?
|

November 27th, 2012, 10:21 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 43 m 57 sec
Reputation Power: 0
|
|
|
I am getting response like below
Result
Array
(
[CreateCustomerOrderResult] => Array
(
[Status] => Error
[Message] => Error occured while processing order
[Request_ID] => 110
)
)
Error, because of parameters are not passing to my webmethod (asp.net)
|

November 28th, 2012, 12:22 PM
|
 |
Contributing User
|
|
Join Date: Sep 2002
Location: Seattle, U.S.A.
Posts: 712
 
Time spent in forums: 4 Days 11 h 4 m 59 sec
Reputation Power: 11
|
|
|
What happens if you pass nothing into the method, do you get the same error? I wonder if perhaps you are passing the parameters but something about the values is incorrect.
|

November 28th, 2012, 12:43 PM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
|
What about the <co>?
|

November 28th, 2012, 10:58 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 43 m 57 sec
Reputation Power: 0
|
|
|
I changed my code like below and it's working fine...
$soapClient = new SoapClient
('http://inhyvwsyte80300/IDOService/IDOServiceClient.asmx?WSDL'); //IDOServiceClient URL
$today= date("Y-m-d");
$next = mktime(0,0,0,date("m"),date("d")+1,date("Y"));
$_ndate = date("Y-m-d", $next);
try
{
$search_query = new StdClass();
$search_query->co = new StdClass();
$search_query->co->Auth_String = "test";
$search_query->co->Ext_SystemName = "TestingApp";
$search_query->co->Ext_SystemReferenceNumber = "Reference Number";
$search_query->co->Cust_Num = "1";
$search_query->co->Cust_Seq = 10;
$search_query->co->Order_Date = $today."T14:00:00";
$search_query->co->Cust_PO = "KKPO0016";
$search_query->co->Whse = "MAIN";
$search_query->co->Ship_Code = "UPS";
$search_query->co->Taken_By = "KK";
$search_query->co->Item = "FG-GE-0991";
$search_query->co->Cust_Item = "KK Cust Item 908";
$search_query->co->Qty_Ordered = "1";
$search_query->co->Due_Date = $_ndate."T14:00:00";
$search_query->co->Prom_Date = $_ndate."T14:00:00";
$search_query->co->Price = "1.4";
$search_query->co->Notes = "Testing notes";
$info = $soapClient -> CreateCustomerOrder($search_query);
} catch (SoapFault $fault) {
echo "ERROR" .$fault;
}
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|