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
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.