Consume a session-managed Web service
- Last Updated: April 24, 2023
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
To access a session-managed Web service, you maintain connection context by passing object IDs associated with each request.
To begin using a session-managed Web service:
- Instantiate (create) the AppObject as appropriate for the client platform.
- Connect to an AppServer by calling the connect method on the AppObject before calling any other Web Service (AppObject) method.
- Obtain the AppObject ID value from the SOAP response header for the connect method and use it for all subsequent calls to methods on the session-managed AppObject.
- Invoke any available methods on the AppObject, as required.
- Ensure that the last method you invoke on the AppObject is the object's release method. For more information, see Release an object.
As with other Open Clients, there is no ABL involved in implementing the connect method on an AppObject. For Web services, however, the operation is an object method that is required by the WSA.
This is a VB.NET declaration for an AppObject connect method,
Connect_OrderInfo( ):
VB.NET prototype for an AppObject Connect_Object method
|
When the client executes the connect method, the SOAP response message contains a SOAP header with the AppObject ID. You must send this AppObject ID in the SOAP header of the request message for every subsequent method call on the AppObject. How you handle the SOAP header and AppObject ID depends on your client type. For some clients, such as .NET, this process is automated. For other clients, such as ABL and Java, you need to create the code to handle this yourself. For more information on handling SOAP headers and object IDs, see Handling SOAP Message Headers in ABL and Develop a Java Client to Consume OpenEdge SOAP Web Services.
This is a sample instantiation and invocation of the connect method on the
OrderInfo AppObject:
|
This is a sample Doc/Lit SOAP request message that might be generated from
invoking the Connect_OrderInfo( ) method, as in the
example:
|
Note the data for the request highlighted in the example for parameters passed as empty strings.
This is a sample Doc/Lit SOAP response that might be generated by the WSA
as a response to the Connect_OrderInfo( ) method:
|
Note the value for the returned AppObject ID, OrderInfo, highlighted in the example. Thus, the SOAP response header returns
the following AppObject ID contained in the OrderInfoID
element:
|