Thursday, 3 December 2015

Handling CDATA in JAXB without escaping

JAXB by default escapes characters inside a string in the Java model when it converts the Java model to XML. This creates issues if you have CDATA present in the string. You will have even the CDATA tags escaped [i.e <![CDATA[&lt ], which makes it difficult for the consumer of the final XML for processing. So, to avoid this and to handle CDATA in JAXB the way you want, there are 3 approaches :
  1. Using XMLSerializer and OutputFormat :  Usage of this can be found in here. In the OutputFormat, one can specify the elements to be treated as CDATA. But both these classes XMLSerializer and OutputFormat - have been deprecated since Xerces 2.9.0. Latest Xerces version is 2.11.0. Following is what the Xerces documentation says : This class was deprecated in Xerces 2.9.0. It is recommended that new applications use the DOM Level 3 LSSerializer or JAXP's Transformation API for XML (TrAX) for serializing XML. See the Xerces documentation for more information. Ref https://xerces.apache.org/xerces2-j/javadocs/other/org/apache/xml/serialize/XMLSerializer.html https://xerces.apache.org/xerces2-j/javadocs/other/org/apache/xml/serialize/OutputFormat.html
  2. Using XMLAdapter and Character Escape Handler :  In this approach, one needs to 
    1. Specify Adapter class in the bindings.xjb for String element to be handled as CDATA. You can find how to specify it here. In the adapter class, in the marshall method one needs to add CDATA tag to the argument string.
    2. During marshalling of the javamodel by JAXB, one needs to specify CharacterEscapeHandler which can handle CDATA element without escaping. You can find usage here. Any other special handling like escaping in certain cases, also need to be handled. This is a nightmare to maintain.
  3. Using JAVAX XML Transformer APIs :  You can find the usage of this approach here. In this case, Javamodel from JAXB would be marshalled into a DOM document(w3 doc). Then, it would be transformed into XML string the way we want by JAVAX Transformer. In the Transformer, we can specify the list of elements to be handled as CDATA.
I would recommend using the third approach since it is configurable, easy to maintain and part of standard Java package. 

Friday, 18 May 2012

Solution for web pages with white spaces failing in Internet Explorer 9 (IE9)

If you have a webpage with white spaces/new line character between the ending of one html tag and beginning of another, then chances are there that it may not display or work properly in Internet Explorer 9. I checked the  html code generated for Internet Explorer 8(where it works!) and Internet Explorer 9. There is no difference. Then what has gone wrong?

Issue : 
  • Internet Explorer 9 is conforming to HTML 5 specifications. Accordingly HTML parsing has been changed in IE 9. One change that affects almost every page is how whitespace parsed. While IE8 removes or collapses whitespace, IE9 persists all whitespace into the DOM at parse-time. Refer to the following link for more details : http://blogs.msdn.com/b/ie/archive/2010/09/13/interoperable-html-parsing-in-ie9.aspx 
  • So, if you have java script code which accesses the nodes in DOM ignoring the white spaces previously, then you are bound to be in big  trouble. In IE9, all the white spaces/new lines in DOM are treated as nodes. So, when you traverse using APIs like firstChild may not reference to the element you might have intended.

Solutions :

  1. If you want to traverse elements (ignoring the white spaces) only then use Element Traversal APIs - calling functions such as nextElementSibling to ensure that you don’t reference a stray newline character or white space by mistake.
  2. On the other hand, make sure that your code is backward compatible with previous browser versions by adding check for the same while traversing the elements in DOM
  3. Removing the white spaces - this is a tedious job, as you would be doing the work of the browser done previously. But here you don't need to have the check for Internet Explorer browser versions. 

Tuesday, 15 May 2012

How to avoid GetSaveFileNameW failing in IE9 in Windows7?

GetSaveFileNameW is a Windows API. It creates a Save dialog box that lets the user specify the drive, directory, and name of a file to save. I had a ActiveX  plugin which was using this function to get the name of the file user is saving. It was working fine in IE8 in Windows XP but it started failing in IE9 on Windows 7. It did not create a dialog box and returned error!

CommDlgExtendedError : When inquired through CommDlgExtendedError about the reason for failure of GetSaveFileNameW, it said error code : 0xFFFF

Internet Explorer 9 logo
Explanation for error code 0xFFFF(CDERR_DIALOGFAILURE) - The dialog box could not be created. The common dialog box function's call to the DialogBox function failed. For example, this error occurs if the common dialog box call specifies an invalid window handle.

Debugging : Internet literature provided little help. Then, I checked whether this function - GetSaveFileNameW - worked fine for a standalone application. It did and then tried with the same set of parameters in ActiveX plugin. But it did not work for ActiveX plugin 

Reason for failure : Later I found that IE9 was not fully supporting the ATL version I was using. GetSaveFileNameW was failing because of the flag OFN_EXPLORER. How?

Solution : OPENFILENAMEW structure is filled before passing as a parameter to GetSaveFileNameW. Here, we set the flag OFN_EXPLORER in the Flags attribute of OPENFILENAMEW structure. If the OFN_EXPLORER flag is set, the system uses the specified template to create a dialog box that is a child of the default Explorer-style dialog box. If the OFN_EXPLORER flag is not set, the system uses the template to create an old-style dialog box that replaces the default dialog box. I was setting the flag - OFN_EXPLORER. I now reset the OPENFILENAMEW and it works!!!

Monday, 26 December 2011

Workaround for old Firefox Plugins crashing on Windows 7

I had an old plugin which was working fine in Windows XP. When I moved to Windows 7, this plugin kept crashing whenever opened. After a while, I was able to find a workaround for making this plugin work.
Windows 7

The answer lies in DEP (Data Execution Prevention). This feature was enabled in my Windows 7 machine. After I disable this feature I was able to run my plugin in Firefox. Here is how you can disable DEP in Windows 7.

1. Go to command prompt
2. Execute the command bcdedit /set nx AlwaysOff
3. Reboot the machine (rebooting is required for the above setting to reflect)

Ideally with DEP enabled, if you want to run your plugin, you have to build the plugin with the latest version of Windows SDK.


Friday, 17 June 2011

How to make your old plugins work with Firefox 4?

I had a old plugin, which was working fine with Firefox 3.6. When I upgraded to Firefox 4.0.1, it suddenly stopped working. Firefox was listing it in the list of plugins installed and pointing to the right dll to load. Googling for this issue did not help. Also, tried replicating the registry entries similar to the ones in the machine which had Firefox 3.6 installed. No, it also did not work out.

From Process Explorer, came to know that Firefox 4.0.1 was not at all loading the dll. Then I looked into the Firefox logs to see what exactly is going on with this plugin dll.
[ Use the following commands to get the Firefox browser logs in file c:\plugins.log.
C:\> set NSPR_LOG_MODULES=all:5
C:\> set NSPR_LOG_FILE=c:\plugins.log
C:\> cd C:\Program Files\Mozilla Firefox
C:\> firefox.exe ]

To my surprise, Firefox was actually loading the plugin dll. But immediately it was unloading it. Then I put debug logs in all the plugin implemented APIs, to see what was going wrong. Finally found out that in NPP_Initialize(), I was calling NS_GetServiceManager(), an XPCOM API to get a reference to the XPCOM service manager. It was failing to get the reference and NPP_Initialize() was returning NPERR_GENERIC_ERROR to the browser. Cause of the issue is thus found out. Looking for solutions in Google again, I hit on the code project link, which explained two ways of getting the reference for XPCOM service manager. One, I was using in my plugin using the XPCOM API, NS_GetServiceManager(). The other one used the XPCOM API NS_InitXPCOM2(). Tried this one. Wow, it worked!

You can surely try this solution, if you are looking for solutions as to why your old plugin is not working in Firefox 4.0.1. See you then. Happy debugging!

Sunday, 28 March 2010

Finding Out Slider Count and Total Call Time in Sony Ericsson Mobile Phone

Have you ever wanted to find out, how many times you have slided your Sony Ericsson slider phone(or slider count)? or Total call time of your Sony Ericsson mobile? Well, you find that out and more, with few key presses in your mobile.
  • Press the keys in the following order in your Sony Ericssson mobile phone - Right Navigation Key + '*' key + Left Navigation Key + Left Navigation Key + '*' key + Left Navigation Key + '*' key.
  • After you press the above keys, Service menu comes up on the mobile screen.
  • For finding out the slider count, Go to Service Info -> Slider Count.
  • For finding out the total call time of the mobile, Go to Service Tests -> Total Call time.
  • Apart from these, you can find the Model Info, Software Info, Configuration Info from 'Service info' menu item. You can also run tests to see the working of Main Display, LED/Illumination, Keys, Speaker, Earphone, Microphone, Vibrating Alert, Camera, Video Call Camera, Flash LED, FM Radio from 'Service tests' menu item.
  • To come out of Service menu, press the End Call key.
  • P.S: The above tests were done on Sony Ericsson W705 and W550i.

    Wednesday, 24 March 2010

    What to do when you are unable to make outgoing calls from your Hutch/Vodafone SIM?

    What is your immediate reaction when you are unable to make any calls from your cell phone. Frustrated? That was how I felt 2 days ago, when I was unable to make any outgoing calls from my mobile phone from a prime location in Bangalore. Electronic gadgets have made us over dependent on them nowadays.

    My initial reaction was to restart the cell phone. No, it did not work. Then I tried switching off the phone, removing the battery and SIM card, put them back again to see if it works. No, it also didn't work. After half an hour or so, when I tried to make a call, I was able to do so. But it was not because of the tasks I did above.Sony Ericsson w705 cell phoneLater I came to know that though the network icon in the phone showed full coverage when I tried restarting the phone or removing the battery/SIM, it was not so. In such cases, updation of the SIM card will do the trick. I use Hutch/Vodafone connection.

    Following are the steps you might want to follow to resolve the issue.
  • Go to Hutch Plus menu in your mobile phone.
  • Select Hutch Roam.
  • Select Hutch.
  • A Message will be displayed - 'SIM card update starts...', Select OK
  • One more message will be displayed - 'Allow SIM Update? Phone will restart', Select OK
  • After you do this you will see, 'Inactive SIM', in place of operator logo Hutch.
  • Phone will restart after few seconds and network coverage icon is shown on your cell phone.
  • You should now be able to make outgoing calls.
    P.S: The above procedure has been tested only on Home network of Hutch and not in Hutch Roaming.

    Sunday, 21 March 2010

    BSNL EVDO Data card availability only on paper!

    If you had noticed the ads by BSNL in newspapers, featuring ever smiling Deepika Padukone and Abhinav Bindra, about the EVDO Data Cards they are offering now for discounted prices, you tend to believe that the EVDO Data cards are readily available. As per the ad, for customers activating the EVDO postpaid unlimited data plan till 31st March 2010, fixed monthly rental will be Rs.750 instead of Rs.999. Though there are intial charges like Activation Charges(Rs.500), price of Data Card(Rs.3500)/monthly rental for the card(Rs.200) and refundable security deposit(Rs.1000), it seemed like a good bet. But when you do a reality check by contacting the BSNL Customer Service Center, the story is entirely different.Deepika Padukone and Abhinav Bindra in BSNL EVDO Card AdWhen I contacted the Executive at BSNL Customer Service Center at Vijayanagar, Bangalore, he said there are no EVDO Data cards available as of now. Though the ads are in place, they say they have not been supplied enough EVDO Data Cards. Instead he offers me a NIC(Network Interface card), with max speed upto 144 kbps. Well, why do I go for that, when my BSNL Broadband connection(Dataone) offers much more than that speed(256 kbps). He adds that though the max speed is 144 kbps, NIC average speed may be upto 100 kbps. Then, when I tell the area where I reside, he reduces average speed further. BSNL NIC Card uses CDMA 1x technology, predecessor of CDMA 1x EVDO, offers speed upto 144 kbps whereas BSNL EVDO Card offers upto 3.1 Mbps. BSNL Customer Service executive also informed that the average speed offered by EVDO Card can be upto 1 Mbps. Voila, who would not want such a speed on a wireless internet card!

    Well, my main intention was to get EVDO Data Card which offers higher speed than the BSNL broadband. More importantly, I am fed up with the frequent connection lost scenarios with BSNL Broadband. Also, pricewise current discount matches with the unlimited usage offer by BSNL Broadband Dataone connection, I am currently having for Rs.750. Hoping for the things to improve at BSNL.

    For FAQs on NIC and EVDO Cards by BSNL, you can visit this BSNL link and for the tariff plans, click here.

    Friday, 19 March 2010

    Web Services On Devices : WS Discovery using Function Discovery in Windows Vista

    Function Discovery APIs for performing WS Discovery:
    Function Discovery APIs in Windows Vista, provides a uniform programmatic interface for enumerating system resources, such as hardware devices, whether they are local or connected through a network. It enables applications to discover and manage lists of devices or objects sorted by functionality or class. Function Discovery supports an extensible discovery provider model. The providers included in the system provide an abstraction layer over existing standards such as Plug and Play (PnP), SSDP, WS-Discovery, and the registry. To find more about Function Discovery visit the following links:
    Function Discovery - http://msdn.microsoft.com/en-us/library/aa814070.aspx
    Retrieving all function instances in a Category - http://msdn.microsoft.com/en-us/library/aa364810(VS.85).aspx

    WS-Discovery:
    Windows SDK 6.1 comes with a sample program demonstrating the use of Function Discovery API. The sample can be found in the following path - “windows SDK folder\Samples\NetDs\FunctionDiscovery”. This sample program discovers PnP devices on the network.

    Modifying the Sample Program to discover WSD devices on the network:
    CMyFDHelper class : CMyFDHelper (in FunctionDiscovery.h) is a helper class and is derived from CfunctionDiscoveryNotificationWrapper. CMyFDHelper class implements OnUpdate, OnError, OnEvent callback functions of parent class – CfunctionDiscoveryNotificationWrapper.

    Create Instance Collection Query : HRESULT CMyFDHelper::ListFunctionInstances( const WCHAR* pszCategory ) lists all the devices of pszCategory found. Here, it creates an Instance Collection query by calling CreateInstanceCollectionQuery of IFunctionDiscovery. Pass first parameter pszCategory as FCTN_CATEGORY_WSDISCOVERY.

    Add a constraint to Query : IFunctionInstanceCollectionQuery *pQuery is the query created. Add constraint to the query for searching only WSD printers.
    hr = pQuery->AddQueryConstraint(
    PROVIDERWSD_QUERYCONSTRAINT_TYPE,
    L"http://schemas.microsoft.com/windows/2006/08/wdp/print/PrintDeviceType" );
    To find more about AddQueryConstraint go to - http://msdn.microsoft.com/en-us/library/aa364366(VS.85).aspx

    Execute the Query and Count of instances: This is done by calling execute function on pQuery. Since WSD Providers only return instances through the IFunctionDiscoveryNotification interface, dwCount in statement - pCollection->GetCount( &dwCount ); will be zero. So, return from here.

    IFunctionDiscoveryNotification interface : In CMyFDHelper:: Initialize(), IFunctionDiscoveryNotification interface Functions - OnUpdate, OnError, OnEvent are implemented in CMyFDHelper. So when the Function discovery APIs detect the presence of WSD devices in the network, OnUpdate callback function in CMyFDHelper class will be called.

    In HRESULT CMyFDHelper::OnUpdate(), there is a block of code which check what event has occurred(device added, removed or updated). In case of discovery of WSD printer, the event will be added(QUA_ADD == eAction). So, in this case, call CMyFDHelper::DisplayProperties().

    CMyFDHelper::DisplayProperties() outputs all the properties of the particular device. There is a switch case block where there is case for VT_LPWSTR. Check for pszKeyName is PNPX_GlobalIdentity. If it is so, extract the key value. Key value is UUID. Store this value which will be later required for the creation of Device proxy.

    Wednesday, 17 March 2010

    Web Services on Devices : Developing a Print Client in Windows Vista

    With WSDAPIs generated in previous post, we can now start developing a Print client.

    How do I start developing a Print Client?
    For the Print Client to communicate with a WSD Printer, first it has to discover the WSD Printers on the network. For knowing about discovering the Printers on the network and getting the UUID – universally unique identifier for the printer, refer to the sample Function Discovery program in the following path - "Folder where windows SDK is installed\Samples\NetDs\FunctionDiscovery".

    Discovering the Printers on the network and getting the UUID :
  • Sample program defines CMyFDHelper class which is used to discover PnP devices on the network. This can be tweaked to discover WSD Printers on the network.
  • Call HRESULT CoInitializeEx (LPVOID pvReserved, DWORD dwCoInit) with pvReserved = NULL and dwCoInit = COINIT_MULTITHREADED from main(); (Ref - http://msdn.microsoft.com/en-us/library/ms886306.aspx ).This function initializes the Component Object Model (COM) for use by the current thread. Applications are required to use CoInitializeEx before they make any other COM library calls except for memory allocation functions.
  • For the exact changes to be made in CMyFDHelper class to discover WSD devices, please wait for my next post on WS Discovery.
  • Call ::CoUninitialize();

  • Creating Service Proxy and sending messages to the server:(Refer to the File Service example in Windows SDK folder, mentioned earlier)
  • Create a UUID for client by calling UuidCreate() function. Convert the obtained UUID to string format.
  • Create a Service proxy by calling CreateCPrinterServiceTypeProxy(LPCWSTR pszDeviceAddress, LPCWSTR pszLocalAddress, CPrinterServiceTypeProxy** ppProxyOut, IWSDXMLContext** ppContextOut) [defined in PrinterServiceTypeProxy.cpp, LPCWSTR is wchar*] passing UUIDs of device/server and client in pszDeviceAddress and pszLocalAddress respectively.This function returns CPrinterServiceTypeProxy which will be used for calling methods on the server. Client calls CPrinterServiceTypeProxy methods(like CreatePrintJob, SendDocument etc), which have the same interface that of server and they send the commands to the server. Note: We need to create IWSDDeviceProxy before creating any IWSDServiceProxy(CPrinterServiceTypeProxy is of this type and a single device can host multiple services). Creation of device proxy before service proxy is handled at CreateCPrinterServiceTypeProxy. [More details on device and service proxies can be found from the following link - http://blogs.msdn.com/dandris/archive/2008/03/03/wsdapi-101-part-4-the-interfaces-under-the-generated-code.aspx ]
  • Create a Event Sink class for Server events. Define a class named CPrinterServiceTypeEventNotify derived from IPrinterServiceTypeEventNotify. Implement the IPrinterServiceTypeEventNotify methods defined as virtual, in this class – PrinterElementsChangeEvent, JobStatusEvent, JobEndStateEvent. These are call back functions which will be invoked when the server sends respective events. We can update our structures holding printer, job info in these functions.
  • Functions defined above will be called if the client is subscribed to the events from server. Call the subscribe functions like SubscribeToJobStatusEvent, SubscribeToJobEndStateEvent on service proxy i.e CPrinterServiceTypeProxy object.(these functions are defined in PrinterServiceTypeProxy.cpp)
  • Call the server functions on CPrinterServiceTypeProxy object. For example, for CreatePrintJob you need to send filled CREATE_PRINT_JOB_REQUEST_TYPE structure and CREATE_PRINT_JOB_RESPONSE_TYPE* for response. Type definitions for the same can be found in PrinterServiceTypeTypes.h

  • Resolving the Build Errors in Visual Studio:
  • Set the project dependencies and build order – Right click on project. Select Project Dependencies. Make sure Client project depends on the project created for Print Schema. Also set the build order as Print Schema project, Client project in the same window opened.
  • You may get compilation error for not able to find header files like PrinterServiceTypeProxy.h. Then check whether you have included the files from project for PrinterServiceSchema. To include them, right click on Projects. Select Properties -> Configuration Properties -> C/C++ -> General -> Additional Include directories and type project directory for PrinterServiceSchema.
  • You may get linker error (unresolved external symbol) for UuidCreate(). If so, check whether you have included rpcrt4.lib. To include the same, right click on Project. Select Properties -> Configuration Properties -> Linker -> Command line -> Additional options. Type rpcrt4.lib.
  • If you get linker errors for wsdapi functions make sure you have included wsdapi.lib.
  • With the above steps, you are now ready with the basic Print Client which communicates with the WSD Printer.

    Tuesday, 16 March 2010

    Web Services On Devices : Getting WSDAPIs for Print Client

    WSDAPI stack provided by Microsoft as part of Windows Rally technologies, is an implementation of DPWS(Devices Profile for Web Services), which defines a minimal set of implementation constraints to enable secure Web Service messaging, discovery, description, and eventing on resource-constrained devices.

    If you had gone through the links, I provided in my first post on Web Services on Devices (Web Services on Devices : Environment Set Up in Windows Vista), you would have known by now, what it requires to develop a Web Service Device which hosts Web Service and a Web Service Client, which uses the services hosted on Web Service Device. In this post, I will be explaining how you can develop a Web Services client in Microsoft Windows Vista, using WSDAPIs taking the example of Print Service.

    Where can I get more information on DPWS, WSDAPIs, Windows Rally Technologies?
    Go to - http://www.microsoft.com/whdc/connect/rally/rallywsd.mspx

    Where can I get the Print Device and Print Service Specifications for implementing Print Service and Print Service Client?

    Go to - http://www.microsoft.com/whdc/connect/rally/wsdspecs.mspx, where you can download Specifications and Supporting Files for Print Device and Print Service. These schemas/specification describe the format of data being exchanged between the Web Service and Web Service Client and the interfaces which need to implemented by the Device, which provides the Print Service. After unzipping the zip file downloaded from the above link, you will find WSDPrinterService.wsdl, supporting .xsd files and WSDPrintService.doc explaining the schema. WSDPrintService.doc should give you a fair idea of what it requires to develop a Print Client based on WSD protocol.

    Developing a Print Service Client, using the schema/specification just downloaded:

    How do I get WSDAPIs to be called from Print Client?

    Following steps explain how to go about building Print Client.
  • Get WSDPrinterService.wsdl and other .xsd files(Print Service Schema).
  • Generate a config file by running WsdCodeGen on WSDPrinterService.wsdl.
    You can find wsdcodegen.exe in "Windows SDK folder\Bin". run "wsdcodegen.exe /generateconfig:all WSDPrinterService.wsdl". This command will generate codegen.config. Make sure the directory which contains WSDPrinterService.wsdl also holds all the .xsd files from Print Service Schema as WSDPrinterService.wsdl includes those .xsd files. Otherwise, you will find that message structure elements in PrinterServiceTypeTypes.h (which gets generated in next step) will be empty.
  • Generate IDL, C++ and header files.
    run "wsdcodegen.exe /generatecode codegen.config". This command will generate the following files - PrinterServiceType.idl, PrinterServiceTypeProxy.h, PrinterServiceTypeProxy.cpp, PrinterServiceTypeTypes.h, PrinterServiceTypeTypes.cpp and PrinterServiceTypeStub.cpp. These files can be added as a part of Visual Studio project and can be built into a static library (.lib)
  • You may face problems like – not able to include PrinterServiceType.h in building the above .lib, since PrinterServiceTypeProxy includes PrinterServiceType.h, which contains the definitions for interfaces like CreatePrintJob, SendDocument etc. This and other files – PrinterServiceType_p.c and PrinterServiceType_i.c are generated by MIDL (Microsoft Interface Definition Language) compiler when building the above mentioned .lib. You may notice that, in case of above error, MIDL would have generated PrinterServiceType_h.h in the Project folder. To make sure that MIDL generates PrinterServiceType.h make the following settings changes. In Visual Studio solution explorer, right click on the Project. Select Properties, Configuration Properties, MIDL, Output, Header File. Change the value to $(InputName).h instead of $(InputName)_h.h

  • Now you are ready with required WSDAPIs to be called from your Print Client application.

    Monday, 15 March 2010

    Web Services on Devices : Environment Set Up in Windows Vista

    Web Services on Devices(WSD) is still a new technology as the amount of literature available on the web on developing WSD applications is limited. Here, I am presenting a series of posts, which may help those who are new to WSD.

    Microsoft provides set of WSD APIs for developing WSD Applications from Windows Vista onwards. Here are some FAQs while setting up environment in Vista for WSD Development.

    Setting up Windows SDK and Visual Studio environment for developing Web Services on Devices Applications:-
    Best way to set up the required environment is to first install Visual Studio and then Windows SDK. This will avoid the getting into unnecessary problems relating to integrating Windows SDK directory paths to Visual Studio.
    Please Note : When I started using WSDAPIs for developing WSD Applications, I had used Windows SDK 6.1 and Microsoft Visual Studio 2008. So, the information provided here pertain to these softwares.

    What if I have already installed Windows SDK and now installing Visual Studio?
    Once the Visual Studio installation is complete, follow the instructions in the following Microsoft Windows SDK blog, where you need to use Windows SDK Configuration tool to integrate with the Visual Studio. http://blogs.msdn.com/windowssdk/archive/2008/03/01/integrating-windows-sdk-and-vs-with-new-sdk-configuration-tool.aspx. Make sure you choose the latest version of Windows SDK from configuration tool, in this case 6.1, if you also have older versions of Windows SDK installed.

    How to validate whether Visual Studio directories were successfully updated with Windows SDK?
    Go to Start, Programs, Microsoft Visual Studio 2008, Visual Studio Tools, Visual Studio 2008 Command Prompt. At the command prompt, type PATH. Check the following path is listed, "dir where Latest Windows SDK was installed\bin"

    Where do I start reading about WSDAPIs?
    You can refer to the following blog link by Dan Driscol, a Microsoft developer. http://blogs.msdn.com/dandris/archive/2007/11/09/wsdapi-101-part-1-web-services-from-10-000-feet.aspx. In case of any doubt, you can drop a comment in his blog post. Usually replies within a day or two.

    Where can I find sample programs on WSDAPIs in windows SDK?
    Go to "Folder where windows SDK is installed\Samples\Web\WSDAPI". Here you will find 2 folders: Stock Quote and File Service. Stock Quote is a simple example where Client is calling a method on Service. File Service is more complete example which covers WS Eventing as well. Both examples have code for Client and Service and require Client to know the device address/UUID.

    Ok, where can I find a sample program where a Client discovers WSD devices on the network?
    Go to "Folder where windows SDK is installed\Samples\NetDs\FunctionDiscovery". This sample program discovers PnP devices on the network. This code can be easily modified to find WSD devices on the network.

    LinkWithin

    Related Posts with Thumbnails