[PHP] PHP5 SOAP...
I'm working on a project using SOAP and WS-Security in which I am failing miserably. Is there a way to inspect the actual XML, header, etc. that is actually being sent. I feel like I am constructing the call correctly, and I know exactly what needs to be sent, but I dont know how to see exactly what is sent - all I get back are useless errors like not enough information sent, etc... Any ideas? Any SOAP pros out there? Russell Jones CTO Virante, Inc. r...@virante.com 919-459-1035
RE: [PHP] PHP5 SOAP...
hi russell... isn't the actual soap data/packet that's being sent over the wire viewable via an app like livehttpheaders... (at least from firefox) or are you looking for something in much more detail... -Original Message- From: rjon...@gmail.com [mailto:rjon...@gmail.com]on Behalf Of Russell Jones Sent: Tuesday, June 16, 2009 8:22 AM To: PHP General Subject: [PHP] PHP5 SOAP... I'm working on a project using SOAP and WS-Security in which I am failing miserably. Is there a way to inspect the actual XML, header, etc. that is actually being sent. I feel like I am constructing the call correctly, and I know exactly what needs to be sent, but I dont know how to see exactly what is sent - all I get back are useless errors like not enough information sent, etc... Any ideas? Any SOAP pros out there? Russell Jones CTO Virante, Inc. r...@virante.com 919-459-1035 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 SOAP...
Hi, Wednesday, June 17, 2009, 1:21:47 AM, you wrote: RJ I'm working on a project using SOAP and WS-Security in which I am failing RJ miserably. RJ Is there a way to inspect the actual XML, header, etc. that is actually RJ being sent. I feel like I am constructing the call correctly, and I know RJ exactly what needs to be sent, but I dont know how to see exactly what is RJ sent - all I get back are useless errors like not enough information sent, RJ etc... RJ Any ideas? Any SOAP pros out there? RJ Russell Jones RJ CTO Virante, Inc. RJ r...@virante.com RJ 919-459-1035 Not a pro but... Try something like this: //object to pass function variables class requestObject { function requestObject($list) { foreach($list as $key=$val) $this-$key = $val; } } $client = new SoapClient(wsdl.xml, array('login'= login, 'password'= password, 'trace'=true)); $soapstruct = new requestObject(array('clientId'=12342, 'leagueId'=0)); //use whatever variables are needed try { $info = $client-soapFunction($soapstruct); echo REQUEST:\n . $client-__getLastRequest() . br /\n; print_r($info); } catch (SoapFault $e) { echo SOAP Fault: .$e-getMessage().br /\n; echo REQUEST:\n . $client-__getLastRequest() . br /\n; } -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 - SOAP extension and WSDL generation
Hi there, I'm trying to find out how to generate a WSDL with the functions I am providing as web services, and I'm finding various posts on the net that say it's not possible with the SOAP extension built in PHP5. At the same time, I find that http://www.php.net/manual/en/soap.constants.php lists four constants that have to do with WSDL caching: WSDL_CACHE_NONE (integer) WSDL_CACHE_DISK (integer) WSDL_CACHE_MEMORY (integer) WSDL_CACHE_BOTH (integer) which apparently are only used in the http://www.php.net/manual/en/soapserver.soapserver.php method. so I'm a bit confused about the lack of info there. Why would the extension not include a WSDL-generation method for one given server object while other libraries (NuSOAP and PEAR::SOAP) do? Isn't that kind of pushing users away from the core extension? I mean, generating a WSDL is not a funny job, but many services will need one and a developer doesn't want to be updating his at every change he makes in his service function, does he? Thank you, Yannick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php5 SOAP WSDL parsing
I'm trying to get PHP5 to talk to a web service that I am developing. I have created a wsdl for the service (http://www.symgate.com/symgate/symgate.wsdl) and am trying to get PHP to parse it. (The wsdl validates in a number of tools I've pointed at it, including mindreef soapscope and the wsdl analyser on xmethods.net) When I try and get PHP5 to read the file, I get an error that it not very helpful. My code says: try { $client = new SoapClient ( http://www.symgate.com/symgate/symgate.wsdl; ) ; } catch ( SoapFault $fault ) { echo $fault ; exit ; } The output says: SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: unexpected in complexType in /var/www/localhost/htdocs/soap1.php:5 Stack trace: #0 /var/www/localhost/htdocs/soap1.php(5): SoapClient-__construct('http://www.symg...') #1 {main} This is obviously truncated. I've tried looking at the apache2 error_log but I can't see any further detail. I'd really like to know what PHP's problem is with my wsdl. How can I see the full output of this error? Thanks, Simon -- Simon Detheridge SEN Developer, Widgit Software This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php5 SOAP WSDL parsing
Simon Detheridge wrote: I'm trying to get PHP5 to talk to a web service that I am developing. I have created a wsdl for the service (http://www.symgate.com/symgate/symgate.wsdl) and am trying to get PHP to parse it. (The wsdl validates in a number of tools I've pointed at it, including mindreef soapscope and the wsdl analyser on xmethods.net) When I try and get PHP5 to read the file, I get an error that it not very helpful. My code says: is php choking on the comment?: !--xsd:include schemaLocation=cml.xsd /-- or maybe it's choking on the 'included' cml.xsd whihc doesn't define a charset in its 'header'? just thinking out loud there... try { $client = new SoapClient ( http://www.symgate.com/symgate/symgate.wsdl; ) ; } catch ( SoapFault $fault ) { echo $fault ; try this instead: echo 'pre'; var_dump($fault); exit; doubt that it will tell you anymore though. exit ; } The output says: SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: unexpected in complexType in /var/www/localhost/htdocs/soap1.php:5 Stack trace: #0 /var/www/localhost/htdocs/soap1.php(5): SoapClient-__construct('http://www.symg...') #1 {main} This is obviously truncated. I've tried looking at the apache2 error_log but I can't see any further detail. I'd really like to know what PHP's problem is with my wsdl. How can I see the full output of this error? Thanks, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php5 SOAP WSDL parsing
Thanks for your response. Quoting Jochem Maas [EMAIL PROTECTED]: Simon Detheridge wrote: I'm trying to get PHP5 to talk to a web service that I am developing. is php choking on the comment?: !--xsd:include schemaLocation=cml.xsd /-- I've removed the comments from the file. No luck. or maybe it's choking on the 'included' cml.xsd whihc doesn't define a charset in its 'header'? just thinking out loud there... Fixed, and no dice there either. try { $client = new SoapClient ( http://www.symgate.com/symgate/symgate.wsdl; ) ; } catch ( SoapFault $fault ) { echo $fault ; try this instead: echo 'pre'; var_dump($fault); exit; doubt that it will tell you anymore though. It provides more data about where it failed in the PHP, but the internal error string is still: SOAP-ERROR: Parsing Schema: unexpected in complexType Actaully, it turns out that in the original message I posted, the message wasn't truncated - just insuffucently verbose to derive any meaningful reason as to why it failed. All I currently know is that php found an unexpected nothing in a complexType. It doesn't tell me which complexType, or anything that might enable me to debug this usefully. I am at a loss. Simon This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php5 SOAP WSDL parsing
another guess: does the php soap extension maybe think that 'complexType' (all of them) needs a name attrib? (try giving them bogus names?) Simon Detheridge wrote: Thanks for your response. Quoting Jochem Maas [EMAIL PROTECTED]: Simon Detheridge wrote: I'm trying to get PHP5 to talk to a web service that I am developing. is php choking on the comment?: !--xsd:include schemaLocation=cml.xsd /-- I've removed the comments from the file. No luck. or maybe it's choking on the 'included' cml.xsd whihc doesn't define a charset in its 'header'? just thinking out loud there... Fixed, and no dice there either. try { $client = new SoapClient ( http://www.symgate.com/symgate/symgate.wsdl; ) ; } catch ( SoapFault $fault ) { echo $fault ; try this instead: echo 'pre'; var_dump($fault); exit; doubt that it will tell you anymore though. It provides more data about where it failed in the PHP, but the internal error string is still: SOAP-ERROR: Parsing Schema: unexpected in complexType Actaully, it turns out that in the original message I posted, the message wasn't truncated - just insuffucently verbose to derive any meaningful reason as to why it failed. All I currently know is that php found an unexpected nothing in a complexType. It doesn't tell me which complexType, or anything that might enable me to debug this usefully. I am at a loss. Simon This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php5 SOAP WSDL parsing
Simon, It would appear you've not included the full message. Please look at the source of the message in your web browser. The space between unexpected and in complexType probably contains an XML tag. David Simon Detheridge wrote: I'm trying to get PHP5 to talk to a web service that I am developing. I have created a wsdl for the service (http://www.symgate.com/symgate/symgate.wsdl) and am trying to get PHP to parse it. (The wsdl validates in a number of tools I've pointed at it, including mindreef soapscope and the wsdl analyser on xmethods.net) When I try and get PHP5 to read the file, I get an error that it not very helpful. My code says: try { $client = new SoapClient ( http://www.symgate.com/symgate/symgate.wsdl; ) ; } catch ( SoapFault $fault ) { echo $fault ; exit ; } The output says: SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: unexpected in complexType in /var/www/localhost/htdocs/soap1.php:5 Stack trace: #0 /var/www/localhost/htdocs/soap1.php(5): SoapClient-__construct('http://www.symg...') #1 {main} This is obviously truncated. I've tried looking at the apache2 error_log but I can't see any further detail. I'd really like to know what PHP's problem is with my wsdl. How can I see the full output of this error? Thanks, Simon -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5, Soap, WSDL, and unbounded xsd:choice types.
I have a problem with PHP talking to my non-php webservice. The problem arises because I have a list of elements in an umbounded xsd:choice type, which are supposed to be parsed in the correct order. Unfortunately, PHP groups them together per-type instead of in the order they appear in the document. ** warning: the example below is not taken from real data... I've created a simple example based on what my more complex project is actually doing. It may not be 100% accurate, but serves to show the problem behaviour. For example, let's say I have the following element: xsd:element name='foo' xsd:complexType xsd:choice minOccurs='1' maxOccurs='unbounded' xsd:element name='bar' type='xsd:string' / xsd:element name='baz' type='xsd:string' / /xsd:choice /xsd:complexType /xsd:element Now, let's assume that this comes as a soap response, encoded document/literal, with the following data: foo barOne/bar bazTwo/baz barThree/bar bazFour/baz /foo For an element of this type, when php parses my WSDL, it generates the following type (according to SoapClient-__getTypes() ): struct foo { string bar; string baz; } Now... Upon parsing the result of the transaction, I get the following: [foo] = stdClass Object ( [bar] = Array ( [0] = One [1] = Three ) [baz] = Array ( [0] = Two [1] = Four ) ) --- end of example --- What I want PHP to do, is enable me to access my 'bar' and 'baz' elements in the order in which they appear in the document, instead of having it glob them together for each type. However, I am unable to modify the output of the webservice itself as it interoperates nicely with other things already. Can I get There from Here with PHP's own SoapClient, or do I have to parse the xml by hand? Thanks, Simon -- Simon Detheridge SEN Developer, Widgit Software This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 Soap extension and generate wsdl
Hi there, im just wondering if its possible to setup your web service and let it generate a wsdl file for clients when u request the script with a wsdl flag like with nusoap ? Im rather not having to code an entire wsdl document for the web service if possible :\ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 Soap + .NET Webservice
Thanks Richard, I think I might start on a slightly simpler service, it seems MS has done its best to complicate everything. I have managed to get something working, but, god knows why the their example web service is sending back schema data as well as the result data, quite over the top. I'm guessing it helps their .NET stuff all work together nicely. Anyway, thanks again. Chris. Richard Lynch wrote: On Mon, October 10, 2005 4:40 am, Chris Hemmings wrote: Can anyone explain how this works, and, how to fix it. I'm can't find any documentation on the problem I am having. colon-separated name-spaces in XML are a relatively new development. Your XML parser probably is not up to speed on them yet... You'd have to upgrade your XML parser, or replace it with one that is aware of this newer XML format. I forget the precise terminology for colon-separated name-spaces in XML, so your first task is to find out what the heck it's called. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 Soap + .NET Webservice
Hello, Can anyone explain how this works, and, how to fix it. I'm can't find any documentation on the problem I am having. I'm using a .NET webservice and a PHP SOAP call using version 5.0.4. The returned result does not seem correct because of all the stuff at the top, the 'xs' stuff. This makes the result invalid XML because there are two roots to the document, xs:schema and diffgr:diffgram I use the following call to the service and this seems to work correctly. ?php $client = new SoapClient( http://xxx/authorswebservice/authorsservice.asmx?WSDL; ); $response=$client-GetAuthors(); $xmls=$response-GetAuthorsResult-any; ? $xmls then contains: xs:schema xmlns:mstns=http://www.tempuri.org/authors1.xsd; xmlns=http://www.tempuri.org/authors1.xsd; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:msdata=urn:schemas-microsoft-com:xml-msdata id=authors1 targetNamespace=http://www.tempuri.org/authors1.xsd; attributeFormDefault=qualified elementFormDefault=qualified xs:element name=authors1 msdata:IsDataSet=true msdata:Locale=en-GB xs:complexType xs:choice maxOccurs=unbounded xs:element name=authors xs:complexType xs:sequence xs:element name=au_id type=xs:string / xs:element name=au_lname type=xs:string / xs:element name=au_fname type=xs:string / xs:element name=city type=xs:string minOccurs=0 / /xs:sequence /xs:complexType /xs:element /xs:choice /xs:complexType xs:unique name=Constraint1 msdata:PrimaryKey=true xs:selector xpath=.//mstns:authors / xs:field xpath=mstns:au_id / /xs:unique /xs:element /xs:schema diffgr:diffgram xmlns:msdata=urn:schemas-microsoft-com:xml-msdata xmlns:diffgr=urn:schemas-microsoft-com:xml-diffgram-v1 authors1 xmlns=http://www.tempuri.org/authors1.xsd; authors diffgr:id=authors19 msdata:rowOrder=1 au_id807-91-6654/au_id au_lnamePanteley/au_lname au_fnameSylvia/au_fname cityRockville/city /authors authors diffgr:id=authors20 msdata:rowOrder=2 au_id846-92-7186/au_id au_lnameHunter/au_lname au_fnameSheryl/au_fname cityPalo Alto/city /authors authors diffgr:id=authors21 msdata:rowOrder=3 au_id893-72-1158/au_id au_lnameMcBadden/au_lname au_fnameHeather/au_fname cityVacaville/city /authors authors diffgr:id=authors22 msdata:rowOrder=4 au_id899-46-2035/au_id au_lnameRinger/au_lname au_fnameAnne/au_fname citySalt Lake City/city /authors authors diffgr:id=authors23 msdata:rowOrder=5 au_id998-72-3567/au_id au_lnameRinger/au_lname au_fnameAlbert/au_fname citySalt Lake City/city /authors /authors1 /diffgr:diffgram Any thoughts why this is happening, and, how I can get rid of the 'xs' stuff. Thanks, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 Soap + .NET Webservice
On Mon, October 10, 2005 4:40 am, Chris Hemmings wrote: Can anyone explain how this works, and, how to fix it. I'm can't find any documentation on the problem I am having. colon-separated name-spaces in XML are a relatively new development. Your XML parser probably is not up to speed on them yet... You'd have to upgrade your XML parser, or replace it with one that is aware of this newer XML format. I forget the precise terminology for colon-separated name-spaces in XML, so your first task is to find out what the heck it's called. :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php