PHP - Making Soap Api Calls.
This is my first time messing with SOAP.
$params = array( 'user' => 'username@gmail.com', 'password' => 'password', 'keyStr' => $keyStr, 'subId' => $subId); $return_string = $client->call('getKey','getTodaySubIDStats','getYesterdaySubIDStats','getMonthToDateSubIDStats','getLastMonthSubIDStats', $params); The $return_string = $client->call('getKey','getTodaySubIDStats','getYesterdaySubIDStats','getMonthToDateSubIDStats','getLastMonthSubIDStats', $params); spits out Fatal error: Uncaught SoapFault exception: [Client] Function ("call") is not a valid method for this service in /home/site82/public_html/stats.php:20 Stack trace: #0 /home/site82/public_html/stats.php(20): SoapClient->__call('call', Array) #1 /home/site82/public_html/stats.php(20): SoapClient->call('getKey', 'getTodaySubIDSt...', 'getYesterdaySub...', 'getMonthToDateS...', 'getLastMonthSub...', Array) #2 {main} thrown in /home/site82/public_html/stats.php on line 20 So I E-Mailed support and got this Quote There are two different ways to make SOAP API calls, depending on which PHP library you use. The example in the document has a client which wants calls like this: $client->call('funcname', parm1, parm2) The other type of call, which I think your client is using, is like this: $client->funcname(parm1, parm2) Switch over your coding and that should eliminate the problem you are getting. so I tried... $return_string = $client->getTodaySubIDStats(user,password,keyStr,subId); and it then spits out Fatal error: Uncaught SoapFault exception: [HTTP] Internal Server Error in /home/site82/public_html/stats.php:17 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://www.maxb...', '', 1, 0) #1 /home/site82/public_html/stats.php(17): SoapClient->__call('getTodaySubIDSt...', Array) #2 /home/site82/public_html/stats.php(17): SoapClient->getTodaySubIDStats('user', 'password', 'keyStr', 'subId') #3 {main} thrown in /home/site82/public_html/stats.php on line 17 How do I call it the correct way?? Similar TutorialsIs there a good way to batch API calls? I'm building a service that requires n^2 api calls for each city I add. Naturally, this is getting a bit clunky (6 cities is 36 separate calls). I lieu of finding a better webservice that can consolidate this into one API call, is there a good way to batch these so I don't get fatal errors when one of these fails? Ideally, I'd be able to loop the calls until results are returned for each. Thanks Hi, Is it possible to return information on a cURL call. for example i want to kind of make my own API for my website cn i make a cURL call to my server and return data back to the client or is cURL just to send data. if cURL is just to send data what is another method to send a request and receive data back on the call? Thanks Mike Hello
I am looking for a way to log all incoming requests to a nusoap web service to a file.. any suggestions?
Thanks
Apparently, this is bad. Wish someone would have told me. Sadly, it is too simple. I had Code: [Select] <? $company=mysql_query("select this and that") while($company=mysql_fetch_array($company)) { a bit of output; $properties=mysql_query("Select this and that from properties where company_id=$company['id']") while(properties=mysql_fetch_array()) { what I want to output } } I seem to be missing some understanding of what the heck to do now. Please, please any suggestions. I suck at object orientation, and arrays of arrays of arrays confuse the crap out of me. Am I missing something simple. Am I over-reacting? I have 15 companies, and about 100 properties total.
I have a script that runs periodically by a launchd timer. I give the script a very tight timeout ( set_time_limit(120); ). http://pastebin.com/DbHQSYd7 Been stumbling my way through OOP and seem to be understanding it for the most part (I think..) But I've got a couple questions / kinks that I can't seem to work out. a) How do I return a variable from a class so that a different class has access to it (meta_data) b) I'm getting a "$this" cannot be redefined error (which I know why, but I don't know how to fix)) c) How do I call a function from within one class, where the function resides in another class, AND pass it variables? Any help would be greatly appreciated I've tried to Google warrior A and I think I can figure that one out, but B and C are proving to be the real stumbling blocks. Hi, I am trying to output my data call rows, alongside each other till two, then break and start a new row. and so on and so on. this is not really a example question, i think its more a request information question and example question. How would i go about $outputting the rows alongside each other? i have tried: $output_rows['MYDATA']='then in here i have had a complete table with all the css and styling and information entered'; //but i couldn't get it alongside each other on the html page? then i tried outputting the information and had the tables and css setup on the .html page, but that gave me duplicate entries alongside each other, as no i was entering data from the {MYDATA}.. Twice.. I am really stuck! if any one can assist Great. I have this code that has Code: [Select] $this->BeginTransaction();all over it. These are in classes where no such function is defined, and they don't have parents either. It's driving my crazy trying to figure out why they are there, why there's not so much as a warning being given and what, if anything, is being called. Now I do have a Code: [Select] set_error_handler("amfErrorHandler");and in amfErrorHandler I have Code: [Select] if( error_reporting() != 0 && ($amfphpErrorLevel | $level) == $amfphpErrorLevel ) { throw new VerboseException($string, $level, $file, $line); } I don't remember what $amfphpErrorLevel is, except that it should only be ignoring things like E_STRICT. Also, no exception is being thrown. So what do I do w/this code? but never on the first call. Okay, I posted this on StackOverflow but no one there seems to have an answer either. I have this simple function: Code: [Select] public function delete($messageID) { $type = $this->findType($messageID); if ($type == 'in') { foreach ($this->inArr as $key => $value) { if ($this->inArr[$key]->messageID != $messageID) $implodeData[$key] = $this->inArr[$key]->messageID; } if (!isset($implodeData)) $imploded = '0'; else $imploded = implode(',', $implodeData); $result = $this->_database->updatePMUser('inArr', $imploded, 'UID', $this->UID); $result2 = $this->_database->deletePM('messageID', $messageID); return; } else { foreach ($this->sentArr as $key => $value) { if ($this->sentArr[$key]->messageID != $messageID) $implodeData[$key] = $this->sentArr[$key]->messageID; } if (!isset($implodeData)) $imploded = '0'; else $imploded = implode(',', $implodeData); $result = $this->_database->updatePMUser('sentArr', $imploded, 'UID', $this->UID); $result2 = $this->_database->deletePM('messageID', $messageID); return; } } It is a delete function for a private messaging program for a forum script I'm writing. Anyway, here's the issue - it works! But only sometimes. It is called in 3 different places, always from a form processing class I have, once in the view message section to delete a message you're viewing, in a foreach from the sentbox options section and then a foreach in the inbox options section. The inbox and sentbox option sections do that whole "delete the checked messages" for the mass removal functionality. The delete function above works in all ways shapes and forms when I use it in single calls - like when I'm deleting a message while viewing it or when I only check one message from the inbox, etc - but when I call it multiple times (as in I have checked multiple messages) - it fully deletes one (both the message and the reference to the message in the user's db row) and then only deletes the actual message on the others (deleting the message is the call to deletePM - deleting the reference is the call to updatePMUser). Okay, if you need further information - the function above checks the type the message is (in the inbox or in the sentbox) and then uses that to foreach through that array (inArr or sentArr) of the user. It logs in all the messageIDs of the those that DON'T match the one we're deleting and then at the end it implodes those caught IDs into a string that is then updated in the user's row as a comma separated string of values each representing a message in the DB - you get the picture. I realize I have some trimming to do (for one I can cut the above function down by about half by using variable variables) but I'll get to that after I get the thing working. I can't figure out why it's doing what it's doing. If you need the function that calls this in the foreach, I have it below. Oh, and the thing that really boggles me is that this function is called fully for each checked message in the foreach - it fully returns and then loops - if it works once, I don't see how it wouldn't work on a second call from a loop - the variables it uses should be trashed when it leaves the function, they aren't global or object properties or anything. Color me confused. Thanks for any help, oh, here's one of the functions that calls it to delete checked messages (this one is for the sentbox, there is another for the inbox): Code: [Select] private function _processSelectedSent() { $pmObj = unserialize(base64_decode($_POST['pmObj'])); $i=1; foreach ($_POST as $key => $value) { if ($value == 'marked') { $checkedArray[$i] = $key; $i++; } } if ($_POST['submitter'] == 'Delete Selected') { if (is_array($checkedArray)) { foreach ($checkedArray as $key => $value) $pmObj->delete($value); } else $pmObj->delete($checkedArray[1]); header("Location: ".HOME_PAGE.PM_PAGE."?view=sentbox&nocache=".time()); } } I need to debug a php program. I've tried to use something like: $debuginfo = var_dump(debug_backtrace()); and then write $debuginfo to a text file for later review. The problem I have is that this approach uses the output stream and my program also wants to write to the output stream. Unfortunately, other programs are using the output stream and dumping dignostic data to the outputstream mesess with the state of the program. Is there a way to get a snapshot of variables and calls without interfering with the output stream? Thanks Mike I everyone, I'm developing a small MVC framework for my personal work, now, in order to have access from all the classes to certain variables I've created a registry class, for this to work I have 2 options: 1.- passing every time the registry object to the constructor class(controllers, models, etc) or 2.- create in the registry static set and get so I can reach the variables by Registry::set(name, value) and Registry::get(name) My question is, which one of this two options takes less resources(is faster)? I hope anyone can help me with this, thanks in advance I would like to connect to web service (I have url to wsdl), which is protected with SSL (I have certificate and password). I would like to do that in PHP - the only solution I know is using Soap, but there is no working reference on Google that does that. I only found erros (could not resolve host, could not parse wsdl and forbiden) but no solutions. Is there any posible way to do this?
One of many attempts is like this:
<?php $wsdl = "https://url-to/test.wsdl"; $local_cert = 'cert.pem'; $passphrase = 'key'; $soapClient = new SoapClient($wsdl, array('local_cert'=> $local_cert,'passphrase'=>$passphrase)); $theResponse = $soapClient->getCertificateInfo('','',''); ?> I am completely and utterly stuck on this. I have tried about 20 different examples but nothing works. I simply want to send an XML message to a web service and receive its response. (1) The url is europaytest.smart2pay.com/MerchantService.asmx. But, does it need ?wsdl on the end?? It could be europaytest.smart2pay.com/MerchantService.asmx?wsdl ?? (2) I need to send XML to the above url using 'SubmitRequest' as the 'action' value. I would have thought this would do it: Code: [Select] $client = new SoapClient("https://europaytest.smart2pay.com/MerchantService.asmx?wsdl"); $response = $client->__doRequest($xml, "https://europaytest.smart2pay.com/MerchantService.asmx", "SubmitRequest", 1.1); But it returns with this XML response message: Code: [Select] <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: SubmitRequest. at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope> Helo, I need some help with downloading xml from remote server using SOAP in PHP this is sample SOAP code that i have from server: http://shop.megatrend.com/ClientWebServices/ClientWS.asmx Code: [Select] POST /ClientWebServices/ClientWS.asmx HTTP/1.1 Host: shop.megatrend.com Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://shop.megatrend.com/ClientWebServices/GetProducts" <?xml version="1.0" encoding="utf-8"?> <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/"> <soap:Body> <GetProducts xmlns="http://shop.megatrend.com/ClientWebServices/"> <username>string</username> <password>string</password> <OIB>string</OIB> </GetProducts> </soap:Body> </soap:Envelope> Code: [Select] HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <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/"> <soap:Body> <GetProductsResponse xmlns="http://shop.megatrend.com/ClientWebServices/"> <GetProductsResult> <WsProduct> <PN>string</PN> <Code>string</Code> <Name>string</Name> <Description>string</Description> <Manufacturer>string</Manufacturer> <Weight>decimal</Weight> <Available>boolean</Available> <Stock>int</Stock> <Warranty>string</Warranty> <Price>decimal</Price> <Images> <WsImage xsi:nil="true" /> <WsImage xsi:nil="true" /> </Images> <Descriptions> <WsDescriptionData xsi:nil="true" /> <WsDescriptionData xsi:nil="true" /> </Descriptions> </WsProduct> <WsProduct> <PN>string</PN> <Code>string</Code> <Name>string</Name> <Description>string</Description> <Manufacturer>string</Manufacturer> <Weight>decimal</Weight> <Available>boolean</Available> <Stock>int</Stock> <Warranty>string</Warranty> <Price>decimal</Price> <Images> <WsImage xsi:nil="true" /> <WsImage xsi:nil="true" /> </Images> <Descriptions> <WsDescriptionData xsi:nil="true" /> <WsDescriptionData xsi:nil="true" /> </Descriptions> </WsProduct> </GetProductsResult> </GetProductsResponse> </soap:Body> </soap:Envelope> this is piece of PHP code that i have that shud handle request: Code: [Select] function megatrend_download() { $local = dirname(__FILE__); $path = $local."/xml/megatrend.xml"; $path1 = $local."/xml/megatrend1.xml"; $request = array('username'=>'xxx','password'=>'xxx','oib'=>'xxx'); postPage($request,'http://shop.megatrend.com/ClientWebServices/GetProducts'); $curl2 = curl_init(); curl_setopt($curl2, CURLOPT_URL, 'http://shop.megatrend.com/ClientWebServices/ClientWS.asmx'); curl_setopt($curl2, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl2, CURLOPT_HEADER, false); curl_setopt($curl2, CURLOPT_RETURNTRANSFER, true); ...rest of functions... I am clearly missing something but i just cant get it! Help! <html><head></head><body>stdClass Object ( [DealerSearchResult] => stdClass Object ( [any] => <xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="NewDataSet"><xs:element name="NewDataSet" msdata:isdataset="true" msdata:maindatatable="Dealer" msdata:usecurrentlocale="true"><xs:complextype><xs:choice minoccurs="0" maxoccurs="unbounded"><xs:element name="Dealer"><xs:complextype><xs:sequence><xs:element name="DealerID" type="xs:int" minoccurs="0"><xs:element name="TaxPayerNumber" type="xs:string" minoccurs="0"><xs:element name="LastName" type="xs:string" minoccurs="0"><xs:element name="Firstname" type="xs:string" minoccurs="0"><xs:element name="MiddleInitial" type="xs:string" minoccurs="0"><xs:element name="CompanyName" type="xs:string" minoccurs="0"><xs:element name="ShipAddress1" type="xs:string" minoccurs="0"><xs:element name="ShipAddress2" type="xs:string" minoccurs="0"><xs:element name="ShipCity" type="xs:string" minoccurs="0"><xs:element name="ShipState" type="xs:string" minoccurs="0"><xs:element name="ShipZip" type="xs:string" minoccurs="0"><xs:element name="ShipCountry" type="xs:string" minoccurs="0"><xs:element name="MailAddress1" type="xs:string" minoccurs="0"><xs:element name="MailAddress2" type="xs:string" minoccurs="0"><xs:element name="MailCity" type="xs:string" minoccurs="0"><xs:element name="MailState" type="xs:string" minoccurs="0"><xs:element name="MailZip" type="xs:string" minoccurs="0"><xs:element name="MailCountry" type="xs:string" minoccurs="0"><xs:element name="WorkPhone" type="xs:string" minoccurs="0"><xs:element name="HomePhone" type="xs:string" minoccurs="0"><xs:element name="FaxPhone" type="xs:string" minoccurs="0"><xs:element name="CellPhone" type="xs:string" minoccurs="0"><xs:element name="EnrollDate" type="xs:dateTime" minoccurs="0"><xs:element name="EmailPrimary" type="xs:string" minoccurs="0"><xs:element name="EmailSecondary" type="xs:string" minoccurs="0"><xs:element name="BirthDate" type="xs:dateTime" minoccurs="0"><xs:element name="Password" type="xs:string" minoccurs="0"><xs:element name="Account" type="xs:string" minoccurs="0"><xs:element name="SubAccount" type="xs:string" minoccurs="0"><xs:element name="Active" type="xs:short" minoccurs="0"><xs:element name="Deleted" type="xs:short" minoccurs="0"><xs:element name="DeleteDate" type="xs:dateTime" minoccurs="0"><xs:element name="DeleteBy" type="xs:string" minoccurs="0"><xs:element name="DealerURL" type="xs:string" minoccurs="0"><xs:element name="IsSentinal" type="xs:short" minoccurs="0"><xs:element name="TaxExempt" type="xs:short" minoccurs="0"><xs:element name="WebPhoto" type="xs:base64Binary" minoccurs="0"><xs:element name="WebGreeting" type="xs:string" minoccurs="0"><xs:element name="WebCatalogueID" type="xs:int" minoccurs="0"><xs:element name="WebProductID" type="xs:int" minoccurs="0"><xs:element name="NPO" type="xs:short" minoccurs="0"><xs:element name="IsCustomer" type="xs:short" minoccurs="0"><xs:element name="SponsoringDealerID" type="xs:int" minoccurs="0"><xs:element name="CurrencyTypeID" type="xs:int" minoccurs="0"><xs:element name="OldID" type="xs:string" minoccurs="0"><xs:element name="APPlacementDealerID" type="xs:int" minoccurs="0"><xs:element name="APDealershipNumber" type="xs:int" minoccurs="0"><xs:element name="APLineage" type="xs:string" minoccurs="0"><xs:element name="EmailOptOutUpline" type="xs:short" minoccurs="0"><xs:element name="EmailOptOutGlobal" type="xs:short" minoccurs="0"><xs:element name="EMailFormatTextOnly" type="xs:short" minoccurs="0"><xs:element name="DealerStatusCodeID" type="xs:int" minoccurs="0"><xs:element name="DateEmailPrimaryLastValidated" type="xs:dateTime" minoccurs="0"><xs:element name="EmailPrimaryValidated" type="xs:short" minoccurs="0"><xs:element name="EmailPrimaryValidationResult" type="xs:string" minoccurs="0"><xs:element name="DEFSponsorDealerID" type="xs:int" minoccurs="0"><xs:element name="DEFSponsorDealershipNumber" type="xs:int" minoccurs="0"><xs:element name="CustomerTypeID" type="xs:int" minoccurs="0"><xs:element name="DateExported" type="xs:dateTime" minoccurs="0"><xs:element name="AllowWebAccess" type="xs:short" minoccurs="0"><xs:element name="UseEWalletOnly" type="xs:int" minoccurs="0"><xs:element name="AffiliateSponsoringDealerID" type="xs:int" minoccurs="0"><xs:element name="SMSTextOptOut" type="xs:short" minoccurs="0"><xs:element name="SMSTextOnEnroll" type="xs:short" minoccurs="0"><xs:element name="SMSTextOnOrder" type="xs:short" minoccurs="0"><xs:element name="SMSTextInfoAlerts" type="xs:short" minoccurs="0"><xs:element name="CustomerStatusID" type="xs:int" minoccurs="0"><xs:element name="PayCurrencyTypeID" type="xs:int" minoccurs="0"><xs:element name="FullName" type="xs:string" minoccurs="0"></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:element></xs:sequence></xs:complextype></xs:element></xs:choice></xs:complextype></xs:element></xs:schema><diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"><documentelement xmlns=""><dealer diffgr:id="Dealer1" msdata:roworder="0"><dealerid>813242</dealerid><taxpayernumber>1</taxpayernumber><lastname>name</lastname><firstname>test</firstname><middleinitial><companyname>test company</companyname><shipaddress1>test address1 </shipaddress1><shipaddress2>test address 2</shipaddress2><shipcity>test city</shipcity><shipstate>N/A</shipstate><shipzip>tf1 7yl</shipzip><shipcountry>UK</shipcountry><mailaddress1>test address1 </mailaddress1><mailaddress2>test address 2</mailaddress2><mailcity>test city</mailcity><mailstate>N/A</mailstate><mailzip>tf1 7yl</mailzip><mailcountry>UK</mailcountry><workphone>01952 000 000</workphone><homephone><faxphone><cellphone><enrolldate>2014-06-03T00:00:00-05:00</enrolldate><emailprimary>test@test.com</emailprimary><emailsecondary><password>password</password><account>1</account><subaccount>0</subaccount><active>-1</active><deleted>0</deleted><dealerurl>testname</dealerurl><issentinal>0</issentinal><taxexempt>0</taxexempt><webcatalogueid>-1</webcatalogueid><webproductid>-1</webproductid><npo>0</npo><iscustomer>0</iscustomer><sponsoringdealerid>-1</sponsoringdealerid><oldid><emailoptoutupline>0</emailoptoutupline><emailoptoutglobal>0</emailoptoutglobal><emailformattextonly>0</emailformattextonly><emailprimaryvalidated>0</emailprimaryvalidated><customertypeid>0</customertypeid><allowwebaccess>-1</allowwebaccess><useewalletonly>0</useewalletonly><affiliatesponsoringdealerid>0</affiliatesponsoringdealerid><smstextoptout>-1</smstextoptout><smstextonenroll>0</smstextonenroll><smstextonorder>0</smstextonorder><smstextinfoalerts>0</smstextinfoalerts><customerstatusid>-1</customerstatusid><paycurrencytypeid>-1</paycurrencytypeid><fullname>test company</fullname></oldid></emailsecondary></cellphone></faxphone></homephone></middleinitial></dealer></documentelement></diffgr:diffgram> ) ) </body></html>this is the soap response i get from $client = new SoapClient("http://#########/WebServices/#####DealerWS.asmx?wsdl"); $result = $client->DealerSearch($params); print_r($result);bascly i want to take from this the info inside and use it as a object so i end up with $obj->LastName etc etc the diffgramm xml is the stuff i want, i can do it but manullly cuting out shcema xml $test = simplexml_load_string($result); $object = $test->DocumentElement->Dealer; echo $object->LastName; echo "<br>"; echo $object->CompanyName;but thats only when i use diffgram xml and as you can see the soap respone dose not work and throws extra content error if i try get it right so im doing it totally wrong can some one help me get it working with the response i supplyed and allow me use valuse like so i want above OK guys, I'm working on a project that involves a SOAP api. I only have reference to the method list here - http://www.ilinc.com/pdf/documentation/ilinc-web-services.pdf . basically, I got it so that I assume it's connecting fine but no matter what I do I can't get a response. I'm assuming I'm having an Issue traversing the response XML but I don't even know how to test that. here's my code... $wsdl_url = 'http://webservice.ilinc.com/perl/ilinc/api/webservice/ilinc-api.pl?WSDL'; $client = new SOAPClient($wsdl_url); $options = array('APIVersion'=>'10.0','ClientID'=>'132449','AuthorizedUserName'=>'lwilliams@biosoteria.com','AuthorizedPassword'=>'*******'); $var = array('UserID'=>'lwilliams@biosoteria.com'); $testUser = $client->GetUserID($options,array('parameters'=>$var)); print $testUser; print $testUser->return->ErrorStr; print $testUser->return->ErrorID; Now in the above code, if I do print $testUser i get this response "Catchable fatal error: Object of class stdClass could not be converted to string in /home/content/12/5907812/html/SOAP_test2.php on line 7". the other two prints return nothing. here's a snippet of the example resonse for the GetUserID method <?xml version="1.0" ?> <iLinc:Response version="10.0" xmlns:iLinc="http://www.ilinc.com"> <iLinc:GetUserIDResponse Reference="reference"> <ErrorID>error-id</ErrorID> <ErrorStr>error-str</ErrorStr> <UserID>user-id</UserID> <EncryptedUserID>encrypted-user-id</EncryptedUserID> </iLinc:GetUserIDResponse> </iLinc:Response> Can anyone tell me what I'm doing wrong? I am trying to connect to ASC web service to do queries, however nothing seems to work. This is was i started with just to test and I am getting nothing also attached are the instructions I was provided: <?php $asc = new SoapClient('https://www.asc.gov/wsvc/ASCQuerySvc.asmx'); return $asc->GetQueryableFields(); ?> Any help would be appreciated. Hi guys, I have been tasked with a SOAP project at work. Basically we have a database on our own internal server that holds information on our customers. This database is managed by an external company and we are able to use predefined SOAP calls that will do certain things for us. We then have a website that the general public access to update their information. I am having trouble understanding how to connect the 2 systems. The website is built in PHP. I am really looking for a proper beginners guide on how to integrate the 2. Can anyone point me in the right direction? Thanks! Ok, so I need to send a SOAP message to my server, but I have never done this before. The complete SOAP message should be as follows: Code: [Select] <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance"> <soapenv:Body><request><username>testuser</username> </request></soapenv:Body></soapenv:Envelope>I have been trying to get this to work for a while now and can't do it, so I need your help. Here is what I have right now: Code: [Select] $params = array('username'=>$username); $params2 = array('request'=>$params); $response = $client->invokeService($params2); var_dump($response); Please, any help is appreciated. I really don't understand this at all. I need help ASAP. Hi guys! I started working on a project involving connecting to a soap server (windows). Eight hours later i am nowhere. The documentation is horrible and searching for error messages is a task that never ends. So now i am back here to ask all you guys :-) First of all, i want to connect to a external server which ends in: Code: [Select] GatewayWebService.asmx?WSDL So i got the variable: Code: [Select] $client = new SoapClient("http://XXXXXXXX/GatewayWebService.asmx?WSDL", array('login'=> "XXXXX",'password'=> 'XXXXXX')); And i want to do a call like: Code: [Select] print($client->RetrieveArticles("Article")); So now i get an error: Code: [Select] php webservice-import.php PHP Catchable fatal error: Object of class stdClass could not be converted to string in /var/www/vhosts/test.shoerama.nl/httpdocs/maintenance/webservice-import.php on line 11 But i dont think that all above is very correct. So i want to ask you guys for some help. How can i get a call with, lets say, the first 10 records from the soap server? How do i do soap call? I recieved the following "code" from the guys that host the soap server: Code: [Select] sXml: <Parameters><timestamp>1</timestamp><branch>98</branch><pos>1</pos><languagecode></languagecode><maxitems>100</maxitems></Parameters> What do i do with this? Thanks in advance guys! |