[PHP] PHP/ Soap issue
I am hoping there's a SOAP expert on the list as this is driving me mad and Google doesn't come up with much help ... I am trying to build a fairly simple web service in SOAP -- the client sends a string SKU to query a product catalogue database and receives product pricing data - I am using a WSDL file which validates OK ... anyway I keep getting this error:- SOAP-ERROR: Encoding: object has no 'name' property The PHP code is below:- $client = new SoapClient('http://example.com/catalogue.wsdl',array('trace' = 1,'exceptions' = 0)); $sku = '12345'; $client-getProduct($sku); I can post the wsdl file contents if necessary. Hoping someone can help point me in the right direction! TIA Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/ Soap issue
On 01/09/2011 14:07, Louis Huppenbauer wrote: I think it would be best if you could provide us with the .wsdl (and possibly with the server-code). Thanks for the quick response Louis.. WSDL ?xml version=1.0 encoding=UTF-8? definitions name=CatalogueService targetNamespace=http://example.com/catalogue.wsdl; xmlns=http://schemas.xmlsoap.org/wsdl/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:tns=http://example.com/catalogue.wsdl; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsd1=http://example.com/schema; types xsd:schema targetNamespace=http://example.com/schema; xmlns=http://www.w3.org/2001/XMLSchema; xsd:complexType name=product xsd:sequence xsd:element name=name type=xsd:string/ xsd:element name=description type=xsd:string/ xsd:element name=price type=xsd:double/ xsd:element name=SKU type=xsd:string/ /xsd:sequence /xsd:complexType /xsd:schema /types message name=getProductRequest part name=sku type=xsd:string/ /message message name=getProductResponse part name=product type=xsd1:product/ /message portType name=Product_PortType operation name=getProduct input message=tns:getProductRequest/ output message=tns:getProductResponse/ /operation /portType binding name=Product_Binding type=tns:Product_PortType soap:binding style=rpc transport=http://schemas.xmlsoap.org/soap/http/ operation name=getProduct soap:operation soapAction=urn:examples:CatalogueService/ input soap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:examples:CatalogueService use=encoded/ /input output soap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:examples:CatalogueService use=encoded/ /output /operation /binding service name=Product_Service port name=Product_Port binding=tns:Product_Binding soap:address location=http://example.com/api/catalogue/ /port /service /definitions SERVER CODE ini_set('soap.wsdl_cache_enabled',false); $server = new SoapServer('http://example.com/catalogue.wsdl'); $server-handle();
Re: [PHP] PHP/ Soap issue
On 01/09/2011 14:16, Richard Quadling wrote: Can you give me the URL for the WSDL file? Either online or by direct email. Thanks for the quick response Richard -- I have just posted the WSDL in my earlier resply to Louis... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/ Soap issue
On 1 September 2011 13:27, richard gray r...@richgray.com wrote: On 01/09/2011 14:16, Richard Quadling wrote: Can you give me the URL for the WSDL file? Either online or by direct email. Thanks for the quick response Richard -- I have just posted the WSDL in my earlier resply to Louis... Is there any chance of having the live URL? That way I can show exactly what/where the issue lies. I can build my test code for the WSDL file but I can't test it as the URLs are junk. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/ Soap issue
On 1 September 2011 13:35, Richard Quadling rquadl...@gmail.com wrote: On 1 September 2011 13:27, richard gray r...@richgray.com wrote: On 01/09/2011 14:16, Richard Quadling wrote: Can you give me the URL for the WSDL file? Either online or by direct email. Thanks for the quick response Richard -- I have just posted the WSDL in my earlier resply to Louis... Is there any chance of having the live URL? That way I can show exactly what/where the issue lies. I can build my test code for the WSDL file but I can't test it as the URLs are junk. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea Unless of course, you own example.com! -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/ Soap issue
I think it would be best if you could provide us with the .wsdl (and possibly with the server-code). 2011/9/1 richard gray r...@richgray.com I am hoping there's a SOAP expert on the list as this is driving me mad and Google doesn't come up with much help ... I am trying to build a fairly simple web service in SOAP -- the client sends a string SKU to query a product catalogue database and receives product pricing data - I am using a WSDL file which validates OK ... anyway I keep getting this error:- SOAP-ERROR: Encoding: object has no 'name' property The PHP code is below:- $client = new SoapClient('http://example.**com/catalogue.wsdlhttp://example.com/catalogue.wsdl ',array('**trace' = 1,'exceptions' = 0)); $sku = '12345'; $client-getProduct($sku); I can post the wsdl file contents if necessary. Hoping someone can help point me in the right direction! TIA Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/ Soap issue
On 1 September 2011 13:02, richard gray r...@richgray.com wrote: I am hoping there's a SOAP expert on the list as this is driving me mad and Google doesn't come up with much help ... I am trying to build a fairly simple web service in SOAP -- the client sends a string SKU to query a product catalogue database and receives product pricing data - I am using a WSDL file which validates OK ... anyway I keep getting this error:- SOAP-ERROR: Encoding: object has no 'name' property The PHP code is below:- $client = new SoapClient('http://example.com/catalogue.wsdl',array('trace' = 1,'exceptions' = 0)); $sku = '12345'; $client-getProduct($sku); I can post the wsdl file contents if necessary. Hoping someone can help point me in the right direction! TIA Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Can you give me the URL for the WSDL file? Either online or by direct email. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/ Soap issue
On 1 September 2011 13:25, richard gray r...@richgray.com wrote: On 01/09/2011 14:07, Louis Huppenbauer wrote: I think it would be best if you could provide us with the .wsdl (and possibly with the server-code). Thanks for the quick response Louis.. We need the URL for the WSDL file. Without that, we don't know what is happening. The WSDL content you've supplied is not tied to a real server. It just uses the example.com domain as a way of showing you a placeholder where your real URLs would exist. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP, Soap, and WDSL
One more question. How would I parse the data below so that I only display the section - information=info_2 I've read a few articles on xml name spaces and none have helped. ?xml version=1.0 encoding=utf-16?soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; xmlns=http://nowhere.com/wsdl;soap:Bodyresponse status=complete version=46 resource_type=data_1 ns=username op_type=get_data data_1 id=ID 1 information=info_2/ /response/soap:Body/soap:Envelope I tried the following which give me an error in foreach $test2 = simplexml_load_file('file.xml') or die(Error: Cannot create object); $test = $test2-xpath('Envelope/Body/response/data_1/@information'); foreach($test as $test) { echo $test.PHP_EOL; } From: sbs_comput...@hotmail.com To: chris...@gmail.com; jang...@jangita.com CC: php-general@lists.php.net Subject: RE: [PHP] PHP, Soap, and WDSL Date: Fri, 3 Sep 2010 09:05:52 -0400 Thanks guys. Both methods worked. Gino Date: Fri, 3 Sep 2010 08:31:06 -0400 From: chris...@gmail.com To: jang...@jangita.com CC: php-general@lists.php.net Subject: Re: [PHP] PHP, Soap, and WDSL Alternatively you can pass the var through htmlspecialchars... echo htmlspecialchars( $response ); and for a really simple solution you can echo it inside a textarea... echo textarea $response /textarea; Though you'll likely want to increase the size of the textarea! ;-) Chris. On Fri, Sep 3, 2010 at 3:39 AM, Jangita jang...@jangita.com wrote: On 02/09/2010 10:51 p, SBS Computers wrote: It's as if the data is not getting to my php page? The view source shows the following data: ?xml version=1.0 encoding=utf-16?soap:Envelope xmlns:soap= http://schemas.xmlsoap.org/soap/envelope/; . . .bunch of data . . /response/soap:Body/soap:Envelope Seems like the data is getting there OK. But a browser normally will not output normal xml and hides it (unless there is a body / tag or other tags that normally display output since it is using the text/html MIME add this line header('Content-type: text/plain'); before the echo and see what happens. Also make sure there is no other output (echo or any html tags) before the line above -- Jangita | +256 76 91 8383 | Y! MSN: jang...@yahoo.com Skype: jangita | GTalk: jangita.nyag...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP, Soap, and WDSL
On 02/09/2010 10:51 p, SBS Computers wrote: It's as if the data is not getting to my php page? The view source shows the following data: ?xml version=1.0 encoding=utf-16?soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; . . .bunch of data . . /response/soap:Body/soap:Envelope Seems like the data is getting there OK. But a browser normally will not output normal xml and hides it (unless there is a body / tag or other tags that normally display output since it is using the text/html MIME add this line header('Content-type: text/plain'); before the echo and see what happens. Also make sure there is no other output (echo or any html tags) before the line above -- Jangita | +256 76 91 8383 | Y! MSN: jang...@yahoo.com Skype: jangita | GTalk: jangita.nyag...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP, Soap, and WDSL
Alternatively you can pass the var through htmlspecialchars... echo htmlspecialchars( $response ); and for a really simple solution you can echo it inside a textarea... echo textarea $response /textarea; Though you'll likely want to increase the size of the textarea! ;-) Chris. On Fri, Sep 3, 2010 at 3:39 AM, Jangita jang...@jangita.com wrote: On 02/09/2010 10:51 p, SBS Computers wrote: It's as if the data is not getting to my php page? The view source shows the following data: ?xml version=1.0 encoding=utf-16?soap:Envelope xmlns:soap= http://schemas.xmlsoap.org/soap/envelope/; . . .bunch of data . . /response/soap:Body/soap:Envelope Seems like the data is getting there OK. But a browser normally will not output normal xml and hides it (unless there is a body / tag or other tags that normally display output since it is using the text/html MIME add this line header('Content-type: text/plain'); before the echo and see what happens. Also make sure there is no other output (echo or any html tags) before the line above -- Jangita | +256 76 91 8383 | Y! MSN: jang...@yahoo.com Skype: jangita | GTalk: jangita.nyag...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP, Soap, and WDSL
Thanks guys. Both methods worked. Gino Date: Fri, 3 Sep 2010 08:31:06 -0400 From: chris...@gmail.com To: jang...@jangita.com CC: php-general@lists.php.net Subject: Re: [PHP] PHP, Soap, and WDSL Alternatively you can pass the var through htmlspecialchars... echo htmlspecialchars( $response ); and for a really simple solution you can echo it inside a textarea... echo textarea $response /textarea; Though you'll likely want to increase the size of the textarea! ;-) Chris. On Fri, Sep 3, 2010 at 3:39 AM, Jangita jang...@jangita.com wrote: On 02/09/2010 10:51 p, SBS Computers wrote: It's as if the data is not getting to my php page? The view source shows the following data: ?xml version=1.0 encoding=utf-16?soap:Envelope xmlns:soap= http://schemas.xmlsoap.org/soap/envelope/; . . .bunch of data . . /response/soap:Body/soap:Envelope Seems like the data is getting there OK. But a browser normally will not output normal xml and hides it (unless there is a body / tag or other tags that normally display output since it is using the text/html MIME add this line header('Content-type: text/plain'); before the echo and see what happens. Also make sure there is no other output (echo or any html tags) before the line above -- Jangita | +256 76 91 8383 | Y! MSN: jang...@yahoo.com Skype: jangita | GTalk: jangita.nyag...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP SOAP Using SAML
Hi Anybody, I am evaluating to use Webservices to solve an knowed Issue. I need to know, if it is Possible to use SAML 1.0 with PHP 4 or PHP 5 and when yes, where can i get information about this Issue or open Source Software,etc. Regards Carlos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP SOAP Using SAML
Hi, take a look to Lasso. They claims it support SAML 2.0. http://lasso.entrouvert.org/ Karel Carlos Medina napsal(a): Hi Anybody, I am evaluating to use Webservices to solve an knowed Issue. I need to know, if it is Possible to use SAML 1.0 with PHP 4 or PHP 5 and when yes, where can i get information about this Issue or open Source Software,etc. Regards Carlos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/SOAP WDSL Restrictions
Hi All, I'm struggling with the WDSL restrictions in PHP/SOAP for a while know. I would like to create some simple restrictions in my WDSL file. The script are running both on the same server with PHP Version 5.2.6 with the official soap extension. On both my client and server there is some error configuration: error_reporting(E_ALL); ini_set(soap.wsdl_cache_enabled, 0); use_soap_error_handler(true); In my WDSL file there are some restrictions like: A rule to accept only numbers, PHP/SOAP is translating not numbers to 0. (but I want an error message!) xsd:element name=streetNumber minOccurs=1 maxOccurs=1 type=xsd:int Almost the same for this more advanced restriction, you can provide every string. There is no error message and the whole string is accepted by my server. xsd:simpleType name=Email xsd:restriction base=xsd:string xsd:pattern value=^[_a-z0-9-]+(\.[_a-z0-9-]+)[EMAIL PROTECTED](\.[a-z0-9-]+)*$ /xsd:pattern /xsd:restriction /xsd:simpleType I hope there are some people that have some more experience with PHP/SOAP and the use of restrictions who can help me with this! Best regards, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP SOAP Client formats
This is a typical .NET vs. PHP interop problem, and happens because the .NET services (or clients) expect the payload to be namespace qualified as you have figured out. I too have looked into this with PHP SOAP extension, and what I gathered is that the WSDL mode implementation needs to pick the qualifying namespace and make that the default namespace of payload. However, I could not locate the exact point in C code to fix this. Samisa... Michael Gross wrote: Hi I have a similar problem, only the other way round: the server is PHP, the client is C#. I found that the problem is that the xmlns=https://api.authorize.net/soap/v1/; in the AuthenticateTest-tag is needed. I tried to modify the PHP source code, but I had no success yet (it would be fantastic, if someone could give me a hint where the XML representation is built). Michael Tim Traver wrote: The problem that I have is that the server that I am talking to (that is not in my control), will accept the following SOAP call ?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 AuthenticateTest xmlns=https://api.authorize.net/soap/v1/; merchantAuthentication namename/name transactionKeystring/transactionKey /merchantAuthentication /AuthenticateTest /soap:Body /soap:Envelope -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP SOAP Client formats
Hi I have a similar problem, only the other way round: the server is PHP, the client is C#. I found that the problem is that the xmlns=https://api.authorize.net/soap/v1/; in the AuthenticateTest-tag is needed. I tried to modify the PHP source code, but I had no success yet (it would be fantastic, if someone could give me a hint where the XML representation is built). Michael Tim Traver wrote: The problem that I have is that the server that I am talking to (that is not in my control), will accept the following SOAP call ?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 AuthenticateTest xmlns=https://api.authorize.net/soap/v1/; merchantAuthentication namename/name transactionKeystring/transactionKey /merchantAuthentication /AuthenticateTest /soap:Body /soap:Envelope -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP SOAP Client formats
On Wed, January 9, 2008 9:45 pm, Tim Traver wrote: Thank you for answering, but the issue is that the PHP SOAPClient classes actually create that xml to send, so I have no control over the xml that is sent with a call command to the SOAP object... I just wondered if there was any flags that I am missing that might bring the php stuff in line with what the server expects. If there are any such flags, they'd be documented in the manual. If there aren't, perhaps you can find another SOAP constructor tool in PHP. I know there have been at least 3 or 4 popular ones over the years. And while the built-in one in PHP 5 is by far the best/easiest to use generally, you might be better off using nuSoap or somesuch even if it's a PITA, because it might construct the kind of SOAP envelope the other server is expecting. I would definitely recommend abstracting it as much as possible, though, so you can upgrade easily to a better SOAP implementation if the other end changes their software. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP SOAP Client formats
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Monday, January 14, 2008 7:21 PM To: Tim Traver Cc: Bastien Koert; PHP General List Subject: Re: [PHP] PHP SOAP Client formats On Wed, January 9, 2008 9:45 pm, Tim Traver wrote: Thank you for answering, but the issue is that the PHP SOAPClient classes actually create that xml to send, so I have no control over the xml that is sent with a call command to the SOAP object... I just wondered if there was any flags that I am missing that might bring the php stuff in line with what the server expects. If there are any such flags, they'd be documented in the manual. If there aren't, perhaps you can find another SOAP constructor tool in PHP. I know there have been at least 3 or 4 popular ones over the years. And while the built-in one in PHP 5 is by far the best/easiest to use generally, you might be better off using nuSoap or somesuch even if it's a PITA, because it might construct the kind of SOAP envelope the other server is expecting. I would definitely recommend abstracting it as much as possible, though, so you can upgrade easily to a better SOAP implementation if the other end changes their software. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? The only problem I had with nuSOAP was a name clash with the PHP 5 native extension. But they fixed it in November (there was a previous non-official fix also.. but can't remember the link right now). nuSOAP has been around for several years and it's working for PHP 4 or PHP 5. So far it's doing the job pretty well (what's more, for a SOAP API, chances are that nuSOAP is included along with the code samples). Though I didn't run any benchmarks, its speed is more than enough for my taste, when caching the WSDL object (in fact, most of the time will be spent in the server to server roundtrip). So... my vote for nuSOAP. However, if you are using the native extension and have specific needs for the XML request, you can override the __doRequest() method http://php.net/manual/en/function.soap-soapclient-dorequest.php (there's an example in the manual notes). Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP SOAP Client formats
On Jan 14, 2008 8:48 PM, Andrés Robinet [EMAIL PROTECTED] wrote: The only problem I had with nuSOAP was a name clash with the PHP 5 native extension. But they fixed it in November (there was a previous non-official fix also.. but can't remember the link right now). nuSOAP has been around for several years and it's working for PHP 4 or PHP 5. So far it's doing the job pretty well (what's more, for a SOAP API, chances are that nuSOAP is included along with the code samples). Though I didn't run any benchmarks, its speed is more than enough for my taste, when caching the WSDL object (in fact, most of the time will be spent in the server to server roundtrip). So... my vote for nuSOAP. i understand what youre saying, that the network i/o will typically constitute the most time in a SOAP request. i would imagine however that the php5 extension is much faster at building the request and parsing the response since nuSOAP is written entirely in php. i had to use it once and found the lack of documentation appalling. although, to be fair, id also say for anything beyond simple requests the documentation on the php site for the SOAPClient and related classes, could be more descriptive. i would label this thread as a case-in-point. -nathan
[PHP] PHP SOAP Client formats
Hi all, ok, I am a little bit new to the SOAP game, but I understand it, and am using it to talk to an outside API. The problem that I have is that the server that I am talking to (that is not in my control), will accept the following SOAP call ?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 AuthenticateTest xmlns=https://api.authorize.net/soap/v1/; merchantAuthentication namename/name transactionKeystring/transactionKey /merchantAuthentication /AuthenticateTest /soap:Body /soap:Envelope But it refuses a call that I have made using the SOAPClient PHP classes that look like this : ?xml version=1.0 encoding=UTF-8? SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:ns1=https://api.authorize.net/soap/v1/; SOAP-ENV:Body ns1:AuthenticateTest merchantAuthentication namename/name transactionKeystring/transactionKey /merchantAuthentication /ns1:AuthenticateTest /SOAP-ENV:Body /SOAP-ENV:Envelope It appears that the one that PHP creates is all in line with all of the latest standards, and I know that the server is a Microsoft IIS server. Does anyone know any parameters that I can use with the PHP SOAP client that could help me contruct the request like the top one??? I don't want to have to build the text myself, and open a socket and send the text manually like I did to verify that the top one works, and the bottom one doesn't. Thanks, Tim.
RE: [PHP] PHP SOAP Client formats
XML is case sensitive. I notice the case of the xml is different. Try making the PHP created xml the same case. Bastien Date: Wed, 9 Jan 2008 13:54:36 -0800 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] PHP SOAP Client formats Hi all, ok, I am a little bit new to the SOAP game, but I understand it, and am using it to talk to an outside API. The problem that I have is that the server that I am talking to (that is not in my control), will accept the following SOAP call ?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 AuthenticateTest xmlns=https://api.authorize.net/soap/v1/; merchantAuthentication namename/name transactionKeystring/transactionKey /merchantAuthentication /AuthenticateTest /soap:Body /soap:Envelope But it refuses a call that I have made using the SOAPClient PHP classes that look like this : ?xml version=1.0 encoding=UTF-8? SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:ns1=https://api.authorize.net/soap/v1/; SOAP-ENV:Body ns1:AuthenticateTest merchantAuthentication namename/name transactionKeystring/transactionKey /merchantAuthentication /ns1:AuthenticateTest /SOAP-ENV:Body /SOAP-ENV:Envelope It appears that the one that PHP creates is all in line with all of the latest standards, and I know that the server is a Microsoft IIS server. Does anyone know any parameters that I can use with the PHP SOAP client that could help me contruct the request like the top one??? I don't want to have to build the text myself, and open a socket and send the text manually like I did to verify that the top one works, and the bottom one doesn't. Thanks, Tim. _ Use fowl language with Chicktionary. Click here to start playing! http://puzzles.sympatico.msn.ca/chicktionary/index.html?icid=htmlsig
Re: [PHP] PHP SOAP Client formats
Bastien, Thank you for answering, but the issue is that the PHP SOAPClient classes actually create that xml to send, so I have no control over the xml that is sent with a call command to the SOAP object... I just wondered if there was any flags that I am missing that might bring the php stuff in line with what the server expects. I want to use PHP's built in classes for this so I don't have to manually send xml to the api... Thanks, Tim. Bastien Koert wrote: XML is case sensitive. I notice the case of the xml is different. Try making the PHP created xml the same case. Bastien Date: Wed, 9 Jan 2008 13:54:36 -0800 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] PHP SOAP Client formats Hi all, ok, I am a little bit new to the SOAP game, but I understand it, and am using it to talk to an outside API. The problem that I have is that the server that I am talking to (that is not in my control), will accept the following SOAP call ?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 AuthenticateTest xmlns=https://api.authorize.net/soap/v1/; merchantAuthentication namename/name transactionKeystring/transactionKey /merchantAuthentication /AuthenticateTest /soap:Body /soap:Envelope But it refuses a call that I have made using the SOAPClient PHP classes that look like this : ?xml version=1.0 encoding=UTF-8? SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:ns1=https://api.authorize.net/soap/v1/; SOAP-ENV:Body ns1:AuthenticateTest merchantAuthentication namename/name transactionKeystring/transactionKey /merchantAuthentication /ns1:AuthenticateTest /SOAP-ENV:Body /SOAP-ENV:Envelope It appears that the one that PHP creates is all in line with all of the latest standards, and I know that the server is a Microsoft IIS server. Does anyone know any parameters that I can use with the PHP SOAP client that could help me contruct the request like the top one??? I don't want to have to build the text myself, and open a socket and send the text manually like I did to verify that the top one works, and the bottom one doesn't. Thanks, Tim. HO HO HO, if you've been nice this year, email Santa! Visit asksanta.ca to learn more! http://asksanta.ca/?icid=SANTAENCA005
Re: [PHP] PHP SOAP Client formats
On Jan 9, 2008 10:45 PM, Tim Traver [EMAIL PROTECTED] wrote: Bastien, I want to use PHP's built in classes for this so I don't have to manually send xml to the api... writing the xml by hand would be madness... i didnt want to spend all night screwing around w/ it, since i dont have any credentials to test w/, but if you look on the auth.net website you will see they have a robust api in several languages, including php, that happens to use the SoapClient class from php5. there is a nice manual, http://www.authorize.net/support/CIM_SOAP_guide.pdf in it i found the service call you have mentioned in your initial post, at that point in the document is a link to sample code http://developer.authorize.net/dscode/php_cim.zip which should have everything you need to interact w/ the auth.net services in php (at a cursory glance). -nathan
Re: [PHP] PHP SOAP Client formats
Nathan Nobbe wrote: On Jan 9, 2008 10:45 PM, Tim Traver [EMAIL PROTECTED] wrote: Bastien, I want to use PHP's built in classes for this so I don't have to manually send xml to the api... writing the xml by hand would be madness... i didnt want to spend all night screwing around w/ it, since i dont have any credentials to test w/, but if you look on the auth.net website you will see they have a robust api in several languages, including php, that happens to use the SoapClient class from php5. there is a nice manual, http://www.authorize.net/support/CIM_SOAP_guide.pdf in it i found the service call you have mentioned in your initial post, at that point in the document is a link to sample code http://developer.authorize.net/dscode/php_cim.zip which should have everything you need to interact w/ the auth.net services in php (at a cursory glance). -nathan Hey Nathan, Thanks...that's actually really funny, because they must have put the PHP sample code for the CIM method in there within the last week, because that was why I was writing my own SOAP stuff to interact with them (using those manuals)... The issue that I ended up running in to was that the SOAP calls I was making were getting errors back, and I couldn't get anyone from authorize.net to give me any support for what the issue was... Hopefully, their PHP class will do the trick... Thanks, Tim.
Re: [PHP] PHP SOAP for production
Reuben D. Budiardja said the following on 10/01/05 14:41: Hello, On Saturday 01 October 2005 17:13, jonathan wrote: you could try the native SOAP extension in php5. I've looked at the php.net and saw (no version information, might be only in CVS) in the docs. So is this already in the released version of PHP 5 or not ? Yes, already in the release version: http://ca3.php.net/manual/en/ref.soap.php For php4 try nusoap: http://sourceforge.net/projects/nusoap/ - Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP SOAP for production
Hello, I need to implement a client for Web services. My first option is to use SOAP, but it seems that the pear SOAP package is still in beta. Do you think it's ready for a production quality site? If not, what are my other options? What do people use in this case? Thank you. RDB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP SOAP for production
you could try the native SOAP extension in php5. A client asked me about this recently and I told him I thought he should use java / axis because of problems with PHP / SOAP specifically as it relates to handling certain data types. -jonathan On Oct 1, 2005, at 1:49 PM, Reuben D. Budiardja wrote: Hello, I need to implement a client for Web services. My first option is to use SOAP, but it seems that the pear SOAP package is still in beta. Do you think it's ready for a production quality site? If not, what are my other options? What do people use in this case? Thank you. RDB -- 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] PHP SOAP for production
Hello, On Saturday 01 October 2005 17:13, jonathan wrote: you could try the native SOAP extension in php5. A client asked me about this recently and I told him I thought he should use java / axis because of problems with PHP / SOAP specifically as it relates to handling certain data types. -jonathan I've looked at the php.net and saw (no version information, might be only in CVS) in the docs. So is this already in the released version of PHP 5 or not ? I haven't been exactly following with what's going on in PHP 5. I already have my applications working and it was written and run with PHP 4. This SOAP part is an extension to try to integrate my apps with other apps (ie. authentication) in the company I am working for. If SOAP is natively supported in PHP 5 and better (and faster) than the PEAR extension, then maybe it's worth my efforts to migrate to PHP 5. But otherwise, I am rather reluctant to fix what's not broken (ie. upgrading to PHP 5) since that means I have to install PHP 5 and reconfigure the webserver again. Thanks for any comments, suggestions, or opinions. RDB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP SOAP Client question
The following wsdl file was provided to me. http://64.122.63.81:5454/IfxService.wsdl I first attempted to genrate the PHP classes using the following code... ?php require_once('SOAP/Client.php'); $wsdl=new SOAP_WSDL('http://64.122.63.81:5454/IfxService.wsdl); // Look at the generated code... echo ( $wsdl-generateProxyCode() ); ? -- I was expecting this code to generate a code makes use of the underlying SOAP_Client class - that is I was expecting to see each functions. But what I found is this: class WebService_IfxService_IfxService extends SOAP_Client { function WebService_IfxService_IfxService() { $this-SOAP_Client(http://64.122.63.81:5454/IfxService.asmx;, 0); } function IfxRequest($IFX) { $IFX = new SOAP_Value('{}IFX','',$IFX); return $this-call(IfxRequest, $v = array(IFX=$IFX), array('namespace'='https://www.cashsystemsinc.com/ifx/150/bindings', 'soapaction'='https://www.cashsystemsinc.com/ifx/150/WebService/IfxRequest', 'style'='document', 'use'='literal' )); } } Any Idea what is going on here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP SOAP Client question
PHPDiscuss - PHP Newsgroups and mailing lists wrote: The following wsdl file was provided to me. http://64.122.63.81:5454/IfxService.wsdl I first attempted to genrate the PHP classes using the following code... ?php require_once('SOAP/Client.php'); $wsdl=new SOAP_WSDL('http://64.122.63.81:5454/IfxService.wsdl); // Look at the generated code... echo ( $wsdl-generateProxyCode() ); ? -- I was expecting this code to generate a code makes use of the underlying SOAP_Client class - that is I was expecting to see each functions. It does make use of the underlying SOAP_Client class. the generated class is a subclass of the SOAP_Client class a subclass inherited all methods from its superclass, unless these methods need different functionality in the subclass they are not (should not) be overloaded (or whatever the correct f** term is in PHPland). But what I found is this: class WebService_IfxService_IfxService extends SOAP_Client ^--- the important bit! it means that WebService_IfxService_IfxService is a SOAP_Client class and has all the methods available for use that are defined in the class definition for SOAP_Client. { function WebService_IfxService_IfxService() { $this-SOAP_Client(http://64.122.63.81:5454/IfxService.asmx;, 0); } function IfxRequest($IFX) { $IFX = new SOAP_Value('{}IFX','',$IFX); return $this-call(IfxRequest, $v = array(IFX=$IFX), array('namespace'='https://www.cashsystemsinc.com/ifx/150/bindings', 'soapaction'='https://www.cashsystemsinc.com/ifx/150/WebService/IfxRequest', 'style'='document', 'use'='literal' )); } } Any Idea what is going on here? think I do (although I have never touched SOAP and have little experience with code generators!) I hope that my comments give you a little insight too :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP SOAP?
Hi, I have been looking for a PHP implementation of SOAP. I have noticed PHP SOAP on sourceforge but it seems that it is still in early stages. Could someone lead me in the right direction? Thanks, Chris Boothe [EMAIL PROTECTED]