PDA

View Full Version : [jdev] In-Band RPC and SOAP discovery


Jonathan Dickinson
05-22-2008, 03:29 PM
Hey all,

What are the options here?

One potentially elegant solution would be (for XMPP-RPC):

C:
<iq type='get'
from='requester (AT) company-b (DOT) com/jrpc-client'
to='responder (AT) company-a (DOT) com/jrpc-server'
id='disco1'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>

S:
<iq type='result'
to='requester (AT) company-b (DOT) com/jrpc-client'
from='responder (AT) company-a (DOT) com/jrpc-server'
id='disco1'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity category='automation' type='rpc'/>
<feature var='jabber:iq:rpc'/>
<identity category='automation' type='jabber:iq:rpc' />
<feature var='http://www.mycompany.org/xml-rpc/example.ConvertCurrency.php' />
<!-- More Services -->
</query>
</iq>

And for SOAP:

C:
<iq from='requester (AT) example (DOT) com/soap-server'
to='responder (AT) example (DOT) com/soap-client'
id='disco1'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'>
</query>
</iq>

S:
<iq from='responder (AT) example (DOT) com/soap-server'
to='requester (AT) example (DOT) com/soap-client'
id='disco1'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity category='automation' type='soap'/>
<feature var='http://jabber.org/protocol/soap'/>
<identity category='automation' type='http://jabber.org/protocol/soap' />
<feature var='http://www.myserver.org/soap/someservice' />
<!-- More to follow -->
</query>
</iq>

And for getting the wsdl:

C:
<iq from='requester (AT) example (DOT) com/soap-server'
to='responder (AT) example (DOT) com/soap-client'
id='soap1'
type='get'>

<wsdl:definitions name='SomeService'
targetNamespace='http://www.myserver.org/soap/someservice'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' />

</iq>

S:
<iq from='responder (AT) example (DOT) com/soap-client'
to='requester (AT) example (DOT) com/soap-server'
id='soap1'
type='result'>

<wsdl:definitions name='SomeService'
targetNamespace='http://www.myserver.org/soap/someservice'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'>

<!-- WSDL definitions -->

</wsdl:definitions>

</iq>

Yes/no/good/bad/ugly/scary?

I am implementing this stuff so I need some feedback before I make a home-grown protocol.

Jonathan

Maciek Niedzielski
05-22-2008, 05:04 PM
Jonathan Dickinson wrote:
> What are the options here?

> <feature
> var='http://www.mycompany.org/xml-rpc/example.ConvertCurrency.php' />

Note that there may be things like <feature
var="http://jabber.org/protocol/something"/> there, too. It would be a
bit confusing if we started adding URLs there.

Maybe XEP 215 would be helpful?

--
Maciek
xmpp:machekku (AT) uaznia (DOT) net

Peter Saint-Andre
05-22-2008, 05:27 PM
On 05/22/2008 7:25 AM, Jonathan Dickinson wrote:
> Hey all,
>
> What are the options here?
>
> One potentially elegant solution would be (for XMPP-RPC):
>
> C:
> <iq type='get'
> from='requester (AT) company-b (DOT) com/jrpc-client'
> to='responder (AT) company-a (DOT) com/jrpc-server'
> id='disco1'>
> <query xmlns='http://jabber.org/protocol/disco#info'/>
> </iq>
>
> S:
> <iq type='result'
> to='requester (AT) company-b (DOT) com/jrpc-client'
> from='responder (AT) company-a (DOT) com/jrpc-server'
> id='disco1'>
> <query xmlns='http://jabber.org/protocol/disco#info'>
> <identity category='automation' type='rpc'/>
> <feature var='jabber:iq:rpc'/>
> <identity category='automation' type='jabber:iq:rpc' />
> <feature var='http://www.mycompany.org/xml-rpc/example.ConvertCurrency.php' />

What exactly does that identify? Is that a *feature* or a *service*?

If it's a service, it's better to identify it via disco#items or even
XEP-0215 as Maciek notes, because the service is external to the XMPP
network.

<snip/>

> <wsdl:definitions name='SomeService'
> targetNamespace='http://www.myserver.org/soap/someservice'
> xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' />

Or:

<definitions

<wsdl:definitions
xmlns='http://schemas.xmlsoap.org/wsdl/'
name='SomeService'
targetNamespace='http://www.myserver.org/soap/someservice'/>

Six of one, half a dozen of the other. :)

I'm not a huge WSDL fan, but what you've described will work, I think.

Peter

--
Peter Saint-Andre
https://stpeter.im/