+ Reply to Thread
Results 1 to 14 of 14

Thread: Niagara "web services" client?

  1. #1
    Join Date
    Apr 2011
    Location
    Pennsylvania
    Posts
    128
    Post Likes

    Lightbulb Niagara "web services" client?

    Any tips on implementing a "Web Services" client in Niagara (either R2 or G3)?

    I need to communicate with an electrical utility service via a SOAP/1.1 compliant connection, to poll for command info about our zone.

    They supplied us with a .wsdl file (and .NET code), but I don't know which Niagara module or framework I would base this off of. The Obix stuff is implemented in Web Services, but the utility isn't using Obix.

    Searching Niagara Central only seems to show me ways to implement a Web Services server.

    I could implement this in C#/VB.NET and use OPC to communicate the event with R2/G3, but it would be much cleaner if I could just do it all within Niagara.

  2. #2
    Join Date
    Jul 2008
    Location
    Melbourne
    Posts
    1,611
    Post Likes
    try GetHTTP from the AxCommunity jar
    1 + 1 = 3 ( *** for very large values of 1)

    ...everybody wants a box of chocolates and long stemmed rose

    Be brave. You cannot get eaten by an imaginary tiger.

  3. #3
    Join Date
    Apr 2011
    Location
    Pennsylvania
    Posts
    128
    Post Likes
    Thread Starter
    Quote Originally Posted by MatrixTransform View Post
    try GetHTTP from the AxCommunity jar
    GetHTTP looks like it is just grabbing the source of a requested webpage, and returning it as a string.

    I was really hoping to find some SOAP framework code which could accept the .wsdl file, parse the schema and return the elements that are specified in it.

  4. #4
    Join Date
    Apr 2007
    Location
    San Diego, CA
    Posts
    2,254
    Post Likes
    Quote Originally Posted by jrevans View Post
    Any tips on implementing a "Web Services" client in Niagara (either R2 or G3)?
    Check with Mike Arnott at Kors Engineering, they have a Web Services server for AX. It uses Java 1.5 libraries, which would prevent you from running this on QNX JACEs with the J9 JVM (J2ME libraries)

    http://70.40.199.119/products/web-se...or-niagara-ax/

  5. #5
    Join Date
    Apr 2011
    Location
    Pennsylvania
    Posts
    128
    Post Likes
    Thread Starter
    Quote Originally Posted by digo View Post
    Check with Mike Arnott at Kors Engineering, they have a Web Services server for AX. It uses Java 1.5 libraries, which would prevent you from running this on QNX JACEs with the J9 JVM (J2ME libraries)

    http://70.40.199.119/products/web-se...or-niagara-ax/
    I read of the Kors module, but it appeared to be for serving Web Services, not consuming Web Services.

    But, in this thread: https://www.niagaraframework.com/ord...ionThread/9276
    he mentions a utility for consuming.

    I suppose I could drop him an email.

    Cost is going to be an issue, since I can develop a .NET / OPC application for free....

  6. #6
    Join Date
    Apr 2007
    Location
    San Diego, CA
    Posts
    2,254
    Post Likes
    Quote Originally Posted by jrevans View Post
    Cost is going to be an issue, since I can develop a .NET / OPC application for free....
    Great, If I ever need an app developed... now I know who to talk to

    Mike started the AxCommunity project on sourceforge, perhaps you can persuade him to include the web services client in the community module.

  7. #7
    Join Date
    Apr 2011
    Location
    Pennsylvania
    Posts
    128
    Post Likes
    Thread Starter
    Quote Originally Posted by digo View Post
    Great, If I ever need an app developed... now I know who to talk to
    I can do Modbus/TCP too.

    Quote Originally Posted by digo View Post
    Mike started the AxCommunity project on sourceforge, perhaps you can persuade him to include the web services client in the community module.
    I'll start out by emailing him first.

  8. #8
    Join Date
    Jul 2008
    Location
    Melbourne
    Posts
    1,611
    Post Likes
    ...cant you take the String returned or ByteArray or whatever and parse it for XML elements etc etc
    1 + 1 = 3 ( *** for very large values of 1)

    ...everybody wants a box of chocolates and long stemmed rose

    Be brave. You cannot get eaten by an imaginary tiger.

  9. #9
    Join Date
    Apr 2011
    Location
    Pennsylvania
    Posts
    128
    Post Likes
    Thread Starter
    Quote Originally Posted by MatrixTransform View Post
    ...cant you take the String returned or ByteArray or whatever and parse it for XML elements etc etc
    Indeed I could, but I was under the impression that when properly using Web Services, the server would only return the requested data elements. (Then again, I've never used Web Services, so I don't know much....)

    I'm supposed to be polling every five seconds, and didn't really want to be grabbing too much data every time.

  10. #10
    Join Date
    Jul 2008
    Location
    Melbourne
    Posts
    1,611
    Post Likes
    yeah, so you send the appropriate request with a POST/PUT and the server will respond ... and you can pull apart the XML
    1 + 1 = 3 ( *** for very large values of 1)

    ...everybody wants a box of chocolates and long stemmed rose

    Be brave. You cannot get eaten by an imaginary tiger.

  11. #11
    Join Date
    Apr 2012
    Posts
    153
    Post Likes
    You could use any generic Java web service library (e.g. JAX-WS 2.0) to build SOAP client for Niagara.

  12. #12
    Join Date
    Apr 2011
    Location
    Pennsylvania
    Posts
    128
    Post Likes
    Thread Starter
    Quote Originally Posted by pault View Post
    You could use any generic Java web service library (e.g. JAX-WS 2.0) to build SOAP client for Niagara.
    Thanks pault. I just looked at the JAX-WS stuff. Interesting.
    My biggest problem is that I've never done Java development for Niagara (and haven't seriously written in Java for ten years....)

    We do have Eclipse setup on our server, and another developer did some stuff with it, so I'll have to take a look at how it is done.

    It appears that we have an error at Eclipse startup which I have to figure out:
    An internal error occurred during: "Loading Niagara Plug-in".
    java.lang.IllegalArgumentException: Attempted to beginRule: MultiRule[P/axCommunity,P/.org.eclipse.jdt.core.external.folders], does not match outer scope rule: com.tridium.niagara.project.rules.NreRule@121bfd6
    Can anyone point me to a good Java / Niagara tutorial?

  13. #13
    Join Date
    Apr 2011
    Location
    Pennsylvania
    Posts
    128
    Post Likes
    Thread Starter

    Niagara / Java development

    Quote Originally Posted by jrevans View Post
    It appears that we have an error at Eclipse startup which I have to figure out:
    I read some stuff over on Niagara Central, and that error was apparently fixed in later versions of the plugin. I upgraded the plugin from 7.1.3 to 7.1.6 and the error went away.

    Now, off to learn how to use this stuff.

  14. #14
    Join Date
    Apr 2012
    Posts
    153
    Post Likes
    Quote Originally Posted by jrevans View Post
    Thanks pault. I just looked at the JAX-WS stuff. Interesting.
    My biggest problem is that I've never done Java development for Niagara (and haven't seriously written in Java for ten years....)
    That might be a problem
    Niagara is a quite big framework with some not so simple mechanisms.

    I recommend you to build a very simple command line WS client first (without any Niagara stuff) just to understand SOAP and Java WS.
    Then you could take a look on Niagara services on how to transmit WS data to Niagara objects.
    A fully functional Niagara driver seems to be an overkill here.

+ Reply to Thread

Quick Reply Quick Reply

Register Now

Please enter the name by which you would like to log-in and be known on this site.

Please enter a password for your user account. Note that passwords are case-sensitive.

Please enter a valid email address for yourself.

Log-in

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •