Converting PHP XML-RPC to L9

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Converting PHP XML-RPC to L9

Marc Pinnell-3
Never worked with XML before. Trying to convert a sample of PHP code to L9. Not having much luck with the docs in finding something similar. Probably not looking for the right thing. Here's the PHP:

$client = new Zend_XmlRpc_Client( '<a href="https://%%SERVERNAME%%:2443/xmlrpc'">https://%%SERVERNAME%%:2443/xmlrpc' );
$result = $client->call( 'iworx.route', $params );

What (If any) would the L9 code look like? I tried the L8 code as a test:

        XML_RPCCall(
                -Host='https://domain.com:2443/xmlrpc',
                -Method='System.ListMethods'
                )

but get an error:
XML_RPCCall(-host=string, -method=string)


marc


Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

stevepiercy
This might help.
https://github.com/stevepiercy/xml_rpc

My PR was merged into LassoSoft's repo.
https://github.com/LassoSoft/xml_rpc/pull/2

--steve


On 11/13/14 at 10:50 AM, [hidden email] (Marc Pinnell) pronounced:

> Never worked with XML before. Trying to convert a sample of PHP code to L9. Not having
> much luck with the docs in finding something similar. Probably not looking for the right
> thing. Here's the PHP:
>
> $client = new Zend_XmlRpc_Client( '<a href="https://%%SERVERNAME%%:2443/xmlrpc'">https://%%SERVERNAME%%:2443/xmlrpc' );
> $result = $client->call( 'iworx.route', $params );
>
> What (If any) would the L9 code look like? I tried the L8 code as a test:
>
>   XML_RPCCall(
>       -Host='https://domain.com:2443/xmlrpc',
>       -Method='System.ListMethods'
>       )
>
> but get an error:
> XML_RPCCall(-host=string, -method=string)
>
>
> marc
>
>
> Marc Pinnell
> 1027 Design
> PO Box 990872
> Redding, CA 96099-0872
> 530.941.4706
> fax: 866.232.5300
> www.1027Design.com
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

Marc Pinnell-3
Thanks! Jono sent that over a little while ago. Working through it now.

marc


On Nov 13, 2014, at 11:42 AM, Steve Piercy - Website Builder <[hidden email]> wrote:

> This might help.
> https://github.com/stevepiercy/xml_rpc
>
> My PR was merged into LassoSoft's repo.
> https://github.com/LassoSoft/xml_rpc/pull/2
>
> --steve
>
>
> On 11/13/14 at 10:50 AM, [hidden email] (Marc Pinnell) pronounced:
>
>> Never worked with XML before. Trying to convert a sample of PHP code to L9. Not having
>> much luck with the docs in finding something similar. Probably not looking for the right
>> thing. Here's the PHP:
>>
>> $client = new Zend_XmlRpc_Client( '<a href="https://%%SERVERNAME%%:2443/xmlrpc'">https://%%SERVERNAME%%:2443/xmlrpc' );
>> $result = $client->call( 'iworx.route', $params );
>>
>> What (If any) would the L9 code look like? I tried the L8 code as a test:
>>
>>  XML_RPCCall(
>>      -Host='https://domain.com:2443/xmlrpc',
>>      -Method='System.ListMethods'
>>      )
>>
>> but get an error:
>> XML_RPCCall(-host=string, -method=string)
>>
>>
>> marc
>>
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

Marc Pinnell-3
In reply to this post by stevepiercy
How come the things that seem like they should be simple, just aren't some times? :)

        $sendparams = array(
                pair('apikey' = $key),
                pair('ctrl_name' = $api_controller),
                pair('action' = $action),
                pair('input' = $input)
                )

        local('getList' = XML_RPC($sendparams))
        #getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')

Errors out:
An unhandled failure during a web request
Error Code: -9948
Error Msg: Definition Not Found: bytes->importas(bytes, string) Candidates were: bytes->importas(p0::string, p1::string)

From what I can tell it is erroring on the #getList line...

Any ideas?

Marc



On Nov 13, 2014, at 11:42 AM, Steve Piercy - Website Builder <[hidden email]> wrote:

> This might help.
> https://github.com/stevepiercy/xml_rpc
>
> My PR was merged into LassoSoft's repo.
> https://github.com/LassoSoft/xml_rpc/pull/2
>
> --steve
>
>
> On 11/13/14 at 10:50 AM, [hidden email] (Marc Pinnell) pronounced:
>
>> Never worked with XML before. Trying to convert a sample of PHP code to L9. Not having
>> much luck with the docs in finding something similar. Probably not looking for the right
>> thing. Here's the PHP:
>>
>> $client = new Zend_XmlRpc_Client( '<a href="https://%%SERVERNAME%%:2443/xmlrpc'">https://%%SERVERNAME%%:2443/xmlrpc' );
>> $result = $client->call( 'iworx.route', $params );
>>
>> What (If any) would the L9 code look like? I tried the L8 code as a test:
>>
>>  XML_RPCCall(
>>      -Host='https://domain.com:2443/xmlrpc',
>>      -Method='System.ListMethods'
>>      )
>>
>> but get an error:
>> XML_RPCCall(-host=string, -method=string)
>>
>>
>> marc
>>
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

Jonathan Guthrie-3
Have you made sure all params are strings?

> On Nov 13, 2014, at 2:54 PM, Marc Pinnell <[hidden email]> wrote:
>
> How come the things that seem like they should be simple, just aren't some times? :)
>
> $sendparams = array(
> pair('apikey' = $key),
> pair('ctrl_name' = $api_controller),
> pair('action' = $action),
> pair('input' = $input)
> )
>
> local('getList' = XML_RPC($sendparams))
> #getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')
>
> Errors out:
> An unhandled failure during a web request
> Error Code: -9948
> Error Msg: Definition Not Found: bytes->importas(bytes, string) Candidates were: bytes->importas(p0::string, p1::string)
>
> From what I can tell it is erroring on the #getList line...
>
> Any ideas?
>
> Marc
>



Jono

----------------------------
Jonathan Guthrie
[hidden email]
@iamjono
LassoSoft Inc.
AIM Chatroom: lassochat


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

Marc Pinnell-3
Well, $sendparams is an array of pairs... would that matter?

Marc


On Nov 13, 2014, at 12:01 PM, Jonathan Guthrie <[hidden email]> wrote:

> Have you made sure all params are strings?
>
>> On Nov 13, 2014, at 2:54 PM, Marc Pinnell <[hidden email]> wrote:
>>
>> How come the things that seem like they should be simple, just aren't some times? :)
>>
>> $sendparams = array(
>> pair('apikey' = $key),
>> pair('ctrl_name' = $api_controller),
>> pair('action' = $action),
>> pair('input' = $input)
>> )
>>
>> local('getList' = XML_RPC($sendparams))
>> #getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')
>>
>> Errors out:
>> An unhandled failure during a web request
>> Error Code: -9948
>> Error Msg: Definition Not Found: bytes->importas(bytes, string) Candidates were: bytes->importas(p0::string, p1::string)
>>
>> From what I can tell it is erroring on the #getList line...
>>
>> Any ideas?
>>
>> Marc
>>
>
>
>
> Jono
>
> ----------------------------
> Jonathan Guthrie
> [hidden email]
> @iamjono
> LassoSoft Inc.
> AIM Chatroom: lassochat
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

stevepiercy
In reply to this post by Marc Pinnell-3
The error message indicates that you passed a bytes type in as
the first argument to bytes->importas, but it expects a string.

Cast all the pair values to string, and try again.

--steve


On 11/13/14 at 11:54 AM, [hidden email] (Marc
Pinnell) pronounced:

>How come the things that seem like they should be simple, just aren't some times? :)
>
>$sendparams = array(
>pair('apikey' = $key),
>pair('ctrl_name' = $api_controller),
>pair('action' = $action),
>pair('input' = $input)
>)
>
>local('getList' = XML_RPC($sendparams))
>#getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')
>
>Errors out:
>An unhandled failure during a web request
>Error Code: -9948
>Error Msg: Definition Not Found: bytes->importas(bytes, string)
>Candidates were: bytes->importas(p0::string, p1::string)
>
>From what I can tell it is erroring on the #getList line...
>
>Any ideas?
>
>Marc
>
>
>
>On Nov 13, 2014, at 11:42 AM, Steve Piercy - Website Builder <[hidden email]> wrote:
>
>>This might help.
>>https://github.com/stevepiercy/xml_rpc
>>
>>My PR was merged into LassoSoft's repo.
>>https://github.com/LassoSoft/xml_rpc/pull/2
>>
>>--steve
>>
>>
>>On 11/13/14 at 10:50 AM, [hidden email] (Marc Pinnell) pronounced:
>>
>>>  Never worked with XML before. Trying to convert a sample of
>>>PHP code to L9. Not having  much luck with the docs in
>>>finding something similar. Probably not looking for the
>right
>>> thing. Here's the PHP:
>>>   $client = new Zend_XmlRpc_Client(
>>>'<a href="https://%%SERVERNAME%%:2443/xmlrpc'">https://%%SERVERNAME%%:2443/xmlrpc' );
>>> $result = $client->call( 'iworx.route', $params );
>>>   What (If any) would the L9 code look like? I tried the L8
>>>code as a test:
>>>    XML_RPCCall(
>>>      -Host='https://domain.com:2443/xmlrpc',
>>>      -Method='System.ListMethods'
>>>      )
>>>   but get an error:
>>> XML_RPCCall(-host=string, -method=string)
>>>    marc
>>>    Marc Pinnell
>>> 1027 Design
>>> PO Box 990872
>>> Redding, CA 96099-0872
>>> 530.941.4706
>>> fax: 866.232.5300
>>> www.1027Design.com
>>>     #############################################################
>>>   This message is sent to you because you are subscribed to
>>>  the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy              Website Builder              Soquel, CA
>><[hidden email]>               <http://www.StevePiercy.com/>
>>
>>
>>#############################################################
>>
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso [hidden email]
>>Official list archives available at http://www.lassotalk.com
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>
>Marc Pinnell
>1027 Design
>PO Box 990872
>Redding, CA 96099-0872
>530.941.4706
>fax: 866.232.5300
>www.1027Design.com
>
>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

stevepiercy
Explicitly:

pair('apikey' = $key->asstring),

--steve


On 11/13/14 at 12:10 PM, [hidden email] (Steve Piercy - Website Builder) pronounced:

> The error message indicates that you passed a bytes type in as the first argument to
> bytes->importas, but it expects a string.
>
> Cast all the pair values to string, and try again.
>
> --steve
>
>
> On 11/13/14 at 11:54 AM, [hidden email] (Marc Pinnell) pronounced:
>
> >How come the things that seem like they should be simple, just aren't some times? :)
> >
> >$sendparams = array(
> >pair('apikey' = $key),
> >pair('ctrl_name' = $api_controller),
> >pair('action' = $action),
> >pair('input' = $input)
> >)
> >
> >local('getList' = XML_RPC($sendparams))
> >#getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')
> >
> >Errors out:
> >An unhandled failure during a web request
> >Error Code: -9948
> >Error Msg: Definition Not Found: bytes->importas(bytes, string)
> >Candidates were: bytes->importas(p0::string, p1::string)
> >
> >From what I can tell it is erroring on the #getList line...
> >
> >Any ideas?
> >
> >Marc
> >
> >
> >
> >On Nov 13, 2014, at 11:42 AM, Steve Piercy - Website Builder <[hidden email]>
> wrote:
> >
> >>This might help.
> >>https://github.com/stevepiercy/xml_rpc
> >>
> >>My PR was merged into LassoSoft's repo.
> >>https://github.com/LassoSoft/xml_rpc/pull/2
> >>
> >>--steve
> >>
> >>
> >>On 11/13/14 at 10:50 AM, [hidden email] (Marc Pinnell) pronounced:
> >>
> >>> Never worked with XML before. Trying to convert a sample of
> >>>PHP code to L9. Not having  much luck with the docs in
> >>>finding something similar. Probably not looking for the
> >right
> >>>thing. Here's the PHP:
> >>>  $client = new Zend_XmlRpc_Client(
> >>>'<a href="https://%%SERVERNAME%%:2443/xmlrpc'">https://%%SERVERNAME%%:2443/xmlrpc' );
> >>>$result = $client->call( 'iworx.route', $params );
> >>>  What (If any) would the L9 code look like? I tried the L8
> >>>code as a test:
> >>>   XML_RPCCall(
> >>>     -Host='https://domain.com:2443/xmlrpc',
> >>>     -Method='System.ListMethods'
> >>>     )
> >>>  but get an error:
> >>>XML_RPCCall(-host=string, -method=string)
> >>>   marc
> >>>   Marc Pinnell
> >>>1027 Design
> >>>PO Box 990872
> >>>Redding, CA 96099-0872
> >>>530.941.4706
> >>>fax: 866.232.5300
> >>>www.1027Design.com
> >>>    #############################################################
> >>>  This message is sent to you because you are subscribed to
> >>> the mailing list Lasso [hidden email]
> >>>Official list archives available at http://www.lassotalk.com
> >>>To unsubscribe, E-mail to: <[hidden email]>
> >>>Send administrative queries to  <[hidden email]>
> >>
> >>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >>Steve Piercy              Website Builder              Soquel, CA
> >><[hidden email]>               <http://www.StevePiercy.com/>
> >>
> >>
> >>#############################################################
> >>
> >>This message is sent to you because you are subscribed to
> >>the mailing list Lasso [hidden email]
> >>Official list archives available at http://www.lassotalk.com
> >>To unsubscribe, E-mail to: <[hidden email]>
> >>Send administrative queries to  <[hidden email]>
> >
> >Marc Pinnell
> >1027 Design
> >PO Box 990872
> >Redding, CA 96099-0872
> >530.941.4706
> >fax: 866.232.5300
> >www.1027Design.com
> >
> >
> >
> >#############################################################
> >
> >This message is sent to you because you are subscribed to
> >the mailing list Lasso [hidden email]
> >Official list archives available at http://www.lassotalk.com
> >To unsubscribe, E-mail to: <[hidden email]>
> >Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

Marc Pinnell-3
Quick sanity check. PHP code I am converting:
        $sendparams = array(
                'apikey'    => $key,
                'ctrl_name' => $api_controller,
                'action'    => $action,
                'input'     => $input );
Lasso version:
        $sendparams = array(
                pair('apikey' = $key->asstring),
                pair('ctrl_name' = $api_controller->asstring),
                pair('action' = $action->asstring),
                pair('input' = $input->asstring)
                )

That is still failing with the same error. If I do this:

local('getList' = XML_RPC($sendparams->asstring))

Then the error changes to (when #getList->call is run):

Error Msg: libxml error while parsing document: Space required after the Public Identifier SystemLiteral " or ' expected SYSTEM or PUBLIC, the URI is missing

Marc


On Nov 13, 2014, at 12:30 PM, Steve Piercy - Website Builder <[hidden email]> wrote:

> Explicitly:
>
> pair('apikey' = $key->asstring),
>
> --steve
>
>
> On 11/13/14 at 12:10 PM, [hidden email] (Steve Piercy - Website Builder) pronounced:
>
>> The error message indicates that you passed a bytes type in as the first argument to
>> bytes->importas, but it expects a string.
>>
>> Cast all the pair values to string, and try again.
>>
>> --steve
>>
>>
>> On 11/13/14 at 11:54 AM, [hidden email] (Marc Pinnell) pronounced:
>>
>>> How come the things that seem like they should be simple, just aren't some times? :)
>>>
>>> $sendparams = array(
>>> pair('apikey' = $key),
>>> pair('ctrl_name' = $api_controller),
>>> pair('action' = $action),
>>> pair('input' = $input)
>>> )
>>>
>>> local('getList' = XML_RPC($sendparams))
>>> #getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')
>>>
>>> Errors out:
>>> An unhandled failure during a web request
>>> Error Code: -9948
>>> Error Msg: Definition Not Found: bytes->importas(bytes, string)
>>> Candidates were: bytes->importas(p0::string, p1::string)
>>>
>>> From what I can tell it is erroring on the #getList line...
>>>
>>> Any ideas?
>>>
>>> Marc
>>>
>>>
>>>
>>> On Nov 13, 2014, at 11:42 AM, Steve Piercy - Website Builder <[hidden email]>
>> wrote:
>>>
>>>> This might help.
>>>> https://github.com/stevepiercy/xml_rpc
>>>>
>>>> My PR was merged into LassoSoft's repo.
>>>> https://github.com/LassoSoft/xml_rpc/pull/2
>>>>
>>>> --steve
>>>>
>>>>
>>>> On 11/13/14 at 10:50 AM, [hidden email] (Marc Pinnell) pronounced:
>>>>
>>>>> Never worked with XML before. Trying to convert a sample of
>>>>> PHP code to L9. Not having  much luck with the docs in
>>>>> finding something similar. Probably not looking for the
>>> right
>>>>> thing. Here's the PHP:
>>>>> $client = new Zend_XmlRpc_Client(
>>>>> '<a href="https://%%SERVERNAME%%:2443/xmlrpc'">https://%%SERVERNAME%%:2443/xmlrpc' );
>>>>> $result = $client->call( 'iworx.route', $params );
>>>>> What (If any) would the L9 code look like? I tried the L8
>>>>> code as a test:
>>>>>  XML_RPCCall(
>>>>>    -Host='https://domain.com:2443/xmlrpc',
>>>>>    -Method='System.ListMethods'
>>>>>    )
>>>>> but get an error:
>>>>> XML_RPCCall(-host=string, -method=string)
>>>>>  marc
>>>>>  Marc Pinnell
>>>>> 1027 Design
>>>>> PO Box 990872
>>>>> Redding, CA 96099-0872
>>>>> 530.941.4706
>>>>> fax: 866.232.5300
>>>>> www.1027Design.com
>>>>>   #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> Steve Piercy              Website Builder              Soquel, CA
>>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> Marc Pinnell
>>> 1027 Design
>>> PO Box 990872
>>> Redding, CA 96099-0872
>>> 530.941.4706
>>> fax: 866.232.5300
>>> www.1027Design.com
>>>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy              Website Builder              Soquel, CA
>> <[hidden email]>               <http://www.StevePiercy.com/>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

Mason Miller
That sounds like a break before the DOCTYPE declaration or a bad declaration.

Mason
> On Nov 13, 2014, at 15:49, Marc Pinnell <[hidden email]> wrote:
>
> Error Msg: libxml error while parsing document: Space required after the Public Identifier SystemLiteral " or ' expected SYSTEM or PUBLIC, the URI is missing
>
> Marc


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

stevepiercy
In reply to this post by Marc Pinnell-3
On 11/13/14 at 12:49 PM, [hidden email] (Marc
Pinnell) pronounced:

>Quick sanity check. PHP code I am converting:
>$sendparams = array( 'apikey'    => $key,
>'ctrl_name' => $api_controller,
>'action'    => $action,
>'input'     => $input );
>Lasso version:
>$sendparams = array(
>pair('apikey' = $key->asstring),
>pair('ctrl_name' = $api_controller->asstring),
>pair('action' = $action->asstring),
>pair('input' = $input->asstring)
>)
>
>That is still failing with the same error.

Either you're not using the xml_rpc type correctly, or something
in the xml_rpc type needs to be adapted for your use case.

If it's a usage issue, then start here:

     local('getList' = XML_RPC($sendparams))
     #getList->getparams
     abort

...and see what params are really getting into the type.  Then
examine the params to ensure that they truly are strings.

Once you're certain about that, then go to the next step:

     #getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')

s/b:

     #getList->call('https://domain.com:2443/xmlrpc', 'iworx.route')

or use the explicit parameter names:

     #getList->call(-uri='https://domain.com:2443/xmlrpc', -method='iworx.route')

Is that a valid URI?

Is that a valid method?

If true for both, then look at the call method definition in
xml_rpc.  the request is prepared, where each parameter in
$sendparams is converted via:

             #req->append(XMLRPC_ExConverter(#i))

and that *should* handle pairs.

If it's a needed adaption, then I suggest forking the repo and
experiment.  That's what I did to get my use case to work when I
needed xml_rpc for Lasso 9.  In my repo, I have a lot of
experimental stuff to make it easier.

>If I do this:
>
>local('getList' = XML_RPC($sendparams->asstring))

Silly developer, passing an array as a string in an argument to
xml_rpc type.

--steve


>Then the error changes to (when #getList->call is run):
>
>Error Msg: libxml error while parsing document: Space required
>after the Public Identifier SystemLiteral " or ' expected
>SYSTEM or PUBLIC, the URI is missing
>Marc
>
>
>On Nov 13, 2014, at 12:30 PM, Steve Piercy - Website Builder <[hidden email]> wrote:
>
>>Explicitly:
>>
>>pair('apikey' = $key->asstring),
>>
>>--steve
>>
>>
>>On 11/13/14 at 12:10 PM, [hidden email] (Steve Piercy - Website Builder)
>pronounced:
>>
>>>  The error message indicates that you passed a bytes type in
>>>as the first argument to  bytes->importas, but it expects a string.
>>>   Cast all the pair values to string, and try again.
>>>   --steve
>>>    On 11/13/14 at 11:54 AM, [hidden email]
>>>(Marc Pinnell) pronounced:
>>>
>>>> How come the things that seem like they should be simple, just aren't some times? :)
>>>>   $sendparams = array(
>>>> pair('apikey' = $key),
>>>> pair('ctrl_name' = $api_controller),
>>>> pair('action' = $action),
>>>> pair('input' = $input)
>>>> )
>>>>   local('getList' = XML_RPC($sendparams))
>>>> #getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')
>>>>   Errors out:
>>>> An unhandled failure during a web request
>>>> Error Code: -9948
>>>>  Error Msg: Definition Not Found: bytes->importas(bytes,
>>>>string)  Candidates were: bytes->importas(p0::string, p1::string)
>>>>   From what I can tell it is erroring on the #getList line...
>>>>   Any ideas?
>>>>   Marc
>>>>     On Nov 13, 2014, at 11:42 AM, Steve Piercy - Website
>>>>Builder <[hidden email]>
>>> wrote:
>>>>
>>>>> This might help.
>>>>> https://github.com/stevepiercy/xml_rpc
>>>>>   My PR was merged into LassoSoft's repo.
>>>>> https://github.com/LassoSoft/xml_rpc/pull/2
>>>>>   --steve
>>>>>    On 11/13/14 at 10:50 AM, [hidden email]
>>>>>(Marc Pinnell) pronounced:
>>>>>
>>>>>>  Never worked with XML before. Trying to convert a sample
>>>>>>of  PHP code to L9. Not having  much luck with the docs
>>>>>>in  finding something similar. Probably not looking for the
>>>> right
>>>>>> thing. Here's the PHP:
>>>>>>  $client = new Zend_XmlRpc_Client(  
>>>>>>'<a href="https://%%SERVERNAME%%:2443/xmlrpc'">https://%%SERVERNAME%%:2443/xmlrpc' );
>>>>>> $result = $client->call( 'iworx.route', $params );
>>>>>>  What (If any) would the L9 code look like? I tried the
>>>>>>L8  code as a test:
>>>>>>  XML_RPCCall(
>>>>>>    -Host='https://domain.com:2443/xmlrpc',
>>>>>>    -Method='System.ListMethods'
>>>>>>    )
>>>>>> but get an error:
>>>>>> XML_RPCCall(-host=string, -method=string)
>>>>>>  marc
>>>>>>  Marc Pinnell
>>>>>> 1027 Design
>>>>>> PO Box 990872
>>>>>> Redding, CA 96099-0872
>>>>>> 530.941.4706
>>>>>> fax: 866.232.5300
>>>>>> www.1027Design.com
>>>>>>   #############################################################
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>-- -- --
>>>>> Steve Piercy              Website Builder              Soquel, CA
>>>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>>>    #############################################################
>>>>>   This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>   Marc Pinnell
>>>> 1027 Design
>>>> PO Box 990872
>>>> Redding, CA 96099-0872
>>>> 530.941.4706
>>>> fax: 866.232.5300
>>>> www.1027Design.com
>>>>     #############################################################
>>>>   This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>-- -- --
>>> Steve Piercy              Website Builder              Soquel, CA
>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>    #############################################################
>>>   This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy              Website Builder              Soquel, CA
>><[hidden email]>               <http://www.StevePiercy.com/>
>>
>>
>>#############################################################
>>
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso [hidden email]
>>Official list archives available at http://www.lassotalk.com
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>
>Marc Pinnell
>1027 Design
>PO Box 990872
>Redding, CA 96099-0872
>530.941.4706
>fax: 866.232.5300
>www.1027Design.com
>
>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

Marc Pinnell-3
        $sendparams = array(
                pair('apikey' = $key->asstring),
                pair('ctrl_name' = $api_controller->asstring),
                pair('action' = $action->asstring),
                'input'
                )

        local('getList' = XML_RPC($sendparams))
        #getList->getparams
   abort

produces:

array((apikey = -----BEGIN INTERWORX API KEY----- MXxWKygzZStOVm...R15rPTo= -----END INTERWORX API KEY-----), (ctrl_name = /nodeworx/siteworx), (action = listAccounts), input)

Looks right to me.

Added the explicit parameter names and it changed the error message. Not sure if that is progress or not! :)

Error Msg: Definition Not Found: XML_RPC->call(-uri=string, -method=string) Candidates were: XML_RPC->call(uri::string, method::string)

Marc


On Nov 13, 2014, at 1:32 PM, Steve Piercy - Website Builder <[hidden email]> wrote:

> On 11/13/14 at 12:49 PM, [hidden email] (Marc Pinnell) pronounced:
>
>> Quick sanity check. PHP code I am converting:
>> $sendparams = array( 'apikey'    => $key,
>> 'ctrl_name' => $api_controller,
>> 'action'    => $action,
>> 'input'     => $input );
>> Lasso version:
>> $sendparams = array(
>> pair('apikey' = $key->asstring),
>> pair('ctrl_name' = $api_controller->asstring),
>> pair('action' = $action->asstring),
>> pair('input' = $input->asstring)
>> )
>>
>> That is still failing with the same error.
>
> Either you're not using the xml_rpc type correctly, or something in the xml_rpc type needs to be adapted for your use case.
>
> If it's a usage issue, then start here:
>
>    local('getList' = XML_RPC($sendparams))
>    #getList->getparams
>    abort
>
> ...and see what params are really getting into the type.  Then examine the params to ensure that they truly are strings.
>
> Once you're certain about that, then go to the next step:
>
>    #getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')
>
> s/b:
>
>    #getList->call('https://domain.com:2443/xmlrpc', 'iworx.route')
>
> or use the explicit parameter names:
>
>    #getList->call(-uri='https://domain.com:2443/xmlrpc', -method='iworx.route')
>
> Is that a valid URI?
>
> Is that a valid method?
>
> If true for both, then look at the call method definition in xml_rpc.  the request is prepared, where each parameter in $sendparams is converted via:
>
>            #req->append(XMLRPC_ExConverter(#i))
>
> and that *should* handle pairs.
>
> If it's a needed adaption, then I suggest forking the repo and experiment.  That's what I did to get my use case to work when I needed xml_rpc for Lasso 9.  In my repo, I have a lot of experimental stuff to make it easier.
>
>> If I do this:
>>
>> local('getList' = XML_RPC($sendparams->asstring))
>
> Silly developer, passing an array as a string in an argument to xml_rpc type.
>
> --steve
>
>
>> Then the error changes to (when #getList->call is run):
>>
>> Error Msg: libxml error while parsing document: Space required after the Public Identifier SystemLiteral " or ' expected SYSTEM or PUBLIC, the URI is missing
>> Marc
>>
>>
>> On Nov 13, 2014, at 12:30 PM, Steve Piercy - Website Builder <[hidden email]> wrote:
>>
>>> Explicitly:
>>>
>>> pair('apikey' = $key->asstring),
>>>
>>> --steve
>>>
>>>
>>> On 11/13/14 at 12:10 PM, [hidden email] (Steve Piercy - Website Builder)
>> pronounced:
>>>
>>>> The error message indicates that you passed a bytes type in as the first argument to bytes->importas, but it expects a string.
>>>>  Cast all the pair values to string, and try again.
>>>>  --steve
>>>>   On 11/13/14 at 11:54 AM, [hidden email] (Marc Pinnell) pronounced:
>>>>
>>>>> How come the things that seem like they should be simple, just aren't some times? :)
>>>>>  $sendparams = array(
>>>>> pair('apikey' = $key),
>>>>> pair('ctrl_name' = $api_controller),
>>>>> pair('action' = $action),
>>>>> pair('input' = $input)
>>>>> )
>>>>>  local('getList' = XML_RPC($sendparams))
>>>>> #getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')
>>>>>  Errors out:
>>>>> An unhandled failure during a web request
>>>>> Error Code: -9948
>>>>> Error Msg: Definition Not Found: bytes->importas(bytes, string)  Candidates were: bytes->importas(p0::string, p1::string)
>>>>>  From what I can tell it is erroring on the #getList line...
>>>>>  Any ideas?
>>>>>  Marc
>>>>>    On Nov 13, 2014, at 11:42 AM, Steve Piercy - Website Builder <[hidden email]>
>>>> wrote:
>>>>>
>>>>>> This might help.
>>>>>> https://github.com/stevepiercy/xml_rpc
>>>>>>  My PR was merged into LassoSoft's repo.
>>>>>> https://github.com/LassoSoft/xml_rpc/pull/2
>>>>>>  --steve
>>>>>>   On 11/13/14 at 10:50 AM, [hidden email] (Marc Pinnell) pronounced:
>>>>>>
>>>>>>> Never worked with XML before. Trying to convert a sample of  PHP code to L9. Not having  much luck with the docs in  finding something similar. Probably not looking for the
>>>>> right
>>>>>>> thing. Here's the PHP:
>>>>>>> $client = new Zend_XmlRpc_Client(  '<a href="https://%%SERVERNAME%%:2443/xmlrpc'">https://%%SERVERNAME%%:2443/xmlrpc' );
>>>>>>> $result = $client->call( 'iworx.route', $params );
>>>>>>> What (If any) would the L9 code look like? I tried the L8  code as a test:
>>>>>>> XML_RPCCall(
>>>>>>>   -Host='https://domain.com:2443/xmlrpc',
>>>>>>>   -Method='System.ListMethods'
>>>>>>>   )
>>>>>>> but get an error:
>>>>>>> XML_RPCCall(-host=string, -method=string)
>>>>>>> marc
>>>>>>> Marc Pinnell
>>>>>>> 1027 Design
>>>>>>> PO Box 990872
>>>>>>> Redding, CA 96099-0872
>>>>>>> 530.941.4706
>>>>>>> fax: 866.232.5300
>>>>>>> www.1027Design.com
>>>>>>>  #############################################################
>>>>>>> This message is sent to you because you are subscribed to
>>>>>>> the mailing list Lasso [hidden email]
>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>> Steve Piercy              Website Builder              Soquel, CA
>>>>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>>>>   #############################################################
>>>>>>  This message is sent to you because you are subscribed to
>>>>>> the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>  Marc Pinnell
>>>>> 1027 Design
>>>>> PO Box 990872
>>>>> Redding, CA 96099-0872
>>>>> 530.941.4706
>>>>> fax: 866.232.5300
>>>>> www.1027Design.com
>>>>>    #############################################################
>>>>>  This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> Steve Piercy              Website Builder              Soquel, CA
>>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>>   #############################################################
>>>>  This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy              Website Builder              Soquel, CA
>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

Marc Pinnell-3
In reply to this post by stevepiercy
According to the docs...

http://docs.interworx.com/interworx/api/index-Using-the-API.php#toc-Chapter-2

marc


On Nov 13, 2014, at 1:32 PM, Steve Piercy - Website Builder <[hidden email]> wrote:

> Is that a valid URI?
>
> Is that a valid method?

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

stevepiercy
In reply to this post by Marc Pinnell-3
On 11/13/14 at 1:49 PM, [hidden email] (Marc Pinnell) pronounced:

>   $sendparams = array(
>       pair('apikey' = $key->asstring),
>       pair('ctrl_name' = $api_controller->asstring),
>       pair('action' = $action->asstring),
>       'input'
>       )
>
>   local('getList' = XML_RPC($sendparams))
>   #getList->getparams
>    abort
>
> produces:
>
> array((apikey = -----BEGIN INTERWORX API KEY----- MXxWKygzZStOVm...R15rPTo= -----END
> INTERWORX API KEY-----), (ctrl_name = /nodeworx/siteworx), (action = listAccounts),
> input)
>
> Looks right to me.

Go deeper.  (Don't say it, Steffan...)

IOW, iterate through the array and examine each pair's ->first and ->second.

--steve


> Added the explicit parameter names and it changed the error message. Not sure if that is
> progress or not! :)
>
> Error Msg: Definition Not Found: XML_RPC->call(-uri=string, -method=string) Candidates
> were: XML_RPC->call(uri::string, method::string)
>
> Marc
>
>
> On Nov 13, 2014, at 1:32 PM, Steve Piercy - Website Builder <[hidden email]> wrote:
>
> > On 11/13/14 at 12:49 PM, [hidden email] (Marc Pinnell) pronounced:
> >
> >> Quick sanity check. PHP code I am converting:
> >> $sendparams = array( 'apikey'    => $key,
> >> 'ctrl_name' => $api_controller,
> >> 'action'    => $action,
> >> 'input'     => $input );
> >> Lasso version:
> >> $sendparams = array(
> >> pair('apikey' = $key->asstring),
> >> pair('ctrl_name' = $api_controller->asstring),
> >> pair('action' = $action->asstring),
> >> pair('input' = $input->asstring)
> >> )
> >>
> >> That is still failing with the same error.
> >
> > Either you're not using the xml_rpc type correctly, or something in the xml_rpc type
> needs to be adapted for your use case.
> >
> > If it's a usage issue, then start here:
> >
> >    local('getList' = XML_RPC($sendparams))
> >    #getList->getparams
> >    abort
> >
> > ...and see what params are really getting into the type.  Then examine the params to
> ensure that they truly are strings.
> >
> > Once you're certain about that, then go to the next step:
> >
> >    #getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')
> >
> > s/b:
> >
> >    #getList->call('https://domain.com:2443/xmlrpc', 'iworx.route')
> >
> > or use the explicit parameter names:
> >
> >    #getList->call(-uri='https://domain.com:2443/xmlrpc', -method='iworx.route')
> >
> > Is that a valid URI?
> >
> > Is that a valid method?
> >
> > If true for both, then look at the call method definition in xml_rpc.  the request is
> prepared, where each parameter in $sendparams is converted via:
> >
> >            #req->append(XMLRPC_ExConverter(#i))
> >
> > and that *should* handle pairs.
> >
> > If it's a needed adaption, then I suggest forking the repo and experiment.  That's what
> I did to get my use case to work when I needed xml_rpc for Lasso 9.  In my repo, I have a
> lot of experimental stuff to make it easier.
> >
> >> If I do this:
> >>
> >> local('getList' = XML_RPC($sendparams->asstring))
> >
> > Silly developer, passing an array as a string in an argument to xml_rpc type.
> >
> > --steve
> >
> >
> >> Then the error changes to (when #getList->call is run):
> >>
> >> Error Msg: libxml error while parsing document: Space required after the Public
> Identifier SystemLiteral " or ' expected SYSTEM or PUBLIC, the URI is missing
> >> Marc
> >>
> >>
> >> On Nov 13, 2014, at 12:30 PM, Steve Piercy - Website Builder <[hidden email]>
> wrote:
> >>
> >>> Explicitly:
> >>>
> >>> pair('apikey' = $key->asstring),
> >>>
> >>> --steve
> >>>
> >>>
> >>> On 11/13/14 at 12:10 PM, [hidden email] (Steve Piercy - Website Builder)
> >> pronounced:
> >>>
> >>>> The error message indicates that you passed a bytes type in as the first argument to
> bytes->importas, but it expects a string.
> >>>>  Cast all the pair values to string, and try again.
> >>>>  --steve
> >>>>   On 11/13/14 at 11:54 AM, [hidden email] (Marc Pinnell) pronounced:
> >>>>
> >>>>> How come the things that seem like they should be simple, just aren't some times?
> :)
> >>>>>  $sendparams = array(
> >>>>> pair('apikey' = $key),
> >>>>> pair('ctrl_name' = $api_controller),
> >>>>> pair('action' = $action),
> >>>>> pair('input' = $input)
> >>>>> )
> >>>>>  local('getList' = XML_RPC($sendparams))
> >>>>> #getList->call(('https://domain.com:2443/xmlrpc'), 'iworx.route')
> >>>>>  Errors out:
> >>>>> An unhandled failure during a web request
> >>>>> Error Code: -9948
> >>>>> Error Msg: Definition Not Found: bytes->importas(bytes, string)  Candidates were:
> bytes->importas(p0::string, p1::string)
> >>>>>  From what I can tell it is erroring on the #getList line...
> >>>>>  Any ideas?
> >>>>>  Marc
> >>>>>    On Nov 13, 2014, at 11:42 AM, Steve Piercy - Website Builder
> <[hidden email]>
> >>>> wrote:
> >>>>>
> >>>>>> This might help.
> >>>>>> https://github.com/stevepiercy/xml_rpc
> >>>>>>  My PR was merged into LassoSoft's repo.
> >>>>>> https://github.com/LassoSoft/xml_rpc/pull/2
> >>>>>>  --steve
> >>>>>>   On 11/13/14 at 10:50 AM, [hidden email] (Marc Pinnell) pronounced:
> >>>>>>
> >>>>>>> Never worked with XML before. Trying to convert a sample of  PHP code to L9. Not
> having  much luck with the docs in  finding something similar. Probably not looking for
> the
> >>>>> right
> >>>>>>> thing. Here's the PHP:
> >>>>>>> $client = new Zend_XmlRpc_Client(  '<a href="https://%%SERVERNAME%%:2443/xmlrpc'">https://%%SERVERNAME%%:2443/xmlrpc' );
> >>>>>>> $result = $client->call( 'iworx.route', $params );
> >>>>>>> What (If any) would the L9 code look like? I tried the L8  code as a test:
> >>>>>>> XML_RPCCall(
> >>>>>>>   -Host='https://domain.com:2443/xmlrpc',
> >>>>>>>   -Method='System.ListMethods'
> >>>>>>>   )
> >>>>>>> but get an error:
> >>>>>>> XML_RPCCall(-host=string, -method=string)
> >>>>>>> marc
> >>>>>>> Marc Pinnell
> >>>>>>> 1027 Design
> >>>>>>> PO Box 990872
> >>>>>>> Redding, CA 96099-0872
> >>>>>>> 530.941.4706
> >>>>>>> fax: 866.232.5300
> >>>>>>> www.1027Design.com
> >>>>>>>  #############################################################
> >>>>>>> This message is sent to you because you are subscribed to
> >>>>>>> the mailing list Lasso [hidden email]
> >>>>>>> Official list archives available at http://www.lassotalk.com
> >>>>>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>>>>> Send administrative queries to  <[hidden email]>
> >>>>>>  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >>>>>> Steve Piercy              Website Builder              Soquel, CA
> >>>>>> <[hidden email]>               <http://www.StevePiercy.com/>
> >>>>>>   #############################################################
> >>>>>>  This message is sent to you because you are subscribed to
> >>>>>> the mailing list Lasso [hidden email]
> >>>>>> Official list archives available at http://www.lassotalk.com
> >>>>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>>>> Send administrative queries to  <[hidden email]>
> >>>>>  Marc Pinnell
> >>>>> 1027 Design
> >>>>> PO Box 990872
> >>>>> Redding, CA 96099-0872
> >>>>> 530.941.4706
> >>>>> fax: 866.232.5300
> >>>>> www.1027Design.com
> >>>>>    #############################################################
> >>>>>  This message is sent to you because you are subscribed to
> >>>>> the mailing list Lasso [hidden email]
> >>>>> Official list archives available at http://www.lassotalk.com
> >>>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>>> Send administrative queries to  <[hidden email]>
> >>>>  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >>>> Steve Piercy              Website Builder              Soquel, CA
> >>>> <[hidden email]>               <http://www.StevePiercy.com/>
> >>>>   #############################################################
> >>>>  This message is sent to you because you are subscribed to
> >>>> the mailing list Lasso [hidden email]
> >>>> Official list archives available at http://www.lassotalk.com
> >>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>> Send administrative queries to  <[hidden email]>
> >>>
> >>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >>> Steve Piercy              Website Builder              Soquel, CA
> >>> <[hidden email]>               <http://www.StevePiercy.com/>
> >>>
> >>>
> >>> #############################################################
> >>>
> >>> This message is sent to you because you are subscribed to
> >>> the mailing list Lasso [hidden email]
> >>> Official list archives available at http://www.lassotalk.com
> >>> To unsubscribe, E-mail to: <[hidden email]>
> >>> Send administrative queries to  <[hidden email]>
> >>
> >> Marc Pinnell
> >> 1027 Design
> >> PO Box 990872
> >> Redding, CA 96099-0872
> >> 530.941.4706
> >> fax: 866.232.5300
> >> www.1027Design.com
> >>
> >>
> >>
> >> #############################################################
> >>
> >> This message is sent to you because you are subscribed to
> >> the mailing list Lasso [hidden email]
> >> Official list archives available at http://www.lassotalk.com
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > Steve Piercy              Website Builder              Soquel, CA
> > <[hidden email]>               <http://www.StevePiercy.com/>
> >
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> > the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
> Marc Pinnell
> 1027 Design
> PO Box 990872
> Redding, CA 96099-0872
> 530.941.4706
> fax: 866.232.5300
> www.1027Design.com
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Converting PHP XML-RPC to L9

stevepiercy
In reply to this post by Marc Pinnell-3
Oh, duh.  That's an associative array, otherwise called a map in Lasso, or a dict in Python.

So change your params to a map.

--steve


On 11/13/14 at 1:53 PM, [hidden email] (Marc Pinnell) pronounced:

> According to the docs...
>
> http://docs.interworx.com/interworx/api/index-Using-the-API.php#toc-Chapter-2
>
> marc
>
>
> On Nov 13, 2014, at 1:32 PM, Steve Piercy - Website Builder <[hidden email]> wrote:
>
> > Is that a valid URI?
> >
> > Is that a valid method?
>
> Marc Pinnell
> 1027 Design
> PO Box 990872
> Redding, CA 96099-0872
> 530.941.4706
> fax: 866.232.5300
> www.1027Design.com
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>