ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Webservice XML

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webservice XML

    Hi all,

    I need to read a Plain Old XML document sent by our client (thru http) & reply to him as an XML
    I don’t have high enough knowledge about this technology but scanning about “QtmhRdStin” api but couldn’t find good examples.
    Is it possible to do that using RPG? Or what would be the best methods to use?
    Please give me an advice to start with this?

    Thanks
    Dhanuxp

  • #2
    Re: Webservice XML

    a few good resources could be found at:

    http://www.scottklement.com/ ~ thru his open source link

    http://www.isockets.net/ ~ a site provided by Bob Cozzi

    google ~ CGIDEV2

    Scott Klements library includes a parse called EXPAT which can easily parse the XML. The first two tools are used to consume webservices; but it sound like you may need to provide the webservice on the AS/400 side. If true, it's a bit more work than simply using one of the first two sites offerings but certainly "doable"

    Another good site for research is from Aaron Bartell:

    Comment


    • #3
      Re: Webservice XML

      Hello

      I create webservices in RPG all the time. Websphere comes with a tool called IBM Web Administration for i, which uses Apache Tomcat Server. If you can get it set up, creating a webservice in RPG is easy.

      The tricky part is to get your parameters to match the XML nodes in your SOAP envelopes.

      Comment


      • #4
        Re: Webservice XML

        Thanks Flodge/dhuesman for your input. One more things to know
        This is received as xml message so, how is the using Java/Servlet for achieve this?

        Anyone else ever come across something similar?

        Thanks
        dhanuxp
        Last edited by dhanuxp; February 20, 2009, 05:51 AM.

        Comment


        • #5
          Re: Webservice XML

          I've never parsed xml with java, but I'm 100% sure that it has been done and that there would be examples out there on the interwebz. Servlets are great for this sort of thing, in fact it is what I would recommend that you use. You are still going to need the Apache Tomcat Server but that isn't too bad to set up. And its pretty easy to work in once you learn your way around.

          This is straight from the horses mouth on Java and XML parsing.

          Take a look.
          Your future President
          Bryce

          ---------------------------------------------
          http://www.bravobryce.com

          Comment


          • #6
            Re: Webservice XML

            I hate to shill for a product, but if you're looking to work with XML and want to keep yourself solidly in the realm of RPG, RPG-XML Suite from www.rpg-xml.com works wonders. This is somewhat redundant, seeing as someone already linked to Aaron Bartell's www.mowyourlawn.com, and he's the lead developer of this product, but I figured it was worth mentioning.

            There's a 30 day full-featured trial version to see if it works for you, and if you're interested in purchasing the product, the company will work up a proof of concept to show how to consume a specific XML document or web service.

            EDIT: Whoops, I didn't look at the post date. Sorry for the inadvertent bump.

            Comment


            • #7
              Re: Webservice XML

              We do this all the time. We have an AS400 apache server setup which passes these requests onto a particular RPG program. The parameters are retrieved using CGIDEV2 and the XML is parsed using expat. http://www.scottklement.com/expat/

              lol I didn't read the EDIT bit. I've just got back off holiday...
              Ben

              Comment


              • #8
                Re: Webservice XML

                Ophs!
                Now, I use Java webservice all the time & it works charm on i5+WAS. !

                Edit :Anyone else use something other than those?

                Dhanuxp

                Comment


                • #9
                  Re: Webservice XML

                  Originally posted by BenThurley View Post
                  We do this all the time. We have an AS400 apache server setup which passes these requests onto a particular RPG program.
                  Just to know, If you need to have more than one wsdlsoap operations/soapAction in your WSDL file,
                  That means, one Service have more than one methods,
                  how can you do this in RPG-Webservice? Do you write separate RPG-WebServices for each an every soap operation?

                  Thanks
                  dhanuxp

                  Comment


                  • #10
                    Re: Webservice XML

                    Originally posted by dhanuxp View Post
                    Edit :Anyone else use something other than those?
                    For what : Creating or Consuming ?
                    Wich version dow you use ? V5R4 or higher ?
                    Patrick

                    Comment


                    • #11
                      Re: Webservice XML

                      Originally posted by K2r400 View Post
                      For what : Creating or Consuming ?
                      Wich version dow you use ? V5R4 or higher ?
                      Yes v5r4.. Im using WAS + Java to create WebService..
                      Interesting to know little about RPG webservice client. Hope to install 5733-XT1 LICPGM to write WSCC client on i5. But I would like to know,
                      If my WSDL file has complexType data object (I'm going pass java beans thru the msg) looks like this..
                      Code:
                      <xs:complexType name="InsuranceInfo">
                                      <xs:sequence>
                                          <xs:element minOccurs="0" name="vehicleNumber" type="xs:string"/>
                                          <xs:element minOccurs="0" name="currentInsuranceType" nillable="true" type="xs:string"/>
                                          <xs:element minOccurs="0" name="insuranceExpiryDate" nillable="true" type="xs:dateTime"/>
                                          <xs:element minOccurs="0" name="insuranceActive" type="xs:boolean"/>
                                          <xs:element minOccurs="0" name="insuranceCompanyCode" type="xs:string"/>
                                      </xs:sequence>
                      </xs:complexType>
                      can it handles such a data object with WSCC client?

                      dhanuxp

                      Comment


                      • #12
                        Re: Webservice XML

                        In V5R4 no need WAS and JAVA to create a web service. You have an Integrated Web Service Server who work very fine : http://www.ibmsystemsmag.com/ibmi/de...s/23351p1.aspx

                        Now to consume a web service from a WDSL file, use the wsdl2ws.sh apache tool to generate C/C++ "stubs" programs. wsdl2ws.sh is part of the V5R4.


                        Now to parse an XML document, use directly XML-INTO or XML-SAX in RPGLE or COBOLLE

                        For resuming, all are in the box, no need any tools to create or consume a web service.

                        In 7.1 XML can stored natively, it's PureXML.
                        Patrick

                        Comment


                        • #13
                          Re: Webservice XML

                          Originally posted by dhanuxp View Post
                          Just to know, If you need to have more than one wsdlsoap operations/soapAction in your WSDL file,
                          That means, one Service have more than one methods,
                          how can you do this in RPG-Webservice? Do you write separate RPG-WebServices for each an every soap operation?

                          Thanks
                          dhanuxp
                          The original post didn't say anything about SOAP. It just said pass an XML document back and forth over an HTTP connection. This is how our simple services work using CGIDEV2 and expat. I'm currently looking at SOAP implementations using Java metro and tomcat on the 400 for when a WSDL may be required.
                          Ben

                          Comment


                          • #14
                            Re: Webservice XML

                            Originally posted by BenThurley View Post
                            The original post didn't say anything about SOAP. It just said pass an XML document back and forth over an HTTP connection.
                            Yes Ben, It start like that and finally end up with soap, that's why i had to go WAS

                            and forget about original post, (it's 1 years old)
                            now I'm thinking about continuing our development on WAS or not, all web base application we can easily migrate to the tomcat or some others... but real problem is migrating webservises running on WAS. (all use soap!!)
                            does IWS support to pass soap message over the network ? NO! right ?

                            Comment


                            • #15
                              Re: Webservice XML

                              Originally posted by dhanuxp View Post
                              does IWS support to pass soap message over the network ? NO! right ?
                              IBM made IWS just to make soap bubbles...
                              Patrick

                              Comment

                              Working...
                              X