|
Hi all,
This is my first post so go easy with me.
I doubt anyone's familiar with RightNow CRM, but it's this application's database I'm manipulating with the use of SOAP. RightNow is a Customer Relationship Management application and is basically a large database which allows people to store information of any kind relating to pretty much anything they want.
This application provides functionality called Custom Objects. Custom Objects allow people to build specific functionality within RightNow and make it available to users. For example, a custom object 'Computer' might be created and information such as its manufacturer, specification and price may be stored. Think of them much as objects in OOP.
I am currently trying to create (or instantiate) an Accreditation object that I have built in RightNow using WSDL. I'm using a tool called
WSDL2PHP which has generated a set of classes and functions from the WSDL file, which I've been using to perform operations progammatically in RightNow.
My problem lies with the SOAP that is being generated. Specifically, an element 'DataValue', which is supposed to contain a child element 'StringValue', is continually being output as '<ns1:datavalue>' with no child. The WSDL file describes DataValue thus:
<xs:element name="DataValue" type="DataValue"/>
<xs:complexType name="DataValue">
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="Base64BinaryValue" type="xs:base64Binary" minOccurs="1" maxOccurs="1"/>
<xs:element name="BooleanValue" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
<xs:element name="BooleanValueList" type="xs:boolean" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="DateTimeValue" type="xs:dateTime" minOccurs="1" maxOccurs="1"/>
<xs:element name="DateTimeValueList" type="xs:dateTime" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="DateValue" type="xs:date" minOccurs="1" maxOccurs="1"/>
<xs:element name="DateValueList" type="xs:date" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="DecimalValue" type="xs:double" minOccurs="1" maxOccurs="1"/>
<xs:element name="DecimalValueList" type="xs:double" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="IDValue" type="rnb_v1:ID" minOccurs="1" maxOccurs="1"/>
<xs:element name="IDValueList" type="rnb_v1:ID" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="IntegerValue" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="IntegerValueList" type="xs:int" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="LongValue" type="xs:long" minOccurs="1" maxOccurs="1"/>
<xs:element name="LongValueList" type="xs:long" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="NamedIDDeltaValueList" type="rnb_v1:NamedIDDelta" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="NamedIDHierarchyValue" type="rnb_v1:NamedIDHierarchy" minOccurs="1" maxOccurs="1"/>
<xs:element name="NamedIDHierarchyValueList" type="rnb_v1:NamedIDHierarchy" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="NamedIDValue" type="rnb_v1:NamedID" minOccurs="1" maxOccurs="1"/>
<xs:element name="NamedIDValueList" type="rnb_v1:NamedID" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="ObjectValue" type="GenericObject" minOccurs="1" maxOccurs="1"/>
<xs:element name="ObjectValueList" type="GenericObject" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="StringValue" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="StringValueList" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
</xs:complexType>
The code that WSDL2PHP has generated for DataValue is thus:
class DataValue {
public $Base64BinaryValue; // base64Binary
public $BooleanValue; // boolean
public $BooleanValueList; // boolean
public $DateTimeValue; // dateTime
public $DateTimeValueList; // dateTime
public $DateValue; // date
public $DateValueList; // date
public $DecimalValue; // double
public $DecimalValueList; // double
public $IDValue; // ID
public $IDValueList; // ID
public $IntegerValue; // int
public $IntegerValueList; // int
public $LongValue; // long
public $LongValueList; // long
public $NamedIDDeltaValueList; // NamedIDDelta
public $NamedIDHierarchyValue; // NamedIDHierarchy
public $NamedIDHierarchyValueList; // NamedIDHierarchy
public $NamedIDValue; // NamedID
public $NamedIDValueList; // NamedID
public $ObjectValue; // GenericObject
public $ObjectValueList; // GenericObject
public $StringValue; // string
public $StringValueList; // string
}
The code that I have used to set a StringValue for DataValue is thus:
$dataValue = new DataValue();
$dataValue->StringValue = 'TEST';
However, the DataValue element is always being output, as previously mentioned, like this in the SOAP: <ns1:datavalue>. Would anyone be able to put forward a reason as to why this is happening? As far as I can see the classes that WSDL2PHP has generated are correct and I have not had the same trouble when using other complexTypes.
Many thanks,
Chris.
|
|
|
|
|
I'm currently working on a Calendar for our companies intranet site. I've got the basic functionality of the calendar working but I'm running into a problem when I want to change months. I've gotten this to work fine in ASP but trying to do this in PHP has me stumped. All I'm trying to do right now is a basic "next month", "previous month". Everything I've tried just reloads the page and nothing changes as I'm sure I'm losing my variable values in the process. I guess what I'm asking is how can I just update the table that I have to display the Calendar and not the whole page?
|
|
|
|
|
<?php
echo "<pre>";
print_r($_POST);
echo "</pre>";
?>
Place the above in your target page to find out what is being passed to it.
|
|
|
|
|
First off I haven't done anything PHP in about 8 years so please bear with me. I'm currently changing over my work from ASP to PHP as we are now running a Linux Server. What I'd like to do is be able to shorten up my "work" by using functions (I think that is the correct term) but I'm not sure if I can do what I want.
What I would like to do is put something similar into a function so I can obviously change some of the parameters based on the department for a phone list. I figured I'd start off easy so chose this page first.
echo tr td colspan=4 Portland Collection Department /td /tr;
echo tr td Name /td td ext /td td eMail /td td Position /td /tr>;
$result = mysql_query("SELECT name, extension, email, position FROM employee where department = 'Collection Department'");
$cnt=0;
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
row_color($cnt++,"9966CC","FFFFFF");
echo td>.$row{'name'}."/td>";
echo "td>".$row{'extension'}."/td>";
echo "td>".$row{'email'}."/td>";
echo "td>".$row{'position'}."/td>/tr>";
}
I'm going to probably change some of the layout but if I can get the basics down again it'll give me a good place to start. Thank you in advance for your help.
|
|
|
|
|
I'm not sure you code was displayed correctly or not but it looks close to how I would do it.
<?php
$dbh = mysql_connect("","","");
mysql_select_db("");
$sql = "select name, phone1 from contacts";
$rst - mysql_query($sql) or die(mysql(error());
if(mysql_num_rows($rst)>0)
{
$i=0;
echo "<table class='contact_list'>\n";
echo "<tr><th>NAME</th><th>PHONE #</th></tr>\n";
while($row = mysql_fetch_assoc($rst))
{
$bgcolor = "#fff;";
if($i%2) $bgcolor = "#ddf;";
echo "<tr style='background-color:".$bgcolor."'><td>".$row['name']."</td><td>".$row['phone1']."</td></tr>";
}
echo "</table>\n";
}
else
{
echo "<p class='notice'>No records founds.</p>\n";
}
?>
modified on Wednesday, December 8, 2010 4:06 PM
|
|
|
|
|
The code wasn't displayed properly, for some reason it kept trying to parse it even though I had it in the code block, not sure what I did wrong there.
Anyways, I got it to work (kinda) on my own during the day. However the problem I'm running into (if it is a problem) is that I'm not able to get more than one "include" to work. Am I limited to one or am I doing it wrong. I was trying something like the following:
<?php
include('config.php');
include('format.php');
basic("Portland","Collection");
?>
just an example as I can't remember what it was off had as it's at work but config has the database info in it and the format has basically what I posted above (i.e. the table layouts). Also to get it to work I had to put everything in config.php
just a side note, the above code droped the <`?php (minus the ` in it) (still not sure what I'm doing wrong there...
|
|
|
|
|
To get the code to display correctly in this forum i do a copy and past of the info between the pre tags. The forum will automatically convert some tags into urlencoded version for proper display.
With the include issue it sound like you are having a failure in one of the includes and it is not being reported, displayed in the browser. That maybe be due to the php.ini settings regarding error reporting. On particular odd errors I can sometimes run a script from the command line and I will see some hidden errors displayed. Otherwise I will use an echo string to narrow my debug search...also keep an eye on page and function name capitalization because on linux it is very strict. IE: format.php is not the same as Format.php. Windows is more relaxed on this issue.
edit - just remembered Linux may want a full path too.
Hope I'm helping ya.
Chris J.
|
|
|
|
|
I'll try using the full path and see if that helps.
|
|
|
|
|
Hello,
I am using a div tag in a page called profiles.php whos left content is being brought in by using require_once...
<div class="divMain_Left">
<?php require_once('left.php'); ?>
</div>
whilst this works fine and I have links in the page left.php that is being fed in to the div, I would like when any of these links are clicked to have it open in the same div tag? I have tried the target options but none of them seem to open within the div tag and they just open a new page.
If anybody could point me in the right direction please.
Many thanks in advance
Regards
Ray
|
|
|
|
|
Thats how links work, to just have the divs contents refreshed and not the page you have 2 options I can think of.
1) use an frame or iframe.
2) use ajax.
Of the two, ajax, is I think the better option.
|
|
|
|
|
What you're trying to do can't be done by inlining the included content with include() or require().
The content that you wish to include will require an additional request to the server for the new content and this will need to be rendered to be browser either using AJAX or an iframe. AJAX would be generally accepted to be the best practice in this case.
This is somewhat advanced stuff, but the jQuery library would make this relatively easy. You would assign a function to the onclick event of the link that would "get" the content from the content URL.
For more information, see:
http://www.w3schools.com/htmldom/default.asp[^]
http://api.jquery.com/jQuery.get/[^]
|
|
|
|
|
I want to make a binary tree structure for my multi level marketing website but not able to get it.
It could be great if someone could link me to a good tutorial or if someone can help me through this.
|
|
|
|
|
I'm not sure what you want exactly, but take a look at these:
PHP Binary Tree[^]
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Thanks bro that link helped me alot
|
|
|
|
|
All,
I working on PHP with Zend Framework. I could not able to debug my application.
I am getting the exception as below,
An error occurred
Page not found
Exception information:
Message: Action "indexPhp" does not exist and was not trapped in __call()
Stack trace:
#0 /var/www/html/sample/library/Zend/Controller/Action.php(515): Zend_Controller_Action->__call('indexPhpAction', Array)
#1 /var/www/html/sample/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('indexPhpAction')
#2 /var/www/html/sample/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#3 /var/www/html/sample/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#4 /var/www/html/sample/application/Bootstrap.php(11): Zend_Application_Bootstrap_Bootstrap->run()
#5 /var/www/html/sample/library/Zend/Application.php(366): Bootstrap->run()
#6 /var/www/html/sample/public/index.php(12): Zend_Application->run()
#7 {main}
Request Parameters:
array (
'controller' => 'public',
'action' => 'index.php',
'module' => 'default',
)
How to fix this issue?. Any idea please..
Regards,
Periyasamy.R
|
|
|
|
|
All,
I am working in PHP with Zend Framework. while i am trying to log in, i am getting the error as below,
Fatal error: Call to undefined function mcrypt_get_iv_size() in /var/www/html/sample/application/controllers/BaseController.php on line 52
How can i fix this issue?.
Any idea please.
Regards,
Periyasamy.R
modified on Friday, December 3, 2010 4:50 AM
|
|
|
|
|
<b>Getting Started with InstallShield Automation and Perl</b>
It's true, even Windows users succumb to the allure of extensibility and readability of Perl. Some even opt to use it to automate the build processes of their products and associated installers.
But, there's a problem. The InstallShield Help Library generally provides examples in the most ubiquitous Windows scripting language -- VBScript. The idea behind this is that working with COM Objects and Collections will be specific to the language in question, and that the core ideas behind the VBScript samples will apply to each in a very similar fashion.
While this indeed does hold to be true, it can be daunting if you are suddenly tasked with writing a script from scratch. Below are some of the VBScript examples from the InstallShield Help, translated to Perl.
read the blog at <a href="http://blogs.flexerasoftware.com/installtalk/2010/12/getting-started-with-installshield-automation-and-perl.html">http://blogs.flexerasoftware.com/installtalk/2010/12/getting-started-with-installshield-automation-and-perl.html</a>[<a href="http://blogs.flexerasoftware.com/installtalk/2010/12/getting-started-with-installshield-automation-and-perl.html" target="_blank" title="New Window">^</a>]
|
|
|
|
|
What's a best way to create breadcrumbs in a site? Well i know the process but the problem is the site pages are not structured in best possible way - there is no sitemap and all.
Thank you
|
|
|
|
|
I have used a mapping table with a structure like so
id page parent
1 index 0
2 about 1
3 products 1
4 cars 3
5 trucks 3
and so on...
I can then code some logic to build a breadcrumb dynamically based on the page name I am on.
Simply reference the parent until you get to a 0 with a 0 representing the top level menu.
so for example if someone is on page trucks the code will step over the rows in this order
5 trucks
3 products
1 index
build this in a string using a left to right order
first pass:
$bc = "/"."trucks";
second pass:
$bc = "/"."products".$bc;
third pass:
$bc = "/"."index".$bc;
of course you will want to add links instead of plain text.
You can also pregenerate the breadcrums and store those if your site is not very dynamic and you have control over the input of new pages.
Hope that helps.
Chris J
|
|
|
|
|
thanks for your input but what to do about the links? I mean there will be 100s of links. So according to your solution i should have another coloumn with link to each page which is cumbersome task i think ?
Or do you have another solution for that ?
Thank you
Andyyy
|
|
|
|
|
you could build your table dynamically, i.e. have each page add itself to the table. something like:
$myURL=$_SERVER["REQUEST_URI"];
AddPageToPageTable("shortNameSeenInBreadCrumb", "MyParentsShortName", $myURL);
Obviously all (non-leaf) "shortNameSeenInBreadCrumb" should be unique, the method should avoid duplicates, and would have a problem when it doesn't find the page's parent in the table already.
|
|
|
|
|
id page parent
1 index 0
2 about 1
3 products 1
4 cars 3
5 trucks 3
If you name the lookup the same as the real page minus the extension you can build any part of the pathway dynamically.
You will need an array to keep track of the full path at each part of the breadcrumb.
so the array would need to look like this
<?php
$bc_arr = array();
$depth_guage = 0;
$home_not_found=true;
$cur_pg_name = "";
while($home_not_found)
{
$sql = "select pr1.*, (select pr2.page from page_relations as pr2 where pr2.id=pr1.parent) as parrent_name, (select pr2.parent from page_relations as pr2 where pr2.id=pr1.parent) as grandparent from page_relations as pr1 where page='".$cur_pg_name."'";
$rst = mysql_query($sql) or die(mysql_error();
$row = mysql_fetch_row($rst);
if($row['grandparent']==0)
{
$home_not_found=false;
}
else
{
}
array_push($bc_arr,"<a href='".str_repeat("../",$depth_guage).$row['page'].".php'> > ".$row['page']."</a>");
$depth_guage++;
?>
once you are out of the loop that builds your breadcrumbs you can step back though it and echo the results.
again I have not tested this code, but it is the general idea on how I have done it in the past.
modified on Thursday, December 2, 2010 12:36 PM
|
|
|
|
|
Though you said that you don't have a site-map, does your site have a defined directory structure? For example, if you have a "news" module, are they in a directory like "/news/january/xxxx.php"? If that is the case, then you can use the request URI and explode it on the slashes. From there you can infer the breadcrumb depth. Of course, there are always exceptions, so I've used that in conjunction with a variable defined in an include file $breadcrumb, and then set that to be whatever breadcrumb I want. When it comes time to render it, I just check to see if that $breadcrumb variable is set. If it is not set, then use the directory structure, otherwise use the overridden value.
I'm sure there are many other ways, but this was quick and easy provided the directories make sense.
|
|
|
|
|
I have a HTML page which sends lots of field values(more than 100) to a PHP page to be INSERTed into Database.
Because of the huge number of fields, I decided to GET Variables and their values via Decoding URL. This works! But the problem is:
As it will be ECHOed, the Query is alright but the INSERT is not done!
It should be cited that I do manual INSERTing in this page, so there isn`t any problem with CONNECTION, DATABASE, TABLE and etc.!
plz help me! It is walking on my nerves!
Here is my PHP code:
__________________________________________________________
__________________________________________________________
Connection.php:
|
|
|
|
|
Two cents of advice:
1.
please show code in PRE tags, it improves readability, hence it will yield more or better replies.
2.
include error handling in all your code. (almost?) every MySQL function returns a result code, and when it is not OK you should call a function to get detailed reasons, as in:
$Results=mysql_query($query);
if (!$Results) die("DB Error in WriteQuery ($query)".mysql_error());
|
|
|
|