Web Service Basics: Difference between revisions

m
Changed the color:blue to color:midnightblue
(Web Service Client stuff)
m (Changed the color:blue to color:midnightblue)
Line 2: Line 2:


===Creating a WebApp Project===
===Creating a WebApp Project===
In the [[Visual DataFlex Studio]], select <span style="color:blue; font-weight:bold">File => New => Project => Web Project</span> and follow the wizard's instructions.
In the [[Visual DataFlex Studio]], select <span style="color:midnightblue; font-weight:bold">File => New => Project => Web Project</span> and follow the wizard's instructions.
----
----


===Creating a Web Service Object===
===Creating a Web Service Object===
In the [[Visual DataFlex Studio]], select <span style="color:blue; font-weight:bold">File => New => Web Object => Web Service Object</span> and follow the wizard's instructions.
In the [[Visual DataFlex Studio]], select <span style="color:midnightblue; font-weight:bold">File => New => Web Object => Web Service Object</span> and follow the wizard's instructions.


The '''psDocumentation''' property will be automatically set to some default text, but you should replace this with a description of your own service, as this will appear in the [[WSDL]] <nowiki><documentation></nowiki> element describing the service.  There are several other properties which it now a good idea to set:
The '''psDocumentation''' property will be automatically set to some default text, but you should replace this with a description of your own service, as this will appear in the [[WSDL]] <nowiki><documentation></nowiki> element describing the service.  There are several other properties which it now a good idea to set:
Line 67: Line 67:
In the [[Code Explorer]] pane of the [[Visual DataFlex Studio]], right-click on the method (Function or Procedure) and select "'''Published'''" from the context menu.  This will cause (a) the "Published" context-menu item to subsequently appear "checked", (b) a globe to appear next to the method's icon in Code Explorer and (c) the two lines:
In the [[Code Explorer]] pane of the [[Visual DataFlex Studio]], right-click on the method (Function or Procedure) and select "'''Published'''" from the context menu.  This will cause (a) the "Published" context-menu item to subsequently appear "checked", (b) a globe to appear next to the method's icon in Code Explorer and (c) the two lines:


  <span style="color:blue;">{ Published = True  }
  <span style="color:midnightblue;">{ Published = True  }
  { Description = ""  }</span>
  { Description = ""  }</span>
  <span style="color:gray;">Function GoodsOrder PurchaseOrder Ord Returns OrderResponse</span>
  <span style="color:gray;">Function GoodsOrder PurchaseOrder Ord Returns OrderResponse</span>
Line 75: Line 75:


===Creating a Web Service Client===
===Creating a Web Service Client===
In order to create a [[Visual DataFlex]] web service client you must have access to the service's [[WSDL]] in some form.  This might be directly from the service itself - in [http://msdn2.microsoft.com/en-gb/webservices/default.aspx Microsoft .Net] or Visual DataFlex services this is the service's URL with "WSDL" appended as a [http://en.wikipedia.org/wiki/Query_string query string]: something like <span style="color:blue;"><nowiki>http://server/someService/service.wso?WSDL</nowiki></span> - or it might be an XML file provided by the service's developer or publisher which you have saved to a locally acessible file: <span style="color:blue;">C:\Services\Docs\someServiceWSDL.xml</span> - or it might be an XML/WSDL file statically published on a web site: <span style="color:blue;"><nowiki>http://server/services/wsdl/someService.xml</nowiki></span>.
In order to create a [[Visual DataFlex]] web service client you must have access to the service's [[WSDL]] in some form.  This might be directly from the service itself - in [http://msdn2.microsoft.com/en-gb/webservices/default.aspx Microsoft .Net] or Visual DataFlex services this is the service's URL with "WSDL" appended as a [http://en.wikipedia.org/wiki/Query_string query string]: something like <span style="color:midnightblue;"><nowiki>http://server/someService/service.wso?WSDL</nowiki></span> - or it might be an XML file provided by the service's developer or publisher which you have saved to a locally acessible file: <span style="color:midnightblue;">C:\Services\Docs\someServiceWSDL.xml</span> - or it might be an XML/WSDL file statically published on a web site: <span style="color:midnightblue;"><nowiki>http://server/services/wsdl/someService.xml</nowiki></span>.


In the [[Visual DataFlex Studio]], select <span style="color:blue; font-weight:bold">File => New => Class => Client Web Service Class</span>.  This will run the Web Service Client Class Generator.  Into its "WSDL URL" window paste (or type) the location (of whatever type) of the service's WSDL, then click the "Parse" button.  If this succeeds, then the "Generate Class" button will become available and can be clicked to create the client.  You should generally accept the default name and group.
In the [[Visual DataFlex Studio]], select <span style="color:midnightblue; font-weight:bold">File => New => Class => Client Web Service Class</span>.  This will run the Web Service Client Class Generator.  Into its "WSDL URL" window paste (or type) the location (of whatever type) of the service's WSDL, then click the "Parse" button.  If this succeeds, then the "Generate Class" button will become available and can be clicked to create the client.  You should generally accept the default name and group.


====Using a Web Service Client Class====
====Using a Web Service Client Class====