[PHP] What good is SoapClient->__getTypes() ?

2009-02-19 Thread Shanon Swafford
Hi guys,

I'm using PHP 5.1.6 and I'm calling a WSDL that has 4 functions.

This is a brand new service opened by one of our vendors so I'm sure it is
going to change.  So I'm thinking I would like to build a page that pulls
the data structures and builds html input forms automatically.

So when I send the following code:

$client = new SoapClient($wsdl, $options);
$available_types = $client->__getTypes();
var_dump($available_types[4]);

I get back:

string(467) "struct ProvisionNewTrunk {
 string DeviceID;
 string DeviceModel;
 string PublicIP;
 string LastName;
 string FirstName;
 string Address1;
 string Address2;
 string City;
 string State;
 string ZIP;
 string Country;
 string Phone;
 string Email;
 string Department;
 string Company;
 string PromotionCode;
 string CCName;
 string CCAddress1;
 string CCAddress2;
 string CCCity;
 string CCState;
 string CCZIP;
 string CCCountry;
 string CCNumber;
 string CCExpDate;
}"

Normally I would just hard-code an array but is there any "automatic" way to
iterate through this so I can build an input form?  Besides hacking up a
str_split or something?

All my googling just turns up mirrors of php.net man pages:(

Thanks a bunch,
Shanon



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: How to Insert into DOMDocument

2008-12-06 Thread Shanon Swafford
>> Is there a way to make it create the following XML?
>> 
>> 
>> 
>> 
>>   
>>   
>> 
>> 
>> I can't seem to find any dom functions to do this.
>> 
>> Thanks in advance,
>> Shanon
>> 
>> 
>
>DOMProcessingInstruction as such:
>
>error_reporting(E_ALL | E_STRICT);
>
>$doc = new DOMDocument();
>$doc->formatOutput = true;
>
>// processing instruction data
>$styleheetParams = 'href="xsl_table.xsl" type="text/xsl"';
>
>// create processing instruction
>$xmlstylesheet = new DOMProcessingInstruction( 'xml-stylesheet',
$styleheetParams);
>
>//append it to the doc
>$doc->appendChild($xmlstylesheet);
>
>$foo = $doc->createElement("foo");
>$doc->appendChild($foo);
>
>$bar = $doc->createElement("bar");
>$foo->appendChild($bar);
>
>$bazz = $doc->createElement("bazz");
>$foo->appendChild($bazz);
>
>echo $doc->saveXML();
>
>?>

Thanks Nathan,

That worked perfect!

Shanon



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How to Insert into DOMDocument

2008-12-05 Thread Shanon Swafford

I have the following code:

#!/usr/bin/php -q
formatOutput = true;

$foo = $doc->createElement("foo");
$doc->appendChild($foo);

$bar = $doc->createElement("bar");
$foo->appendChild($bar);

$bazz = $doc->createElement("bazz");
$foo->appendChild($bazz);

echo $doc->saveXML();

?>

Which generates:



  
  


Is there a way to make it create the following XML?




  
  


I can't seem to find any dom functions to do this.

Thanks in advance,
Shanon



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] WSDL Question

2007-11-29 Thread Shanon Swafford

I build an array of the list.  Then nuSOAP helps when converting it to XML
but PHP5 can probably do the same thing.

The following builds an array of line_items to put on an order.  Then
inserts that array into another array containing more order data:

for ($i = 1; $i <= $num_items; $i++) {
   $new_order_item_list[$i] = array(
  'line_number' => $_POST[$myline],
  'item_name'   => $_POST[$myprod],
  'item_id' => $line_item[0]
   );
}

$new_order = array(
   'customer_number'   => addslashes($_POST['customer_number']),
   'customer_password' => addslashes($_POST['customer_password']),
   'customer_email'=> addslashes($_POST['customer_email']),
   'send_me_email' => 'yes',
   'po_number' => addslashes(trim($_POST['po_number'])),
   'itemlist'  => $new_order_item_list
}


This is part of the WSDL it is a client to:


http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:tns="urn:OrderService"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns="http://schemas.xmlsoap.org/wsdl/"; targetNamespace="urn:OrderService">

 http://schemas.xmlsoap.org/soap/encoding/"; />
 http://schemas.xmlsoap.org/wsdl/"; />
 
  
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
  
 
 
  
   

   
  
 
 
  
   
   
   
   
   
  
 
...
...

Regards


