edmiRemoteExecuteWebService

 EdmiError  edmiRemoteExecuteWebService    (SdaiServerContext       serverContextId,
                                            SdaiString              serverAddress,
                                            SdaiString              url,           /* XPX , QEX */
                                            SdaiInputStream         inputSoapMsg,
                                            SdaiOptions             options,
                                            SdaiLogDescription      logDescription,
                                            SdaiOutputStream        outputSoapMsg,
                                            SdaiInvocationId       *edmiInvocationId);


Executes a web service operation. It takes input parameters to the operation from the input stream, inputSoapMsg. The returned soap message is returned in output stream, outputSoapMsg. edmiRemoteExecuteWebService 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. Document/literal style is selected by setting the LITERAL_ENCODING option.

 

Arguments


1TypeNameComment
2 SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

3 SdaiString

serverAddress

The same server address as used in the WSDL document for the current web service. This is because that the server address is used name spaces which is controlled by client programs that receives the soap message reply.

4 SdaiString

url

The last part of the url, from "/earlybinding/" to the end, used by the web service client. The rest of the string is used as input parameters. An optional field after "/earlybinding/" is a field for options. It consists of the string "options_" + the numeric value for the options. This field is ignored by this function. Options need to be supplied by the option parameter. The url field after "/earlybinding/" or "options_" must be repository name of the EDMdatabase model opened by the web service operation. The next field is the model name. After model name, method type must be specified. The implemented method types are "QEX" and "XPX". The last element of the URL string is method (query) schema name.

5 SdaiInputStream

inputSoapMsg

Input stream from where the EDMserver will read the soap message from the client program. inputSoapMsg is a struct of type SdaiInputStream where the first element is the address of the actual stream reader routine and the second element is a context parameter which is used as the first parameter when the above mentioned stream reader routine is called. See the example below.

6SdaiOptions
options
see below
7
SdaiLogDescription      
logDescription
 
8SdaiOutputStream

outputSoapMsg

Output stream to which the EDMserver will write the soap message reply. outputSoapMsg is a struct of type SdaiOutputStream where the first element is the address of the actual stream write routine and the second element is a context parameter which is used as the first parameter when the above mentioned stream writer routine is called. See the example below.

9 SdaiInvocationId

edmiInvocationId

Currently not used.

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.

 

Options


  

OptionComment
LITERAL_ENCODINGUse this option if the input soap message is encoded in document/literal style. The returned soap message will be encoded in document/literal style.

 

Example


 

 /* Context parameter for stream read / write. */
 typedef struct _tFileStreamContext
 {
 FILE *fp; 
 } tFileStreamContext;
  
 long inputFileReader(SdaiStreamContext sc,
 char *buffer, 
 int bufferSize) 
 {
 FILE stream = ((tFileStreamContext)sc)->fp; 
  
 return fread(buffer, 1, bufferSize, stream); 
 }
 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; 
 }
  
 void executSoapMessageInFile()
 {
 tSdaiInputStream inputSoapMsg; 
 tSdaiOutputStream outputSoapMsg; 
 tFileStreamContext inContext, outContext; 
 char urlBuf[500]; 
  
  
  
 inContext.fp = fopen("c:
soapMessage.xml", "rb"); 
 inputSoapMsg.read = &inputFileReader; 
 inputSoapMsg.context = (SdaiStreamContext)&inContext; 
  
 outContext.fp = fopen("c:
soapResponse.xml", "wb"); 
 outputSoapMsg.write = &outputFileWriter; 
 outputSoapMsg.context = (SdaiStreamContext)&outContext; 
  
 sprintf(urlBuf, "earlybinding/%s/%s/QEX/%s", "DataRepository", 
 "gurumod", "gurumod_ws"); 
 rstat = edmiRemoteExecuteWebService( 
 serverContextId, 
 "http://asus-oli", 
 urlBuf, 
 &inputSoapMsg, 
 remoteWebServiceOptions, 
 &outputSoapMsg, 
 NULL); 
 if (rstat) { 
 /* handle the error */ 
 } 
 fclose(inContext.fp); 
 fclose(outContext.fp);  
 }. . . 

 

See also

Filter by label

There are no items with the selected labels at this time.

Â