php,serialization,soap,soap-client,php-errorsRelated issues-Collection of common programming errors
user2355051
php mysql sql phpmyadmin server2go
The environment this is running in is as follows. It’s an instance of Server2Go on a thumb drive.Apache/2.2.15 (Win32), PHP/5.3.2, SQLite 2, MySQL 5.1.46-community,and Perl 5.8.The php script opens a file and loops through it line by line. A query is built and executed with the information in each line of the file. The table structure is as follows:CREATE TABLE `exp_report` (`b_unit` varchar(11) DEFAULT NULL, //IMPORTANT TO THIS PROBLEM`b_unit_title` varchar(255) DEFAULT NULL,`act_
Peter
php mysql api refresh
I post some details from a native iphone app to a php site, what write into a mysql db. After storing, an ok sign coming back (echo). When i get this, i want to refresh the content : call another php site, what read the rows, and send back (echo or printf..) My problem is, i get back the new rows only after 30sec. (the mysql include immediately -i checked via phpmadmin). I cleaned all the cookies, i set up in the header of the php site to nil, or to the date, i read it back (was else all time) a
Asad
php sql-server pdo fat-free-framework
I’m trying out Fat Free Framework in an environment where I need to connect to an MSSQL database over PDO. I wrote some code to test out the database querying functionality. Here is my first attempt:$f3->route(‘GET /datasets/read’, function($f3) {$db = new DB\SQL(‘sqlsrv:Server=192.168.**.**;Database=test’,”sa”,”*****”);$results = $db->exec(‘SELECT * FROM builds’);var_dump($results); });This works fine. I see a nice dump of all the records in the builds table. So far so good.The next thing
AKX
php mysql sql sql-injection
Keep in mind please that I am learning still. I am working on a website and I am simply adjusting and copying codes for the most part, from the existing ones, because that’s the easiest way for me to understand them.I keep getting an sql error that is caused by the use of apostrophes, and I’ve started putting in the mysql_real_escape_string() for every text field, which solved the individual problems.Now this is genuinely just me asking for help. Please don’t be sarcastic, I am really just tryin
Dasun
php html mysql forms joomla
I’m trying to add a new field type for Joomla’s AdsManager (advertising board) as it can’t be achieved properly with native fields. The field should contain 2 text inputs – from [ ] to [ ]. My current code is:$return .= ” <label for='”.$name.”from’>from</label> <input id='”.$name.”from’ name='”.$name.”[]’ type=’text’ size=’3′ maxlength=’2′ /> <label for='”.$name.”to’>to</label> <input class=’adsmanager’ id='”.$name.”to’ name='”.$na
Andy Jones
php mysql mysqli prepared-statement sql-injection
I see the oft-repeated comment “always use prepared queries to protect against SQL injection attacks”. What is the practical difference between using a prepared query and a constructed query where user input is always sanitized? Constructedfunction quote($value) {global $db; return “‘” . mysqli_real_escape_string($db, $value) . “‘”; }$sql = “INSERT INTO foo (a, b) VALUES (” . quote($a) . “,” . quote($b) . “)”;Prepared$stmt = mysqli_prepare($db, “INSERT INTO foo (a, b) VALUES (?, ?)”); mysqli_stm
ashcrok
php soap wsdl exist-db
i’m trying to type a simple access code to the eXist database, but the php goes crazy about the wsdl:The php code would sound like this:$db = new eXist();And in the eXist class, it’s by default $user=”guest”, $password=”guest”, $wsdl=”http://localhost:8080/exist/services/Query?wsdl”Well, the php doesn’t get the wsdl right: SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn’t load from ‘[http]localhost:8080/exist/services/Query?wsdl’ : failed to load external entity “[http]localhost:808
user1860536
php function preg-replace str-replace
I try change characters by functions<?php $string = “Hi everybody people [gal~images/articles~100~100~4] here other imagen [gal~images/products~100~100~3]”;$regex = “/\[(.*?)\]/”; preg_match_all($regex, $string, $matches);for($i=0; $i<count($matches[1]);$i++) { $match = $matches[1][$i]; $array = explode(‘~’, $match);//$newValuet=”gal(“”.$array[1].””,””.$array[2].””,””.$array[3].””,””.$array[4].””)”;$newValue=”gal(“.$array[1].”,”.$array[2].”,”.$array[3].”,”.$array[4].”)”;$string = str_repl
jdersen
php validation model controller laravel
I’m trying to register a user in my application while keeping all business logic in the model and as little as possible in the controller. To accomplish this, I’m running user validation in the model’s boot() method when the Class::creating() event fires. If the validation fails, I simply return false, cancelling the event. You can see this here:public static function boot() {parent::boot();User::creating(function(){$validator = new Services\Validators\RUser;if (! $validator->passes()) return
edorian
php phpunit phpstorm composer-php
I’m now trying for hours to setup phpstorm for unit testing. Whatever I do, I get thisProcess finished with exit code 1 Cannot find PHPUnit in include path …phpunit is (via commandline) asseccible from anywhere; I’ve set the correct include path and have added phpunit to the external libraries. No chance.Is it possible at all or does it only work with installations via pear? I’ve worked through all related questions here, am on mac and phpunit is running smoothly cia cli.
ObviousComplexities
java oop serialization deserialization
The error:java.lang.ClassNotFoundException: testprocedure.tp$3at java.net.URLClassLoader$1.run(Unknown Source)at java.net.URLClassLoader$1.run(Unknown Source)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(Unknown Source)at java.lang.ClassLoader.loadClass(Unknown Source)at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)at java.lang.ClassLoader.loadClass(Unknown Source)at java.lang.Class.forName0(Native Method)at java.lang.Class.forName
Bozho
java spring serialization tomcat servlets
When running an application locally on my box, the application works perfectly. When deployed to QA, the error below is received. I am running Tomcat 5.5.23 locally and in QA. The application also uses Spring MVC.ERROR 2011-03-01 16:41:42: Exception loading sessions from persistent storagejava.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.everbank.uft.entities.ldc.VoidReasonat java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)at java.io.ObjectIn
Oded
serialization eclipse-plugin classpath osgi
I am trying to desrialize an object of type A located in plugin C. Although my plugin has the proper dependency on plugin C which has type A and can also create and instantiate an object of type A, when I try to desiralize an object of type A, it fails.The reason I believe is that the java.io.* classes which are actually doing the deserialization cannot see type A.What do I have to put in the manifest of plugin C so that the system classes can see type A?Here is a stack trace I am getting-java.
unj2
java serialization clojure
I have a dummy Java Program, which I want to write in Clojure. It has a class which implements Serializable and a function which saves it. Since I have never written such programs in Clojure, I wanted to know what would be the correct way to approach this problem, what Clojure data structures, and api calls would you use?import java. io. *; public class Box implements Serializable { private int width; private int height; public void setWidth(int w){ width =w;} public void setHeight(int h){height
Marky Mark
java image serialization
I’ve been working on my game pretty much non stop since 11am this morning. And I’m just about done.But I get an error whenever I try to serialize and deserialize my data…There’s is a “game running” class that extends JFrame. And that holds other classes that are serializable. Now, when I try to serialize those objects to a file (or read them back into the program) I get an error.Here’s the gist of it:java.io.IOException: failed to load image contents at javax.swing.ImageIcon.writeObject(ImageI
Brandon
c# .net wcf json serialization
I do not like how the DataContractSerializer handles my Dictionary deserialization. My methods all return a Stream and I use the JavascriptDeserializer to return the JSON I want, but this does not help me with a Dictionary is one of the POST parameters.The JavascriptSerializer handles Dictionary’s like such:{“myKey1″:”myValue1”, “myKey2″:”myValue2”}The DataContractSerializer does this:[{“Key”:”myKey1″, “Value”:”myValue1″}, {“Key”:”myKey2″, “Value”:”myValue2″}]The problem with this, is our Androi
user63898
java serialization
i try to deserialize class from the server , but in the client im getting :java.lang.ClassNotFoundException: com.server.core.StateFilesStructwhere in my client the StateFilesStruct class with this package name:com.client.core.StateFilesStructhere is my class’s :public Object deserialize(byte[] bytes) {ByteArrayInputStream b = new ByteArrayInputStream(bytes);ObjectInputStream o = null;try {o = new ObjectInputStream(b);} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace
zyngawow
java android serialization gson
I wrote a custom (de)serializer so I could serialize my ArrayList of an interface. Here is the serializer:package com.darkraven.shoppinglist;import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.*; import java.lang.reflect.Type;class InterfaceAdapter<Item> implements JsonSerializer<Item>, JsonDeserializer<Item> {public JsonElement serialize(Item object, Type interfaceType, JsonSerializationContext context) {final JsonObject wrapper
Kev84
c# serialization datacontractserializer
I am currently trying to serialize a List, it serializes (I think fine), but when it deserialize, Sorry for the amount of code, but I am really stuck and have no idea why this is happening, i also tried to changed the struct into a class and no help.THANKS.i get the following error UPDATEDThere was an error deserializing the object of type There was an error deserializing the object of type `System.Collections.Generic.List`1[[A.B.C.DataValues, A.V, Version=1.0.0.0, Culture=neutral, PublicKeyTok
sgtz
c# serialization protobuf-net
(NOTE: Dictionary where T is some ProtoContract / ProtoMembered class works fine. ) This issue only happened for me with type object. I was trying to serialize a dictionary of Dictionary working. typeof(object) doesn’t work. Should it? Should I implement a string based work around?In this scenario, object will only ever be a .net primitive.[Test]public void De_SerializeObjectDictionary2(){var d = new Dictionary<string, object>();d.Add(“abc”, 12);var ms = new MemoryStream();var model =
ashcrok
php soap wsdl exist-db
i’m trying to type a simple access code to the eXist database, but the php goes crazy about the wsdl:The php code would sound like this:$db = new eXist();And in the eXist class, it’s by default $user=”guest”, $password=”guest”, $wsdl=”http://localhost:8080/exist/services/Query?wsdl”Well, the php doesn’t get the wsdl right: SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn’t load from ‘[http]localhost:8080/exist/services/Query?wsdl’ : failed to load external entity “[http]localhost:808
Will
java web-services soap wsgen
I’m creating a webservice using JAX-WS’s (JSR 224’s) @WebService and @WebMethod annotations. Although I’ve found the specification, I can’t find the limitations I’m running into documented anywhere.Here’s what I’ve stumbled across so far using JAX-WS 2.1.6 provided with JDK 6:You cannot use interfaces as parameters, return values, or object members All classes must provide a no-args default constructorWhat are the limitations of wsgen? Which constructs should I avoid?I’ve also stumbled across s
Nandan Jain
authentication soap ntlm
I am trying to consume a SOAP based web service. I have written consumer using CXF 2.5.7 API. Web service has a NTML authentication implemented. I am passing userid and password when invoking it. Code is working fine and I am able to see the response. Same code is also working on one of my college machine but it is throwing error on other colleague’s machine. It throws java.io.IOException: Authentication failure exception. Though we all are able to access WSDL on explorer. I am not sure where is
athspk
java android web-services soap ksoap2
i have a problem with my webservice, it’s running fine, but i need to send a array in the request and dont know how to do that… i read, that ksoap does not support arrays in a requesthow can i trick the service and send an array of int?this is my code, which is working very well with all types :)SoapObject result = null; SoapObject request = new SoapObject(NAMESPACE, methodname);request.addProperty(“int”,new int[] {8,345,34,86,1,}); SoapSerializationEnvelope envelope = new SoapSerializationEnv
hakre
php soap wsdl simplexml stdclass
My background is Java. I somehow thought diving into PHP would be fun.I have a WSDL file with a few methods defined that I need to call. Each method typically has one request and one response type defined. These types are all one or two levels deep, no attributes – only elements. Nothing fancy. Almost all methods requires some common arguments, like “username” and “password”.I thought I’d test drive all of this and so I created an indirection which handles passing the standard arguments. The pro
Pradeep Pati
soap websphere websphere-6.1 saaj
I am trying to deploy a war in the Websphere Application Server (6.1) and I am getting the following linkage error. I have tried both parent first, and parent last class loader policy. Any tip on how to solve this issue?[4/14/13 7:07:00:948 GMT] 00000023 http I WSSERVLET12: JAX-WS context listener initializing [4/14/13 7:07:01:209 GMT] 00000023 http E WSSERVLET11: failed to parse runtime descriptor: java.lang.LinkageError: You are loading old SAAJ from jar:file:/C:/Program%
Justin
java soap paypal
This is my first attempt generating a web service client. I’m at a loss how to rectify this error. I have a PayPalAPIInterfaceService.java and Netbeans IDE inform me that’s an error: public PayPalInterfaceService(WebServiceFeature…features){super(__getwsdlLocation(), PAYPALINTERFACESERVICE_QNAME, features);Here’s the error message:cannot find symbol symbol : method_getWsdlLocation() location: classebay.api.paypalapi.PayPalAPIInterfaceServiceAnd the error log from Tomcat:17-Oct-2012 06:24:16
user2339071
java soap rmi mule
I have a question about mule RMItransportsThis is Example_RMITest.xml<spring:bean name=”jndiContext” factory-bean=”jndiFactory” factory-method=”create”/><rmi:connector name=”rmi” jndiContext-ref=”jndiContext” securityPolicy=”rmi.policy”/> <rmi:endpoint name=”hello” host=”localhost” port=”1099″ object=”HelloServer”method=”hello” methodArgumentTypes=”java.lang.String”/>The exception is:org.mule.module.launcher.DeploymentInitException: ClassNotFoundException: org.mule.transport.rm
fharreau
c# web-services wcf soap
Here is my approach (don’t hesitate to tell me if I am doing something wrong) :-Write XSD files defining my objects-Use WSCF.blue to generate WSDL accordingly to the XSDs-Use WSCF.blue to generate Web Service Code-Implementing a stub and exposing the SVCSo far, I am not facing any problem. I can access to the .svc through my browser. But the thing is the deployed WSDL is not the same as the designed one.When I tried to test the service with SOAP UI and the designed WSDL as source, it failed beca
Kiran Babu
java web-services soap jax-ws jax-rpc
i am new to webservices, am developing a webservice using jaxrpc, i followed the steps given in the follow link.https://cwiki.apache.org/GMOxDOC22/developing-jax-rpc-web-services.htmlwhen i try to run it am getting error as followsDistribution of module failed. See log for details. Could not construct URI for web service location org.apache.geronimo.common.DeploymentException: Could not construct URI for web service locationat org.apache.geronimo.webservices.builder.PortInfo.initialize(PortInfo
AndroidLearner
spring soap soap-client spring-ws
Hi, I am trying to make a simple soap client work using Spring-ws. The googling I’ve done on this error says I’m using Soap 1.1 and need to specify Soap 1.2. I’ve tried to do that. Am I doing it correctly below? If this is not the problem does anybody see what the problem is? Here’s a chunk of the stack trace: org.springframework.ws.client.WebServiceTransportException: Cannot process the message because the content type ‘text/xml; charset=utf-8’ was not the expected type ‘application/soap+xml
hakre
php paypal soap-client
$wsdl = “https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl”; $soap = new SoapClient($wsdl);throws the error:SOAP-ERROR: Parsing Schema: unexpected in sequenceTried on PHP versions 5.3.4, 5.3.0
hakre
php parsing wsdl soap-client
I have the following in a wsdl provdided by my service provider:<xsd:import namespace=”http://web-service-provider.com/2004/10/10″ schemaLocation=”ASchemas.xsd”/> <xsd:import namespace=”http://web-service-provider.com/2004/10/10″ schemaLocation=”BSchemas.xsd”/> <xsd:import namespace=”http://web-service-provider.com/2004/10/10″ schemaLocation=”CSchemas.xsd”/>and I get the following error when the SoapClient tries to parse the wsdl:SOAP-ERROR: Parsing Schema: unexpected <impor
hakre
php xml soap soap-client
So, I’m trying to work with SoapClient in php and I’m having an issue structuring my XML. I’m working with a soap API that’s expecting the following XML:<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:app=”http://app.whatever.com/”><soapenv:Header/><soapenv:Body><app:WhateverCleanseAddress><app:address><address Address1=”9100 Wilshire Blvd” Address2=”Ste 900″ Address3=”” City=”Beverly Hills” State=”CA” Zip=”90212″ Country=”US
Bruce McGee
delphi deployment soap-client
I built a Delphi-7 Windows Application which uses some web services. The application is built in such a way that it does not require run-time DLLs. When I deployed it on a Windows 2003 server it fails while calling the web service. It results in error “Access violation at address 00c05269. Write of address 00c05269”. I believe the reasons is that it needs some package to be installed. Can anybody help me to figure that out?TIA
DanJ
python wsdl soap-client suds
I’m trying to write a Python client for a a WSDL service. I’m using the Suds library to handle the soap messages. When I try to call the service, I get a suds exception: <rval /> not mapped to message part. If I set the retxml suds option I get XML which looks OK to me.Is the problem with the client code? Am I missing some flag which will allow Suds to correctly parse the XML? Alternatively, the problem could be with the server. Is the XML not structured correctly?Thanks, DanMy code is a f
Patrick
.net visual-c++ soap soap-client webservice-client
My application has its own scripting language of which I cannot get rid of (lots of customer-specific scripts written). Now my customers are asking if it would be possible to call a SOAP service from within that scripting language. Of course, the SOAP service that needs to be called will be different for every customer. This leaves me with several options:Use the WSDL utility to generate customer-specific SOAP client proxies and put the customer-specific logic in my application Use the WSDL u
hakre
php soap apache2 soap-client
Below I have included a stack trace of my PHP Client attempting to talk with the server. The client and server both read in the WSDL file file, so that part if of no concern.As you can see by the second stack trace array item, I’m passing in a two dimensional array, but when the SoapServer does it’s __doRequest() function, the array has been concatenated into a single, unmanageable string. Any solution on how to fix this would be greatly appreciated.Internal Server ErrorArray ( [0] => Array([
PKKG
php soap soap-client
Hello I’ve been trying the last days to do a request but it doesn’t work, I think it’s problem of the generated XML but I can’t get the last request, __getLastRequest() method returns a NULL value, this is my code:class AuthHeader{var $userName;var $password;var $authentication;var $locale;var $timeZone;public function __construct($param){$this->userName = $param[“userName”];$this->password = $param[“password”];if(isset($param[“authentication”])){$this->authentication = $param[“authenti
Cas Van Der Weegen
php xml soap wsdl soap-client
I’m currently working on getting information (availability of product from a manufacturer) from a soap web-service using WSDL.I’m stuck on getting the actual request through to the service, I tried the following.When I list the usable functions and data-types using:$client = new SoapClient( ‘<<<url omitted>>>’, array( ‘trace’=>1 ) ); echo ‘<pre>’; print_r( $client->__getFunctions() ); print_r( $client->__getTypes() ); echo ‘</pre>’;I get the following resp
hakre
php arrays string php-errors notice
I have an ecommerce site based off of this tutorial.Now, in the cart.php page, whenever someone updates the quantity and proceeds to click the Update Cart button, they are greeted with the following notices:Notice: Array to string conversion in /home/aquadual/public_html/fiverrproject/plaincart/library/config.php on line 51Notice: Array to string conversion in /home/aquadual/public_html/fiverrproject/plaincart/library/config.php on line 51Notice: Array to string conversion in /home/aquadual/publ
Jon Erickson
php curl error-handling php-errors parse.com
I am utilizing parse.com and the PHP library for interacting with the framework is only working for me on a mac using MAMP, but on windows using XAMPP or WAMP, it fails for the same reason each time. Below is the function called each time a connection is made to parse. When ran on windows, $responseCode = 0 and $response is false. When I run it on my Mac, $responseCode = 200 and $response returns the json data it is suppose too. What is going on? Why would the different platforms be causing a fa
hakre
php simplexml php-errors
This code was working and when we upgraded to php 5.3.10 it stopped working and started throwing some really odd errors.The original XML validates on w3c.org without errors however I’ve edited out the site specific for brevity and security.The XML (edited for brevity but error is produced on line 1):<AmberAlertDirective xmlns=”http://www.hidden.com/AmberAlert” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.hidden.com/en_US/AmberAlert.xsd”><Dire
hakre
php xml soap php-errors ota
I am trying to call web service via SOAP. I feel that the PHP request looks about right. Below is the SOAP PHP code and, the XML. Please let me know what may be wrong. I technically keep getting response of object has no property. This is the error message:Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no ‘schema’ property $client = new SoapClient(‘Link.asmx?wsdl’,array(‘soap_version’ => SOAP_1_1,’trace’ => 1,) );$result = $client->OTA_VehAva
hakre
php soap php-errors
I’m trying to access WSDL(Web Service Definition Language) file using SoapClient() of PHP. I found that WSDL file is authenticated. I tried with passing credentials on an array by another parameter and active SSL on my server, still I’m getting an error.Here is the code I’m using:$client = newSoapClient(“https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl”,array(“trace”=> “1”,”Username” => “username”,”Password” => “password”));Here is the error I’m getting:Warning:SoapClient::Soa
hakre
php soap php-errors webservice-client soapfault
I work on a projet which use a Soap based webservice queried by PHP and 2 native smartphone apps (ios and android) , after some edits made by the webservice development team, things were broken on PHP side but no problems from smartphone apps.here is a simple script to reproduce the problem <?php error_reporting(E_ALL); $url = ‘http://www.xxxxx.com/service.awws?wsdl’; $sKey = ‘thekey’;$client= new SoapClient($url, array(‘trace’ => 1,’exception’ => 1,’encoding’ => ‘UT
hakre
php serialization soap soap-client php-errors
I’m writing a PHP application which uses a number of SOAP web services to gather data.I’m getting significant overheads in instantiating all those objects: in some cases a single line of code $object = new SoapClient($wsdl); can take over three seconds. It obviously only takes a few of those to make a web page feel really slow.To speed things up a bit, I figured I’d serialise the objects and store them in the session (or somewhere similar), so I wrote the following function:function soap_client(
user1547410
php soap encoding php-errors byte-order-mark
Ive looked at similar errors and i think its most likely due to a BOM character but to be honest most of the other coding is in a different context and i just dont understand it, im not that familiar with soap and just use it to pull the data then format it in php.My code is simple:$activityClient = xpmClient::getModuleInstance(‘activity’, $remoteSessionId, ‘xxx.5pmweb.com’); $filter = new stdClass(); $count = 300; $offset = 0; $activityList = $activityClient->getList($filter, $offset, $count
hakre
php exception-handling php-errors
Exception handling in php … I have noticed some quirks that seem to make it a tedious matter to implement properly. First off, most legacy php functions do not throw exceptions per se, it seems one has to implement set_error_handler and have the callback throw functions. Ok. Minor annoyance but let’s see what gives. OH! Great, now everything throws an exception, and of course, the worst part: uncaught exceptions halt the script.So, kind of got to figure after reading the manual and other pos
hakre
php soap soap-client php-errors soapfault
mblox soap api – php soap Payment Request not working and gives error.I use as below code in subscribe.php file…$client = new SoapClient(“https://ngp.us.mblox.com/client-gateway/services?wsdl”, array(‘trace’ => 1, ‘encoding’ => ‘UTF-8’, ‘soap_version’ => SOAP_1_2));$array = array( ‘SecurityContext’=>array(‘userId’=>’aaaaaaaa’,’password’=>’bbbbbbbb’), ‘ClientDetails’=>array(‘shortcode’=>’234242’, ‘brandName’=>’aaaaaaaaaa.com’, ‘programSponsor’=>’aaaaaaaaaa’, ‘ori
Web site is in building