Adding additional parameters to the Subscribe functionality

37 views
Skip to first unread message

jaimini tapas

unread,
Feb 9, 2012, 5:04:49 AM2/9/12
to WS4D-gSOAP Development, elmar...@uni-rostock.de
I am trying to implement a client to subscribe to my scanner device.
Based on the server running at the scanner side, we need to have few
extra parameters to be added to the subscribe functionality. Subscribe
packet required to be as given below.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing"
xmlns:sca="http://schemas.microsoft.com/windows/2006/08/wdp/scan">
<soap:Header>
<wsa:To>http://10.255.110.133:7986/MyScanService</wsa:To>
<wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe</
wsa:Action>
<wsa:MessageID>urn:uuid:d930012e-7d2e-4823-b769-39db30f90651</
wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/
anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:From>
<wsa:Address>urn:uuid:ee52915f-0926-4812-9173-837727913325</
wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<wse:Subscribe>
<wse:EndTo>
<wsa:Address>http://10.255.110.126:5357/
ee52915f-0926-4812-9173-837727913325</wsa:Address>
<wsa:ReferenceParameters>
<wse:Identifier>urn:uuid:054781f5-1323-46a0-9d36-57c688bc467a</
wse:Identifier>
</wsa:ReferenceParameters>
</wse:EndTo>
<wse:Delivery Mode="http://schemas.xmlsoap.org/ws/2004/08/eventing/
DeliveryModes/Push">
<wse:NotifyTo>
<wsa:Address>http://10.255.110.126:5357/
ee52915f-0926-4812-9173-837727913325</wsa:Address>
<wsa:ReferenceParameters>
<wse:Identifier>urn:uuid:054781f5-1323-46a0-9d36-57c688bc467a</
wse:Identifier>
</wsa:ReferenceParameters>
</wse:NotifyTo><
/wse:Delivery>
<wse:Expires>PT1H</wse:Expires>
<wse:FilterDialect="http://schemas.xmlsoap.org/ws/2006/02/devprof/
Action">
http://schemas.microsoft.com/windows/2006/08/wdp/scan/ScanAvailableEvent
</wse:Filter>
<sca:ScanDestinations>
<sca:ScanDestination>
<sca:ClientDisplayName>Scan to in.com</sca:ClientDisplayName>
<sca:ClientContext>Scan</sca:ClientContext>
</sca:ScanDestination>
</sca:ScanDestinations>
</wse:Subscribe>

If you see the packet, it has additional parameters compared to the
existing ws4d subscribe packet i.e

<sca:ScanDestinations>
<sca:ScanDestination>
<sca:ClientDisplayName>Scan to in.com</sca:ClientDisplayName>
<sca:ClientContext>Scan</sca:ClientContext>
</sca:ScanDestination>
</sca:ScanDestinations>

I changed the source of the ws4d file with the name wse.xsd to add the
additional parameters. If you see I ma using the name space sca for
the additional parameters which are defined in the name space
"="http://schemas.microsoft.com/windows/2006/08/wdp/scan". If we use
this it generates the wse.h with the error saying undefined QName for
the "http://schemas.microsoft.com/windows/2006/08/wdp/scan". If I
remove the queue "http://schemas.microsoft.com/windows/2006/08/wdp/
scan" from the defnition in xsd and add prefix "wse" instead of "sca"
to the added destination parameter i.e wse:ScanDestinations, it
generates the correct wse.h without any issues, however this does nto
work as the name space is different. So i suspect we have to define
this queue some other place before using it in the wse.xsd.

Please suggest what more changes are required to have this name space
added to the Subscribe functionality.

Elmar Zeeb

unread,
Feb 9, 2012, 5:52:51 AM2/9/12
to ws4d-gs...@googlegroups.com
Hi Jaimini,
There should be a _any Field in the Subscription structure. You can use this to add any "raw" xml into the subscription. You should define the Namespace inline like:
<sca:ScanDestinations xmlns:sca="http://schemas.microsoft.com/windows/2006/08/wdp/scan"
>
<sca:ScanDestination>
<sca:ClientDisplayName>Scan to in.com</sca:ClientDisplayName>
<sca:ClientContext>Scan</sca:ClientContext>
</sca:ScanDestination>
</sca:ScanDestinations>

    The ws4d-gsoap-API may not support this at the moment, but I can add
    a function to do this. So you should try to change
    
    dpws_subscribe(), wse_subscribe() to pass xml strings that you can
    assign to the any element of the subscribe structure.

Regards,
Elmar
-- 

*******************************************************************************
  Dipl.-Inf. Elmar Zeeb
  Universität Rostock, Fakultät f. Informatik und Elektrotechnik
  Institut f. Angewandte Mikroelektronik und Datentechnik
  University of Rostock, Faculty of CS and EE
  Institute of Applied Microelectronics and Computer Engineering,
  18051 Rostock
  Deutschland/Germany
  Tel. : ++49 (0)381 498 - 7262
  Fax  : ++49 (0)381 498 - 7252
  Email: elmar...@uni-rostock.de
  www  : http://www.imd.uni-rostock.de/, http://www.ws4d.org/
*******************************************************************************

jaimini tapas

unread,
Feb 16, 2012, 7:17:03 AM2/16/12
to WS4D-gSOAP Development
Hi Elmar,

Thanks for your suggetions. After looking into the code for some time,
I could resolve the name space issue. Now Subscription packet is going
fine and I am able to get the proper responce for that packet. However
Now I need to wait for any event being sent from the server at my
client. I tried using the dpws_handle_Bind() and dpws_accept() calls.
But my dpws_handle_Bind() call fails.What should be the handle_URI i
should be passing to the dpws_handle_Bind(), whether it depends on
server? or do we need to pass this URI to server in Subscription
packet? Please throw some light on this parameter.
> ***************************************************************************­****
>    Dipl.-Inf. Elmar Zeeb
>    Universit�t Rostock, Fakult�t f. Informatik und Elektrotechnik
>    Institut f. Angewandte Mikroelektronik und Datentechnik
>    University of Rostock, Faculty of CS and EE
>    Institute of Applied Microelectronics and Computer Engineering,
>    18051 Rostock
>    Deutschland/Germany
>    Tel. : ++49 (0)381 498 - 7262
>    Fax  : ++49 (0)381 498 - 7252
>    Email: elmar.z...@uni-rostock.de
>    www  :http://www.imd.uni-rostock.de/,http://www.ws4d.org/
> ***************************************************************************­****- Hide quoted text -
>
> - Show quoted text -

saju s

unread,
Mar 2, 2012, 6:48:11 AM3/2/12
to WS4D-gSOAP Development
::
Reply all
Reply to author
Forward
0 new messages