Help get this topic noticed by sharing it on Twitter, Facebook, or email.

New PHP interface to MSTag API without 3rd party REST interface

I've created a new PHP interface to the MS Tag API. My application could not rely on a 3rd party REST interface so I've written a stand alone version uses the SOAP extension in PHP. Here is a link to the project for anyone interested in using it: http://mstagphpsoap.codeplex.com/. Hope if helps.
2 people like
this idea
+1
Reply
  • I’m thankful
    Thank you for posting this since it provides Tag API developers additional options at implementing their projects.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • I get this error when using the library. What's needed in terms of certificates? My service uses a dedicated IP address and SSL is activated, but I haven't installed any other certificates.

    Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ws.tag.microsoft.com/Service....' : failed to load external entity "https://ws.tag.microsoft.com/Service...." in /hsphere/local/home/anderscorp/cliqtags.com/mstagsoap.php:613 Stack trace: #0 /hsphere/local/home/anderscorp/cliqtags.com/mstagsoap.php(613): SoapClient->SoapClient('http://ws.tag.m...', Array) #1 /hsphere/local/home/anderscorp/cliqtags.com/mstagsoaptest.php(10): MSTag->__construct() #2 {main} thrown in /hsphere/local/home/anderscorp/cliqtags.com/mstagsoap.php on line 613

    Thanks in advance,
    Anders
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Greetings,

    Thank you for your interest in Microsoft Tag. Please know that the Microsoft Tag Php SOAP Interface is not a Microsoft product. It was put together by the community on CodePlex. Hence, this is not a definitive answer – the codeplex forum may be yield a better result.

    A cursory analysis suggests that the error below occurs when the PHP code fails to load one of the SOAP/WSDL artifacts hosted on the Tag website. Some common reasons for this may be:

    -The PHP code might not have outgoing Internet connectivity over the SSL port (443). Check that the machine can open the URL in the error message with a web browser.
    PHP is not configured to use SSL. Make sure that the OpenSSL module is enabled in the php.ini file. In the Windows version of PHP this means uncommenting the following line:

    ;extension=php_openssl.dll

    If you have any questions, comments or suggestions, please let us know.

    Thank you for your feedback and your interest in Microsoft Tag.

    Best Regards,

    Microsoft Tag Support Team
    tagsupp@microsoft.com
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • I don't have access to a UI on the server (outsourced), so I can't test that aspect.

    OpenSSL is installed according to phpinfo. Port 443 might still be inaccessible, but I guess that's less likely.

    I can access the main WSDL for MS Tags via file_get_contents and my own Curl-based request function without problem.

    I'll continue the analysis and maybe revise the SOAP code due to the above.

    Cheers,
    Anders
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • I've found somewhat proof that the SOAP library used has general problems with SSL.

    http://www.46palermo.com/blog/how-to-...

    Other places indicate Nusoap works better, but I haven't verified yet (but soon).
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Nusoap works fine. I'm in the process of rewriting the parts of the MS Tag library that I need: __construct, CreateTag, GetBarcode.

    I now noticed that it's the MS Tag API that is very slow (it takes 4-5 seconds to generate a barcode, that makes for a bad user experience), not the the third-party REST API.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Oddly the REST API is considerably faster than the SOAP API, like 2-3 times.

    The CreateTag/GetBarcode combo via SOAP takes ~10 seconds (same time per request). That's way too slow.

    I also experience the MS Tag info site to be slow.

    I'm in Sweden, but that shouldn't matter.

    Due to the above I use the REST API for now, even though I've prepared to use SOAP via Nusoap if things change.

    Cheers,
    Anders
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Respectfully Anders, I think you may have some other issues with your setup that you are attributing to the PHP library. The library runs on my machine and does a CreateTag/GetBarcode combo in 1-3 seconds. I am using a modest laptop as server and typical broadband connection to get these results. I am not experiencing any of the SSL issues you are describing and it is a very basic server _AMP server setup.

    Most of the work creating a tag would be done on the Microsoft API processing end, and very little processing would be done on your local php server aside from negotiating the SOAP connections so it doesn't really make sense that it would take longer. I would not expect very much speed difference between the REST API or this approach. It's just a different approach for those who have policies or other practices that would limit the reliance on 3rd parties apps. The REST API would provide a nice clean and simple approach for many.

    If you have a NuSoap implementation, you should consider contributing it to the project. Keep in mind that PHP's soap client is readily available in most basic php installations, where NuSoap requires more knowledge to set up thus limiting the number of users that can quickly use this library.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • I've put SOAP to rest (no pun intended; well, maybe), and I'm only using your API at the moment.

    I didn't get Nusoap to work either, so it might be some configuration error on my host (that is outsourced). At the moment I won't do anything more, as currently all my clients use QR Codes.

    Cheers,
    Anders
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited