[wsf-c-dev] [Fwd: Re: [wsf-php-user] Re: Making more than 1
webservices call on a php page.]
Samisa Abeysinghe
samisa at wso2.com
Thu Jan 31 08:40:00 PST 2008
I do not see a Jira raised for this :(
Samisa...
-------- Original Message --------
Subject: Re: [wsf-php-user] Re: Making more than 1 webservices call on
a php page.
Date: Thu, 31 Jan 2008 21:34:26 +0530
From: Nandika Jayawardana <nandika at wso2.com>
Reply-To: wsf-php-user at wso2.org
To: wsf-php-user at wso2.org
References:
<905056e90801301342i4fee8ffane125b1a71452a6a5 at mail.gmail.com>
<47A1636A.8020100 at wso2.com>
<905056e90801310027t33e61bep916508d475d6577f at mail.gmail.com>
Hi
We found the bug you reported and fixed it. Please get the nightly build.
-- Nandika
smarty wrote:
> Thanks for your response. I have subcribed to the list. Actually it
> was kind of typo which i did. Iam actually using proxy1 for doing the
> same.
>
> thanks and regards,
> Sadashiv
>
> On Jan 30, 2008 9:58 PM, Nandika Jayawardana <nandika at wso2.com
> <mailto:nandika at wso2.com>> wrote:
>
> Hi,
> You are creating the second WSClient object and obtaining $proxy1
> object. But you are invoking the function 'process '
> on $proxy object. That may be the issue.
> We are looking in to the *redeclare *issue.
>
> Also please subscribe to wsf_php user list by going to this page and
> using the subcribe link.
> http://wso2.org/projects/wsf/php
>
> Thanks
> Nandika
>
> smarty wrote:
> > Hi,
> > I want objects to be passed to the functions. Is it possible in
> WSF/php ?
> > I have one more question. Iam having a client which has
> following code.
> > <?php
> > $client = new WSClient(array( "wsdl" =>
> > "http://localhost:9080/axis2/services/test1?wsdl"));
> > $proxy = $client->getProxy();
> > $data1=array();
> > $data1['data']=addslashes('3838473');
> > $data1['type']='TEST';
> > $ws_response = $proxy->insert($data1);
> > echo $ws_response['return'];
> > $test_id = $ws_response['return'];
> > $client1 = new WSClient(array( "wsdl" =>
> > "http://localhost:9080/axis2/services/test2?wsdl"));
> > $proxy1 = $client1->getProxy();
> >
> > $data2=array();
> > $data2['test_id']=$test_id;
> > $data2['description']='HELP';
> > $ws_response = $proxy->process($data2);
> > echo $ws_response['status'];
> > $test_id = $ws_response['status'];
> > ?>
> > Is it possible for me to call 2 webservices in one php code. I tried
> > using the above example. But it gave me following error doing
> the same.
> > *[30-Jan-2008 14:30:22] PHP Fatal error: Cannot redeclare
> > wsf_process_wsdl() (previously declared in wsf_wsdl.php:30) in
> > wsf_wsdl.php on line 170*
> >
> >
> > On Jan 30, 2008 1:50 AM, Nandika Jayawardana <nandika at wso2.com
> <mailto:nandika at wso2.com>
> > <mailto:nandika at wso2.com <mailto:nandika at wso2.com>>> wrote:
> >
> > It is possible to implement the functions in a class object.
> See the
> > example class_based_service.php in samples.
> >
> > Nandika
> >
> > smarty wrote:
> > > Thanks for your help. one more question. I want to declare my
> > function
> > > parameter as an class object instead of passing multiple
> variables.
> > > IS this possible in WSF/php if yes how ?
> > >
> > > thanks and regards,
> > > Sadashiv
> > >
> > > On Jan 29, 2008 10:00 PM, Nandika Jayawardana
> <nandika at wso2.com <mailto:nandika at wso2.com>
> > <mailto:nandika at wso2.com <mailto:nandika at wso2.com>>
> > > <mailto:nandika at wso2.com <mailto:nandika at wso2.com>
> <mailto:nandika at wso2.com <mailto:nandika at wso2.com>>>> wrote:
> > >
> > > Hi,
> > > Small mistake. You do not need to uncomment the code
> in that
> > block.
> > >
> > > Regards
> > > Nandika
> > >
> > >
> > > Nandika Jayawardana wrote:
> > > > Hi smarty,
> > > >
> > > > We found following issues.
> > > > In your client code, you use "errorCode" where as in
> your
> > wsdl file
> > > > it is defined as "errcode".So Change you client array
> > option to
> > > > "errcode".
> > > > Also uncomment the lines where class_map variable is
> > commented which
> > > > you have found correctly.
> > > >
> > > > We will fix the code issue with the nightly build.
> > > >
> > > > Nandika
> > > >
> > > >
> > > >
> > > >
> > > > Samisa Abeysinghe wrote:
> > > >> Please reply!
> > > >>
> > > >> -------- Original Message --------
> > > >> Subject: WSF Web Services Issue
> > > >> Date: Tue, 29 Jan 2008 16:48:14 -0800
> > > >> From: smarty <sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>
> > <mailto:sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>>
> > > <mailto:sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>
> > <mailto:sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>>>>
> > > >> To: Samisa Abeysinghe
> <samisa.abeysinghe at gmail.com <mailto:samisa.abeysinghe at gmail.com>
> > <mailto:samisa.abeysinghe at gmail.com
> <mailto:samisa.abeysinghe at gmail.com>>
> > > <mailto:samisa.abeysinghe at gmail.com
> <mailto:samisa.abeysinghe at gmail.com>
> > <mailto:samisa.abeysinghe at gmail.com
> <mailto:samisa.abeysinghe at gmail.com>>>>
> > > >> CC: wsf-php-user at wso2.org
> <mailto:wsf-php-user at wso2.org>
> > <mailto:wsf-php-user at wso2.org
> <mailto:wsf-php-user at wso2.org>> <mailto:wsf-php-user at wso2.org
> <mailto:wsf-php-user at wso2.org>
> > <mailto:wsf-php-user at wso2.org <mailto:wsf-php-user at wso2.org>>>
> > > >>
> > > >>
> > > >>
> > > >> Hi All,
> > > >>
> > > >> In response to below issue i did some more
> investigation
> > and i
> > > found
> > > >> that the soap envlope is received correctly
> somewhere during
> > > >> processing it is somehow skipping last 3
> parameters. Here is
> > > the log
> > > >> from wsf_php_server.php.
> > > >>
> > > >> [Tue Jan 29 17:42:06 2008] [debug] engine.c(660)
> Invoking
> > phase
> > > >> SavanPhase
> > > >> [Tue Jan 29 17:42:06 2008] [debug] engine.c(660)
> Invoking
> > phase
> > > RMPhase
> > > >> [Tue Jan 29 17:42:06 2008] [debug] engine.c(670)
> > > >> End:axis2_engine_invoke_phases
> > > >> [Tue Jan 29 17:42:06 2008] [debug]
> > > >>
> > >
> >
> /usr/src/redhat/BUILD/wso2-wsf-php-1.2.0/src/wsf_xml_msg_recv.c(491)
> > > >> [wsf_wsdl]Input soap body is <soapenv:Envelope
> > > >>
> > >
> >
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soapenv:Body><ns1:processCCResponse
> > > >>
> > >
> >
> <http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoapenv:Header/%3E%3Csoapenv:Body%3E%3Cns1:processCCResponse>
> > > >> xmlns:ns1="http://www.wso2.org/php/xsd"
> > > >> xmlns:ns2="NULL"><ns2:masterTransactionId
> > > >>
> > xmlns:ns2="NULL">1</ns2:masterTransactionId><ns2:clientRefNumber
> > > >> xmlns:ns3="NULL">10</ns2:clientRefNumber><ns2:status
> > > >> xmlns:ns4="NULL">SETTLED</ns2:status><ns2:errmessage
> > > >> xmlns:ns5="NULL">Transaction
> > > >> Successfull</ns2:errmessage><ns2:effectivedate
> > > >>
> > >
> >
> xmlns:ns6="NULL">01/29/2008</ns2:effectivedate></ns1:processCCResponse></soapenv:Body></soapenv:Envelope>
> > > >>
> > > >> [Tue Jan 29 17:42:06 2008] [debug]
> > > >> /usr/src/redhat/BUILD/wso2-wsf-php-1.2.0/src/wsf.c(939)
> > > [wsf_service]
> > > >> setting operations
> > > >> [Tue Jan 29 17:42:06 2008] [debug]
> > > >> /usr/src/redhat/BUILD/wso2-wsf-php-1.2.0/src/wsf.c(954)
> > > [wsf_service]
> > > >> setting message operation parameters
> > > >> [Tue Jan 29 17:42:06 2008] [debug]
> > > >> /usr/src/redhat/BUILD/wso2-wsf-php-1.2.0/src/wsf.c(987)
> > > [wsf_service]
> > > >> request xop 0
> > > >> [Tue Jan 29 17:42:06 2008] [debug]
> > > >>
> /usr/src/redhat/BUILD/wso2-wsf-php-1.2.0/src/wsf.c(1388)
> > raw post
> > > >> data not found
> > > >> cheers,
> > > >> Sadashiv
> > > >>
> > > >> On Jan 29, 2008 4:29 PM, smarty
> > <sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>
> <mailto:sadashiv.borkar at gmail.com <mailto:sadashiv.borkar at gmail.com>>
> > > <mailto:sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>
> > <mailto:sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>>>
> > > >> <mailto:sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>
> > <mailto:sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>>
> > > <mailto:sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>
> > <mailto:sadashiv.borkar at gmail.com
> <mailto:sadashiv.borkar at gmail.com>>>>> wrote:
> > > >>
> > > >> I get following error when i invoke a WSF webservice
> > > >> [29-Jan-2008 17:20:23] PHP Notice: Undefined
> > variable:
> > > >> class_map in
> > > >> wsf_wsdl.php on line 318
> > > >> [29-Jan-2008 17:20:23] PHP Warning: Missing
> argument
> > 4 for
> > > >> processCCResponseFunction() in
> > > /var/www/html/WSPaymentResponse.php
> > > >> on line 32
> > > >> [29-Jan-2008 17:20:23] PHP Warning: Missing
> argument
> > 5 for
> > > >> processCCResponseFunction() in
> > > /var/www/html/WSPaymentResponse.php
> > > >> on line 32
> > > >> [29-Jan-2008 17:20:23] PHP Warning: Missing
> argument
> > 6 for
> > > >> processCCResponseFunction() in
> > > /var/www/html/WSPaymentResponse.php
> > > >> on line 32
> > > >> [29-Jan-2008 17:20:23] STATUS SETTLED
> > > >> [29-Jan-2008 17:20:23] PHP Notice: Undefined
> variable:
> > > >> effectivedate in /var/www/html/WSPaymentResponse.php
> > on line 51
> > > >> [29-Jan-2008 17:20:23]
> > > >> I viewed the wsf_wsdl.php file and saw
> following
> > code. -->
> > > >> $function_name = $parameters["function_name"];
> > > >> //if (isset($parameters[WSF_CLASSMAP]))
> > > >> // $class_map = $parameters[WSF_CLASSMAP];
> > > >> //else
> > > >> // $class_map = NULL;
> > > >> $payload_dom->loadXML($payload_string);
> > > >> $sig_model_dom->loadXML($sig_model_string);
> > > >> $endpoint_address =
> > > wsf_get_endpoint_address($sig_model_dom);
> > > >> $is_multiple_interfaces = NULL;
> > > >> $operation_node =
> wsf_find_operation($sig_model_dom,
> > > >> $operation_name, $endpoint_address,
> > $is_multiple_interfaces);
> > > >> if(!$operation_node){
> > > >> $operation = "\noperation not found";
> > > >> }
> > > >> $return_payload_string =
> > > >> wsf_serivce_invoke_function($operation_node,
> > $function_name,
> > > >> $payload_dom->firstChild, $class_map);
> > > >> If you look at the commented code then the
> > variable is not
> > > >> declared
> > > >> will this cause any issue?
> > > >> Also if you look at the log it always say that
> the last 3
> > > parameters
> > > >> in the function are not defined. Here is my wsdl and
> > client
> > > code.
> > > >> *_WSDL_*
> > > >> ** * * <?xml version="1.0" encoding="UTF-8" ?>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <definitions
> xmlns="*http://schemas.xmlsoap.org/wsdl/*"
> > > >> xmlns:xsd="*http://www.w3.org/2001/XMLSchema*"
> > > >> xmlns:tns="*http://www.wso2.org/php*"
> > > >> xmlns:soap="*http://schemas.xmlsoap.org/wsdl/soap/*"
> > > >> xmlns:wsdl="*http://schemas.xmlsoap.org/wsdl/*"
> > > >>
> > xmlns:soapenc="*http://schemas.xmlsoap.org/soap/encoding/*"
> > > >>
> > xmlns:http="*http://www.w3.org/2003/05/soap/bindings/HTTP/*"
> > > >> xmlns:ns0="*http://www.wso2.org/php/xsd*"
> > > >> targetNamespace="*http://www.wso2.org/php*">
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <types>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <xsd:schema
> > targetNamespace="*http://www.wso2.org/php/xsd*">
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <xsd:element name="*processCCResponse*">
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <xsd:complexType>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <xsd:sequence>
> > > >> * * <xsd:element name="*masterTransactionId*"
> > > type="*xsd:int*" />
> > > >> * * <xsd:element name="*clientRefNumber*"
> > type="*xsd:string*" />
> > > >> * * <xsd:element name="*status*"
> type="*xsd:string*" />
> > > >> * * <xsd:element name="*errcode*"
> type="*xsd:string*" />
> > > >> * * <xsd:element name="*errmessage*"
> > type="*xsd:string*" />
> > > >> * * <xsd:element name="*effectivedate*"
> > type="*xsd:string*" />
> > > >> * * </xsd:sequence>
> > > >> * * </xsd:complexType>
> > > >> * * </xsd:element>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <xsd:element name="*processCCResponseResponse*">
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <xsd:complexType>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <xsd:sequence>
> > > >> * * <xsd:element name="*status*" type="*xsd:int*" />
> > > >> * * </xsd:sequence>
> > > >> * * </xsd:complexType>
> > > >> * * </xsd:element>
> > > >> * * </xsd:schema>
> > > >> * * </types>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <message name="*processCCResponseInput*">
> > > >> * * <part name="*parameters*"
> > > element="*ns0:processCCResponse*" />
> > > >> * * </message>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <message name="*processCCResponseOutput*">
> > > >> * * <part name="*parameters*"
> > > >> element="*ns0:processCCResponseResponse*" />
> > > >> * * </message>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <portType name="*WSPaymentResponse.php*">
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <operation name="*processCCResponse*">
> > > >> * * <input message="*tns:processCCResponseInput*" />
> > > >> * * <output
> message="*tns:processCCResponseOutput*" />
> > > >> * * </operation>
> > > >> * * </portType>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <binding name="*WSPaymentResponse.php*"
> > > >> type="*tns:WSPaymentResponse.php*">
> > > >> * * <soap:binding
> > > xmlns="*http://schemas.xmlsoap.org/wsdl/soap/*"
> > > >> transport="*http://schemas.xmlsoap.org/soap/http*"
> > > >> style="*document*" />
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <operation
> > > xmlns:default="*http://schemas.xmlsoap.org/wsdl/soap/*"
> > > >> name="*processCCResponse*">
> > > >> * * <soap:operation
> > > xmlns="*http://schemas.xmlsoap.org/wsdl/soap/*"
> > > >>
> > > >>
> > >
> >
> soapAction="*http://www.projectgreennote.com/WSPaymentResponse.php/processCCResponseFunction*"
> > > >>
> > > >> style="*document*" />
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <input
> > xmlns:default="*http://schemas.xmlsoap.org/wsdl/soap/*">
> > > >> * * <soap:body
> > xmlns="*http://schemas.xmlsoap.org/wsdl/soap/*"
> > > >> use="*literal*" />
> > > >> * * </input>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <output
> > xmlns:default="*http://schemas.xmlsoap.org/wsdl/soap/*">
> > > >> * * <soap:body
> > xmlns="*http://schemas.xmlsoap.org/wsdl/soap/*"
> > > >> use="*literal*" />
> > > >> * * </output>
> > > >> * * </operation>
> > > >> * * </binding>
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <service name="*WSPaymentResponse.php*">
> > > >> *-*
> > >
> <https://www.projectgreennote.com/WSPaymentResponse.php?wsdl#>
> > > >> <port
> > xmlns:default="*http://schemas.xmlsoap.org/wsdl/soap/*"
> > > >> name="*WSPaymentResponse.php*"
> > > binding="*tns:WSPaymentResponse.php*">
> > > >> * * <soap:address
> > > xmlns="*http://schemas.xmlsoap.org/wsdl/soap/*"
> > > >>
> > >
> >
> location="*http://www.projectgreennote.com/WSPaymentResponse.php*" />
> > > >> * * </port>
> > > >> * * </service>
> > > >> * * </definitions>
> > > >> *_CLIENT CODE_*
> > > >> **
> > > >> <?php
> > > >>
> > > >> try {
> > > >>
> > > >> $client = new WSClient(array( "wsdl" =>
> > > >> "https://www.projectgreennote.com
> <https://www.projectgreennote.com/>
> > <https://www.projectgreennote.com/>
> > > <https://www.projectgreennote.com/>
> > > <https://www.projectgreennote.com/>
> > > >>
> > > >> /WSPaymentResponse.php?wsdl"));
> > > >>
> > > >> $proxy = $client->getProxy();
> > > >>
> > > >> $namedarray = array(
> > > >>
> > > >> 'masterTransactionId' => '1', 'clientRefNumber'
> => '10',
> > > >>
> > > >> 'status' => 'SETTLED',
> > > >>
> > > >> 'errorCode' => 'TEST',
> > > >>
> > > >> 'errmessage' => 'Transaction Successfull',
> > > >>
> > > >> 'effectivedate' => '01/29/2008');
> > > >>
> > > >> echo "Before Call <BR/>";
> > > >>
> > > >> $hello = $proxy->processCCResponse($namedarray);
> > > >>
> > > >> echo "<BR/> After Call <BR/>";
> > > >>
> > > >> echo $hello["status"];
> > > >>
> > > >> } catch (Exception $e) {
> > > >>
> > > >> if ($e instanceof WSFault) {
> > > >>
> > > >> printf("Soap Fault: %s\n", $e->Reason);
> > > >>
> > > >> } else {
> > > >>
> > > >> printf("Message = %s\n",$e->getMessage());
> > > >>
> > > >> }
> > > >>
> > > >> }
> > > >>
> > > >> ?>
> > > >>
> > > >> Please let me know what is the issue.
> > > >>
> > > >> -- cheers,
> > > >> Sadashiv Borkar
> > > >> Today is a gift, that's why it is called the
> present.
> > > >>
> > > >>
> > > >>
> > > >>
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > cheers,
> > > Sadashiv Borkar
> > > Today is a gift, that's why it is called the present.
> >
> >
> >
> >
> >
> > --
> > cheers,
> > Sadashiv Borkar
> > Today is a gift, that's why it is called the present.
>
>
>
>
>
> --
> cheers,
> Sadashiv Borkar
> Today is a gift, that's why it is called the present.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Wsf-php-user mailing list
> Wsf-php-user at wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
_______________________________________________
Wsf-php-user mailing list
Wsf-php-user at wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.17/1252 - Release Date: 1/30/2008 8:51 PM
More information about the Wsf-c-dev
mailing list