Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


 
Generates a Web Service Definition Language (WSDL) document for the specified method schema. In the current version (oct. 2007), it is only query schemas that can be specified. I.e. it is only QEX that is the only legal method type. The generated WSDL document contains a method signature for every function in the method schema. In WSDL terminology the query schema becomes a web service and the functions in the schema becomes operations. Below is an example of the service definition part of a WSDL document:
 
<wsdl:service name="ifd_wsdl_expressService">
<wsdl:port binding="impl:EDMWSSoapBinding" name="EDMWS"> 
<wsdlsoap:address location="http://localhost/EDMWS/earlybinding/DataRepository/IFD/QEX/ifd_wsdl_express"/> 
</wsdl:port> 
</wsdl:service>
 
In this example edmiRemoteGetWSDL is called with repositoryName = "DataRepository", modelName = "IFD", methodType = "QEX", methodSchemaName = "ifd_wsdl_express" and serverAddress = "http://localhost". One can observe that the name of the web service becomes method name + "Service" and repository and model is a part of the URL in the location attribute of the wsdlsoap:address tag. This URL should web service clients use when connecting to this web service. Which data model in the EDM database an operation defined here shall act upon is defined by the two sub strings following "EDMWS/earlybinding".
In addition to define the operations of the web service, all the data structures needed for input parameters and the return values are defined by XML Schema definitions.
EDMwebServices support both rpc/encoded and document/literal style. The main difference between rpc/encoded and document/literal style is that rpc/encoded style support multiple reference to instances while document/literal does not.
Related functions: edmiRemoteExecuteWebService, edmiRemoteExecuteWebServiceEx
 
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteGetWSDL(SdaiServerContext serverContextId,
                             SdaiString        repositoryName, 
                             SdaiString        modelName, 
                             SdaiString        methodType, 
                             SdaiString        schemaName, 
                             SdaiString        methodSchemaName, 
                             SdaiString        serverAddress, 
                             SdaiOptions       options 
                             SdaiOutputStream  wsdlDocument, 
                             SdaiInvocationId  *edmiInvocationId); 
 
 
Arguments:

serverContextId

Context identification, from edmiDefineServerContext

repositoryName

Specifies the name of the data repository in the EDMdatabase that holds the model that the web service operation acts upon. Repository names are case sensitive.

modelName

Specifies the name of the model in the specified repository that the web service operation acts upon. Model names are case sensitive.

methodType

Specifies which method schema type to generate WSDL for. In the current version (oct. 2007), it is only possible to generate WSDL for query schemata.

schemaName

Express schema for which the specified query schema is belonging to. If schema name is not specified, the underlying schema of the specified EDMdatabase model is used.

methodSchemaName

Name of the query schema to generate WSDL document for.

serverAddress

Address of the web server where edmiRemoteGetWSDL is executed. The server address is used in both name spaces and in the web service location URL.

wsdlDocument

SdaiOutputStream where the WSDL document is returned. See the example below to understand how to use a SdaiOutputStream.

edmiInvocationId

Currently not used.

Options: Descriptions:

LITERAL_ENCODING

Use this option to select literal encoding style.

Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an _EDMinterface_ error code. Use edmiGetErrorText to get the error text corresponding to the error code.
Example:
 
/* Context parameter for stream read / write. */
typedef struct _tFileStreamContext
{
FILE *fp; 
} tFileStreamContext;
 
 
long outputFileWriter(SdaiStreamContext sc,
char *buffer, 
int nBytes) 
{
int nWritten; 
FILE stream = ((tFileStreamContext)sc)->fp; 
 
if (stream) { 
if (nBytes <= 0) nBytes = strlen(buffer); 
nWritten = fwrite(buffer, 1, nBytes, stream); 

return (nWritten == nBytes) ? OK : -1; 
}
 
tSdaiOutputStream wsdlDocument;
tFileStreamContext outContext;
 
/* open the wsdl document file */
outContext.fp = fopen("ifd.wsdl", "wb");
/* Initiate the stream write descriptor wsdlDocument */
wsdlDocument.write = &outputFileWriter;
wsdlDocument.context = (SdaiStreamContext)&outContext;
 
rstat = edmiRemoteGetWSDL(serverContextId
"DataRepository", 
"IFD", 
"QEX", 
"", 
"ifd_wsdl_express", 
"http://localhost", 
0, 
&wsdlDocument, 
NULL); 
if (rstat) {
/* handle the error */ 
}
fclose(outContext.fp);
. . .

  • No labels