-Original Message-
From: Jonathan Pitcher [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 29, 2007 2:42 PM
To: php-general@lists.php.net
Subject: [PHP] WSDL Question


For the lasts day I have been fighting with PHP, and WSDL calls to a thrid
party provider.

Here is what the call needs to look like:




root

IperiaTestOrg
false


SUBSCRIBER_DEFINED_TRANSFER_NUMBER
6179672983


TIMEZONE
US/CENTRAL






I can generate most of the code in fact I can generate all of it but the
Double service setting.

Here is my relevant PHP code.

$SDT = $portal->get_post('SDT');

$SDT = new SoapVar(array('ns1:type' => 'SUBSCRIBER_DEFINED_TRANSFER_ON',
'ns1:value' => $SDT), SOAP_ENC_OBJECT);

$setting_info = array(array('ns1:serviceSetting' => $SDT));

// Getting Iperia Soap Object ...

$soap_iperia = $portal->load_special_object('soap_iperia');


$find_account_obj->accountIdentifier = new SoapVar(array('ns1:account' =>
'root'), SOAP_ENC_OBJECT);


$find_account_obj->orgID = new SoapVar('IperiaTestOrg', XSD_STRING);

$find_account_obj->suspended = new SoapVar(0, XSD_BOOLEAN);

$find_account_obj->serviceSettingCollection = new SoapVar($setting_info,
SOAP_ENC_OBJECT);

$results = $soap_iperia->modifyOrganization($find_account_obj);

That generates the following xml.




root

IperiaTestOrg
false


SUBSCRIBER_DEFINED_TRANSFER_NUMBER
6179672983





The question I have is how do I add in the extra:



TIMEZONE
US/CENTRAL


I have tried a couple ways with no success ...

Any tips would be greatly appreciated.

Jonathan Pitcher

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to Separate PHP Errors to a file different than Apache Errors

2006-12-23 Thread Shanon Swafford
>
>-Original Message-
>From: chris smith [mailto:[EMAIL PROTECTED] 
>Sent: Friday, December 22, 2006 11:29 PM
>To: Shanon Swafford
>Cc: php-general@lists.php.net
>Subject: Re: [PHP] How to Separate PHP Errors to a file different than
Apache Errors
>
>
>On 12/23/06, Shanon Swafford <[EMAIL PROTECTED]> wrote:
>> Hi Guys,
>>
>> I just cut my website over to Apache2 and PHP5 on FC5.
>>
>> So now I'm clean up all the PHP Notices.
>>
>> Does anybody know the config directives I can put in my /etc/php.ini or
>> etc/httpd/conf.d/php.conf or /etc/httpd/conf/httpd.conf so that I could
>> separate the php errors file from the apache errors file?
>
>http://www.php.net/manual/en/ref.errorfunc.php
>
>Specifically 'error_log'.
>
>This will be commented out in a default php.ini file, search for it
>there, enable it and restart your webserver.
>
>Also the webserver user has to 'own' this file (as with it's other
>logs), so check permissions.
>-- 

Thanks Chris,

I've read that but either it is not possible or I'm still missing something.

This is my setup:

/etc/php.ini
error_log = /var/log/httpd/php_errors

/etc/httpd/conf/httpd.conf
ErrorLog logs/error_log

With this:

Command line php errors show up in php_errors which is good.

But Apache php errors generated by scripts served up by Apache as web pages
all show up in error_log.

I'd like these Apache errors to go into php_errors so I can keep my "Apache:
file not found type errors" and "PHP Syntax" errors separate.

Is this possible?

Thanks again,
Shanon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How to Separate PHP Errors to a file different than Apache Errors

2006-12-22 Thread Shanon Swafford
Hi Guys,

I just cut my website over to Apache2 and PHP5 on FC5.

So now I'm clean up all the PHP Notices.

Does anybody know the config directives I can put in my /etc/php.ini or
etc/httpd/conf.d/php.conf or /etc/httpd/conf/httpd.conf so that I could
separate the php errors file from the apache errors file?



Thanks a bunch,
Shanon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Help with OpenSSL Function

2006-09-11 Thread Shanon Swafford

Hi guys,

I am trying to use Apache, PHP 4.3, and PHP's Openssl functions to encrypt a
variable.

Currently, I can successfully use the following command to encrypt an
existing file and create a new one:

openssl aes-256-cbc -e -in plain_file.xml -out encrypt_file.xml -k
1234123412341234

Is it possible to use the openssl functions in PHP 4.3 without having to use
the file system?

Can sombody help with the syntax to mimick the above to create a variable
with encrypted data from a plain text variable?

Here is a test I'm running:

It takes the following XML file:
http://71.164.193.239:8082/test.xml 

Here is the page:
http://71.164.193.239:8082/test.php

Here is the source:
http://71.164.193.239:8082/test.txt 

Problem:
1.  It spits out different data every time you refresh the test.php page.
Why?  Seems every so often, the encrypted data will be correct.

2.  I would like to get rid of shell_exec and the test.xml file.

3.  If this is not possible, how can I pass the plain variable to the
shell_exec command?

I also found mcrypt functions, but it is not available on my production
server.

Is there a better way to do this?

Thanks and have a good day,
Shanon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php