Getting Doors data via web service

Hi All,

 

I want to get doors data via web service developed in C#. This web service will be deployed on IIS. I referred document in the attachment to develop a web service.

As given in the document everything works fine but for connection with doors and getting doors data I am getting error as below

Request Error

The server encountered an error processing the request. The exception message is 'Access denied: DOORS session is not authenticated'. See server logs for more details. The exception stack trace is:

at DOORSCOMLib.DOORSClass.runStr(String dxlFragment) at MyNameSpace.MyClass.Echo() at SyncInvokeEcho(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

 

Following are the steps I have done to connect to doors.

I developed a web service as per steps given in the document.

To connect to doors and get data from doors in the string format I used below code in the Echo method.

 public string Echo()
 {
   
     IDoorsDXL doors = Activator.CreateInstance(typeof(DOORSCOMLib.DOORSClass)) as IDoorsDXL;
     doors.runFile("F://Doors Material/DXL_Scripts/PrintAllRequirementsOfModule.dxl");
     string ss = doors.result;
     return ss;

}

 

When I run the application normally(without publishing web site) as 

Right click on Rest1.svc file and click View in Browser then I can see required output.

But when I try to get data via web service I am getting error as mentioned above.

I referred below links to get idea how to connect to doors and get data from doors

https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014458173&ps=50&tags=&query=&filter=&sortBy=&order=asc#repliesPg=0

https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014879461#repliesPg=0

 

Please guide me on possible ways to resolve the problem or any pointers/guidelines to do the task if there are other ways to do it.

 

Thanks in advance

Dastan Ali


DastanAli - Thu Aug 04 05:15:19 EDT 2016

Re: Getting Doors data via web service
Mathias Mamsch - Thu Aug 04 07:44:52 EDT 2016

Can you describe for what you are going to use the webservice and what it should do? This can have lots of implications on the architecture. Also please answer the following questions: 

- Do you want to use a special account for authenticating with DOORS (DXL scripts are executed with the same user always) or should each request be executed in a different user context?

- Do you plan concurrent requests (more than one request at the same time)?

- Do you plan to use the webservice for interactive web applications (where the user triggers and action and gets a response with DOORS Data -> low latency required) or just for data gathering from other applications (latency not so important)?

Regards, Mathias

Re: Getting Doors data via web service
DastanAli - Thu Aug 04 08:49:48 EDT 2016

Mathias Mamsch - Thu Aug 04 07:44:52 EDT 2016

Can you describe for what you are going to use the webservice and what it should do? This can have lots of implications on the architecture. Also please answer the following questions: 

- Do you want to use a special account for authenticating with DOORS (DXL scripts are executed with the same user always) or should each request be executed in a different user context?

- Do you plan concurrent requests (more than one request at the same time)?

- Do you plan to use the webservice for interactive web applications (where the user triggers and action and gets a response with DOORS Data -> low latency required) or just for data gathering from other applications (latency not so important)?

Regards, Mathias

Hi Mathias,

I am using web service to get Doors requirement data and Doors test case data in the XML format. It should fetch doors data.

 - Do you want to use a special account for authenticating with DOORS (DXL scripts are executed with the same user always) or should each request be executed in a different user context?

We want to use user's doors credentials for authenticating with DOORS. Each request will not be executed in different user context.

- Do you plan concurrent requests (more than one request at the same time)?

Multiple users can use web service simultaneously.

- Do you plan to use the webservice for interactive web applications (where the user triggers and action and gets a response with DOORS Data -> low latency required) or just for data gathering from other applications (latency not so important)?

Yes we are planning to use the webservice for interactive web application where user triggers an action and gets a response with Doors data. It is a one way flow, user will only get doors data. He/She will not update or delete doors data via web service. We only want to get data from doors

Re: Getting Doors data via web service
Mathias Mamsch - Thu Aug 04 15:46:13 EDT 2016

DastanAli - Thu Aug 04 08:49:48 EDT 2016

Hi Mathias,

I am using web service to get Doors requirement data and Doors test case data in the XML format. It should fetch doors data.

 - Do you want to use a special account for authenticating with DOORS (DXL scripts are executed with the same user always) or should each request be executed in a different user context?

We want to use user's doors credentials for authenticating with DOORS. Each request will not be executed in different user context.

- Do you plan concurrent requests (more than one request at the same time)?

Multiple users can use web service simultaneously.

- Do you plan to use the webservice for interactive web applications (where the user triggers and action and gets a response with DOORS Data -> low latency required) or just for data gathering from other applications (latency not so important)?

Yes we are planning to use the webservice for interactive web application where user triggers an action and gets a response with Doors data. It is a one way flow, user will only get doors data. He/She will not update or delete doors data via web service. We only want to get data from doors

Ok. So if you always read complete modules (i.e. long running requests) and do not do something like browsing (low latency requests), then you should make a DOORS Adapter, that will execute a DXL Script as Batch Job and write the output to a file. So you launch DOORS.exe like this: 

doors.exe -f <temp> -d <port@server> -b <yourscript> -u username -P password -W -logfile <errorlog>

where

temp        = a unique temp directory per request. Necessary so that temp files of one client do not overwrite files of the other
port@server = the port and server you want to connect to
yourscript  = a file with the DXL code to execute
username / password = credentials 
errorlog    = a log file to which fatal errors will be logged. 

For the "yourscript" you create per Request a temp file, where you write DXL like the following: 

Skip requestParams = createString()
put (requestParams, "resultFile", <result file path>")
put (requestParams. <encoded parameter name 1>, <encoded parameter value 1>); 

put (requestParams. <encoded parameter name 2>, <encoded parameter value 2>); 
...
#include <request_script>

In this case request_script is the script that you want to launch. To pass parameters to the script you use the requestParams Skip. Using this you can pass for example a modulename or such. As a special parameter pass also the resultFile where the request script shall write its output. For you example of a module -> xml dump it could look like the following: 

Skip requestParams = createString()
put (requestParams, "resultFile", "C:\\temp\output1248376234234.txt")
put (requestParams. "moduleName", "/Playground/MyModule"); 

#include <"C:/requests/export_module.dxl");

This DXL script you create on the fly from the C# webservice from the request parameters. Then you launch it via the cmdline above from the webservice. Afterwards you check for the existence of the outputfile or the error log file and read the result of the script. So the pseudocode for your DOORS adapter is something like this: 

public class DOORSConnector {
    protected string host; 
    protected string port; 
    protected string user; 
    protected string password; 
    protected string doorsExe;
    
    
    public DOORSConnector(string host, string port, string user, string password, string doorsExe) {
        this.host = host; 
        this.port = port;
        ...
    }
    
    public void writeScript (...) {
        // encode the parameters to DXL, write the temporary batch file
    }
    
    public void launchScript(string scriptFile, string args[]) {
        string tempDir = makeATempDirectory(); 
        string batchFile  = makeATempFile();
        string outputFile = makeATempFile(); 
        string errorlog   = makeATempFile(); 
        
        // create the temp DXL script and write it to the batchFile
        this.writeScript(batchFile, outputFile, scriptFile, args); 
        
        string cmdLine = doorsExe + " -f " + tempDir + ... // build command line
        Process process = this.execute(cmdLine); 
        
        // LaunchResult class reads output from files and evaluates process exit code
        LaunchResult result = new LaunchResult(process, outputFile, errorlog); 

        // cleanup temp files
        this.deleteTempDir(tempDir);
        this.deleteTempFile(batchFile); 
        this.deleteTempFile(outputFile); 
        this.deleteTempFile(errorlog); 

        return result; 
    }
}

Do not forget to do proper encoding of all parameters to avoid shell injection attacks on your script, i.e. never pass a parameter to the executed process unencoded. This DOORS Connector you can use from your webservice requests to launch different DXL scripts. Inside these DXL scripts you can assume, that the requestParams skip exists, which contains your parameters. E.g. a DXL request script can look like: 

string moduleName = null; 
if (!find(requestParams, "moduleName", moduleName)) error "No module Name was passed to the export script!"; 
string outFile = null; 
if (!find(requestParams, "resultFile", outFile)) error "No output file was passed to the export script!"; 
Module mod = read(moduleName, false); 
Stream st = write binary outFile
// ... do your export ... write the results to outFile
close mod
close outFile

This is a straight forward way to implement a DOORS Backend for a web service. If you need low latency requests (without having to start a new DOORS client on each request), then it becomes a bit more complicated. You need to write a DXL server which communicates with your c# program and executes the scripts you send to it using eval. This way you can start the DOORS process once as a batch and keep it running for upcoming requests (with an autoshutdown of a few minutes). 

Hope that gives you a start. Regards, Mathias

 

Re: Getting Doors data via web service
DastanAli - Mon Aug 08 05:04:16 EDT 2016

Mathias Mamsch - Thu Aug 04 15:46:13 EDT 2016

Ok. So if you always read complete modules (i.e. long running requests) and do not do something like browsing (low latency requests), then you should make a DOORS Adapter, that will execute a DXL Script as Batch Job and write the output to a file. So you launch DOORS.exe like this: 

doors.exe -f <temp> -d <port@server> -b <yourscript> -u username -P password -W -logfile <errorlog>

where

temp        = a unique temp directory per request. Necessary so that temp files of one client do not overwrite files of the other
port@server = the port and server you want to connect to
yourscript  = a file with the DXL code to execute
username / password = credentials 
errorlog    = a log file to which fatal errors will be logged. 

For the "yourscript" you create per Request a temp file, where you write DXL like the following: 

Skip requestParams = createString()
put (requestParams, "resultFile", <result file path>")
put (requestParams. <encoded parameter name 1>, <encoded parameter value 1>); 

put (requestParams. <encoded parameter name 2>, <encoded parameter value 2>); 
...
#include <request_script>

In this case request_script is the script that you want to launch. To pass parameters to the script you use the requestParams Skip. Using this you can pass for example a modulename or such. As a special parameter pass also the resultFile where the request script shall write its output. For you example of a module -> xml dump it could look like the following: 

Skip requestParams = createString()
put (requestParams, "resultFile", "C:\\temp\output1248376234234.txt")
put (requestParams. "moduleName", "/Playground/MyModule"); 

#include <"C:/requests/export_module.dxl");

This DXL script you create on the fly from the C# webservice from the request parameters. Then you launch it via the cmdline above from the webservice. Afterwards you check for the existence of the outputfile or the error log file and read the result of the script. So the pseudocode for your DOORS adapter is something like this: 

public class DOORSConnector {
    protected string host; 
    protected string port; 
    protected string user; 
    protected string password; 
    protected string doorsExe;
    
    
    public DOORSConnector(string host, string port, string user, string password, string doorsExe) {
        this.host = host; 
        this.port = port;
        ...
    }
    
    public void writeScript (...) {
        // encode the parameters to DXL, write the temporary batch file
    }
    
    public void launchScript(string scriptFile, string args[]) {
        string tempDir = makeATempDirectory(); 
        string batchFile  = makeATempFile();
        string outputFile = makeATempFile(); 
        string errorlog   = makeATempFile(); 
        
        // create the temp DXL script and write it to the batchFile
        this.writeScript(batchFile, outputFile, scriptFile, args); 
        
        string cmdLine = doorsExe + " -f " + tempDir + ... // build command line
        Process process = this.execute(cmdLine); 
        
        // LaunchResult class reads output from files and evaluates process exit code
        LaunchResult result = new LaunchResult(process, outputFile, errorlog); 

        // cleanup temp files
        this.deleteTempDir(tempDir);
        this.deleteTempFile(batchFile); 
        this.deleteTempFile(outputFile); 
        this.deleteTempFile(errorlog); 

        return result; 
    }
}

Do not forget to do proper encoding of all parameters to avoid shell injection attacks on your script, i.e. never pass a parameter to the executed process unencoded. This DOORS Connector you can use from your webservice requests to launch different DXL scripts. Inside these DXL scripts you can assume, that the requestParams skip exists, which contains your parameters. E.g. a DXL request script can look like: 

string moduleName = null; 
if (!find(requestParams, "moduleName", moduleName)) error "No module Name was passed to the export script!"; 
string outFile = null; 
if (!find(requestParams, "resultFile", outFile)) error "No output file was passed to the export script!"; 
Module mod = read(moduleName, false); 
Stream st = write binary outFile
// ... do your export ... write the results to outFile
close mod
close outFile

This is a straight forward way to implement a DOORS Backend for a web service. If you need low latency requests (without having to start a new DOORS client on each request), then it becomes a bit more complicated. You need to write a DXL server which communicates with your c# program and executes the scripts you send to it using eval. This way you can start the DOORS process once as a batch and keep it running for upcoming requests (with an autoshutdown of a few minutes). 

Hope that gives you a start. Regards, Mathias

 

Hi Mathias,
Thank you for your post. It gave me idea to proceed forward.
Could you please help me on below issue,
I want to connect to doors and execute dxl script
            Process proc = new Process();
            proc.EnableRaisingEvents = false;
            proc.StartInfo.FileName = @"D:\CLM_Installation\DOORS_Client_9.6.1.4\bin\doors.exe";
            proc.StartInfo.Arguments = "-u Administrator -P pass" -f %temp% -d 36677@RTCWAS -b                                F:\\DoorsMaterial\\DXL_Scripts\\PrintAllRequirementsOfModule.dxl;          
            proc.Start();

 

It displays error message as


This is the code of my PrintAllRequirementsOfModule.dxl file

 

Module m = read("RTC_Move-For-Development_Requirements")
Object o

for o in m do
print identifier o "," o."Object Heading" ",\"" o."Object Text" "\"\n"

Re: Getting Doors data via web service
Mike.Scharnow - Mon Aug 08 05:22:32 EDT 2016

DastanAli - Mon Aug 08 05:04:16 EDT 2016

Hi Mathias,
Thank you for your post. It gave me idea to proceed forward.
Could you please help me on below issue,
I want to connect to doors and execute dxl script
            Process proc = new Process();
            proc.EnableRaisingEvents = false;
            proc.StartInfo.FileName = @"D:\CLM_Installation\DOORS_Client_9.6.1.4\bin\doors.exe";
            proc.StartInfo.Arguments = "-u Administrator -P pass" -f %temp% -d 36677@RTCWAS -b                                F:\\DoorsMaterial\\DXL_Scripts\\PrintAllRequirementsOfModule.dxl;          
            proc.Start();

 

It displays error message as


This is the code of my PrintAllRequirementsOfModule.dxl file

 

Module m = read("RTC_Move-For-Development_Requirements")
Object o

for o in m do
print identifier o "," o."Object Heading" ",\"" o."Object Text" "\"\n"

you should get rid of the blank between Doors and Material, otherwise your "-b" parameter ends after F:\\Doors. Or Escape the blank with a \

Regards, Mike

Re: Getting Doors data via web service
DastanAli - Mon Aug 08 05:37:56 EDT 2016

Mike.Scharnow - Mon Aug 08 05:22:32 EDT 2016

you should get rid of the blank between Doors and Material, otherwise your "-b" parameter ends after F:\\Doors. Or Escape the blank with a \

Regards, Mike

Hi Mike,

 

I edited my post. I made changes in last part of post from This is the code of my PrintAllRequirementsOfModule.dxl file   this line.

Also I removed blank space from directory. In the code as well as actual directory.

It is still showing me same error as above.

The code of PrintAllRequirementsOfModule.dxl file runs successfully if I copy and pasted it inside DXL editor window of Doors

Re: Getting Doors data via web service
DastanAli - Mon Aug 08 06:48:02 EDT 2016

DastanAli - Mon Aug 08 05:04:16 EDT 2016

Hi Mathias,
Thank you for your post. It gave me idea to proceed forward.
Could you please help me on below issue,
I want to connect to doors and execute dxl script
            Process proc = new Process();
            proc.EnableRaisingEvents = false;
            proc.StartInfo.FileName = @"D:\CLM_Installation\DOORS_Client_9.6.1.4\bin\doors.exe";
            proc.StartInfo.Arguments = "-u Administrator -P pass" -f %temp% -d 36677@RTCWAS -b                                F:\\DoorsMaterial\\DXL_Scripts\\PrintAllRequirementsOfModule.dxl;          
            proc.Start();

 

It displays error message as


This is the code of my PrintAllRequirementsOfModule.dxl file

 

Module m = read("RTC_Move-For-Development_Requirements")
Object o

for o in m do
print identifier o "," o."Object Heading" ",\"" o."Object Text" "\"\n"

It worked after I added path of module into DXL script. New DXL script is as below

Module m = read("/Automated Meter Reader - sample 1 1/RTC_Move-For-Development_Requirements")
Object o

for o in m do
print identifier o "," o."Object Heading" ",\"" o."Object Text" "\"\n".

 

 

Re: Getting Doors data via web service
DastanAli - Tue Aug 09 03:09:51 EDT 2016

Mathias Mamsch - Thu Aug 04 15:46:13 EDT 2016

Ok. So if you always read complete modules (i.e. long running requests) and do not do something like browsing (low latency requests), then you should make a DOORS Adapter, that will execute a DXL Script as Batch Job and write the output to a file. So you launch DOORS.exe like this: 

doors.exe -f <temp> -d <port@server> -b <yourscript> -u username -P password -W -logfile <errorlog>

where

temp        = a unique temp directory per request. Necessary so that temp files of one client do not overwrite files of the other
port@server = the port and server you want to connect to
yourscript  = a file with the DXL code to execute
username / password = credentials 
errorlog    = a log file to which fatal errors will be logged. 

For the "yourscript" you create per Request a temp file, where you write DXL like the following: 

Skip requestParams = createString()
put (requestParams, "resultFile", <result file path>")
put (requestParams. <encoded parameter name 1>, <encoded parameter value 1>); 

put (requestParams. <encoded parameter name 2>, <encoded parameter value 2>); 
...
#include <request_script>

In this case request_script is the script that you want to launch. To pass parameters to the script you use the requestParams Skip. Using this you can pass for example a modulename or such. As a special parameter pass also the resultFile where the request script shall write its output. For you example of a module -> xml dump it could look like the following: 

Skip requestParams = createString()
put (requestParams, "resultFile", "C:\\temp\output1248376234234.txt")
put (requestParams. "moduleName", "/Playground/MyModule"); 

#include <"C:/requests/export_module.dxl");

This DXL script you create on the fly from the C# webservice from the request parameters. Then you launch it via the cmdline above from the webservice. Afterwards you check for the existence of the outputfile or the error log file and read the result of the script. So the pseudocode for your DOORS adapter is something like this: 

public class DOORSConnector {
    protected string host; 
    protected string port; 
    protected string user; 
    protected string password; 
    protected string doorsExe;
    
    
    public DOORSConnector(string host, string port, string user, string password, string doorsExe) {
        this.host = host; 
        this.port = port;
        ...
    }
    
    public void writeScript (...) {
        // encode the parameters to DXL, write the temporary batch file
    }
    
    public void launchScript(string scriptFile, string args[]) {
        string tempDir = makeATempDirectory(); 
        string batchFile  = makeATempFile();
        string outputFile = makeATempFile(); 
        string errorlog   = makeATempFile(); 
        
        // create the temp DXL script and write it to the batchFile
        this.writeScript(batchFile, outputFile, scriptFile, args); 
        
        string cmdLine = doorsExe + " -f " + tempDir + ... // build command line
        Process process = this.execute(cmdLine); 
        
        // LaunchResult class reads output from files and evaluates process exit code
        LaunchResult result = new LaunchResult(process, outputFile, errorlog); 

        // cleanup temp files
        this.deleteTempDir(tempDir);
        this.deleteTempFile(batchFile); 
        this.deleteTempFile(outputFile); 
        this.deleteTempFile(errorlog); 

        return result; 
    }
}

Do not forget to do proper encoding of all parameters to avoid shell injection attacks on your script, i.e. never pass a parameter to the executed process unencoded. This DOORS Connector you can use from your webservice requests to launch different DXL scripts. Inside these DXL scripts you can assume, that the requestParams skip exists, which contains your parameters. E.g. a DXL request script can look like: 

string moduleName = null; 
if (!find(requestParams, "moduleName", moduleName)) error "No module Name was passed to the export script!"; 
string outFile = null; 
if (!find(requestParams, "resultFile", outFile)) error "No output file was passed to the export script!"; 
Module mod = read(moduleName, false); 
Stream st = write binary outFile
// ... do your export ... write the results to outFile
close mod
close outFile

This is a straight forward way to implement a DOORS Backend for a web service. If you need low latency requests (without having to start a new DOORS client on each request), then it becomes a bit more complicated. You need to write a DXL server which communicates with your c# program and executes the scripts you send to it using eval. This way you can start the DOORS process once as a batch and keep it running for upcoming requests (with an autoshutdown of a few minutes). 

Hope that gives you a start. Regards, Mathias

 

Hi everyone,

I am connecting to Doors using batch mode via webservice developed in C#

Below is the code which connects to Doors and executes DXL file. This DXL file generates XML file of module.

           Process proc = new Process();
           proc.EnableRaisingEvents = false;
           proc.StartInfo.FileName = @"D:\CLM_Installation\DOORS_Client_9.6.1.4\bin\doors.exe";
           proc.StartInfo.Arguments = "-u Administrator -P Password -f %temp% -d 36677@RTCWAS -b F:\\DoorsMaterial\\DXL_Scripts\\Copy.dxl ";
            proc.Start();

 

Copy.dxl file has DXL script to generate XML file of module.

 

If I run the application normally(without publishing web site) as
Right click on Rest1.svc file and click View in Browser then I can see console window displaying message as XML file generated at %temp% directory and XML file is generated at %temp% directory.

But when I publish web site and deploy it on IIS(generate a web service) and try to do above operation via web service, it only runs DOORS process in the background and process is finished after some time. It does not generate XML file of module at %temp% directory.

 

Could anyone please help me on the issue

Thanks in advance 

Dastan Ali

 

 

Re: Getting Doors data via web service
Mathias Mamsch - Wed Aug 10 17:16:41 EDT 2016

DastanAli - Tue Aug 09 03:09:51 EDT 2016

Hi everyone,

I am connecting to Doors using batch mode via webservice developed in C#

Below is the code which connects to Doors and executes DXL file. This DXL file generates XML file of module.

           Process proc = new Process();
           proc.EnableRaisingEvents = false;
           proc.StartInfo.FileName = @"D:\CLM_Installation\DOORS_Client_9.6.1.4\bin\doors.exe";
           proc.StartInfo.Arguments = "-u Administrator -P Password -f %temp% -d 36677@RTCWAS -b F:\\DoorsMaterial\\DXL_Scripts\\Copy.dxl ";
            proc.Start();

 

Copy.dxl file has DXL script to generate XML file of module.

 

If I run the application normally(without publishing web site) as
Right click on Rest1.svc file and click View in Browser then I can see console window displaying message as XML file generated at %temp% directory and XML file is generated at %temp% directory.

But when I publish web site and deploy it on IIS(generate a web service) and try to do above operation via web service, it only runs DOORS process in the background and process is finished after some time. It does not generate XML file of module at %temp% directory.

 

Could anyone please help me on the issue

Thanks in advance 

Dastan Ali

 

 

Running any program from a service is like a whole new world, where you cannot look (easily) inside. hundrets of things tend to go wrong most notable:

  • The service user has no access to the
    • drives,
    • directories,
    • network shares
    • installed software
      that your user has access to.
  • The service users environment is different from yours, most notably path settings, environment variables, registry settings. And somehow your program depends on it.

Looking at your post I see a drive "F" and a %TEMP% directory, which could be user specific. You need to use the errorlog and nowait parameters and redirect the output from the DOORS interpreter to see an actual error message. Everything else will be pure guessing.

Regards, Mathias

Re: Getting Doors data via web service
DastanAli - Thu Aug 11 05:04:51 EDT 2016

Mathias Mamsch - Wed Aug 10 17:16:41 EDT 2016

Running any program from a service is like a whole new world, where you cannot look (easily) inside. hundrets of things tend to go wrong most notable:

  • The service user has no access to the
    • drives,
    • directories,
    • network shares
    • installed software
      that your user has access to.
  • The service users environment is different from yours, most notably path settings, environment variables, registry settings. And somehow your program depends on it.

Looking at your post I see a drive "F" and a %TEMP% directory, which could be user specific. You need to use the errorlog and nowait parameters and redirect the output from the DOORS interpreter to see an actual error message. Everything else will be pure guessing.

Regards, Mathias

Hi Mathias,

Currently everything is located at my personal system.

I installed IIS on my system and accessing web service. When I call for web service I can see door.exe processes in the process tab of windows task manager but in the user name column it is not called from system user instead it shows ASP.NET V4.0. I guess this might be one of the cause.

 

Re: Getting Doors data via web service
DastanAli - Sat Aug 20 02:49:13 EDT 2016

DastanAli - Thu Aug 11 05:04:51 EDT 2016

Hi Mathias,

Currently everything is located at my personal system.

I installed IIS on my system and accessing web service. When I call for web service I can see door.exe processes in the process tab of windows task manager but in the user name column it is not called from system user instead it shows ASP.NET V4.0. I guess this might be one of the cause.

 

Hi All,

As Mathias mentioned in his above post, connecting to doors via web service is entirely different thing. 

As mentioned by me in my previous post, in my case it was problem of user who is calling web service.

Below solution worked for me,

1. Open IIS Manager 

2. Add application pool

    a. Provide Name for application pool

    b. In the .Net Framework Version option select .Net Framework v4.0.30319

    c. Keep other fields as it is.

3. One Application pool is added you can see it in the list of Application Pools, right click on your application Pool and select Advance Setting

    a. Go to Process Model section

    b. Click on Identity

    c. In the wizard that opens, select Custom Account and click on set

    d. Set your username and password as HostName(PC Name)\UserId and password

4. Select website that you added into IIS Manager and click on basic settings. In the Application Pool section select Application Pool that you just created.

5. Try to run web service, It should work.

 

Re: Getting Doors data via web service
DastanAli - Sat Aug 20 03:00:37 EDT 2016

Hi All, 

I need your help for below issue,

I have configured a web service. I can connect to doors via web service and export XML file of modules. Currently I hard-coded userId and Password to connect to Doors as

proc.StartInfo.Arguments = "-u Administrator -P pass" -f %temp% -d 36677@RTCWAS -b                                F:\\DoorsMaterial\\DXL_Scripts\\PrintAllRequirementsOfModule.dxl;

I want to have separate config file where user will specify Doors UserId, Password and other fields related to doors module such as baseline number, and other attributes.

Web service will read this file and generate XML accordingly.

Please guide me on how to achieve this. Also where this external file will be located.

 

Thanks in advance

Dastan Ali

Re: Getting Doors data via web service
Mathias Mamsch - Sat Aug 20 05:32:07 EDT 2016

DastanAli - Sat Aug 20 03:00:37 EDT 2016

Hi All, 

I need your help for below issue,

I have configured a web service. I can connect to doors via web service and export XML file of modules. Currently I hard-coded userId and Password to connect to Doors as

proc.StartInfo.Arguments = "-u Administrator -P pass" -f %temp% -d 36677@RTCWAS -b                                F:\\DoorsMaterial\\DXL_Scripts\\PrintAllRequirementsOfModule.dxl;

I want to have separate config file where user will specify Doors UserId, Password and other fields related to doors module such as baseline number, and other attributes.

Web service will read this file and generate XML accordingly.

Please guide me on how to achieve this. Also where this external file will be located.

 

Thanks in advance

Dastan Ali

1. First of all do not use environment variables like %temp% inside the proc.StartInfo.Arguments. Instead like I told you create a temp directory and put it inside the Arguments string and delete it after the process terminates.

2. Regarding your other post: Don't be too happy now. While changing the username of your service might work for you now, It might break, when you deploy on a server. The difference is, that you probably have a user session open (i.e. the user that the service starts with is logged onto the machine). On a server that will not be the case, and again you might run into trouble. So you really should implement a logging of the error messages of DOORS correctly.

3. You need to pass the module name to the DXL. You can do this from a file or generate a temp DXL where you hardcode it as a variable (would be my preference) like I told you above. You can use a config file to store these things, but this will not relieve you from passing the data over the commandline. How to do this in C# is not really a topic for this forum.

Regards, Mathias

 

Re: Getting Doors data via web service
DastanAli - Tue Aug 23 01:36:58 EDT 2016

Mathias Mamsch - Sat Aug 20 05:32:07 EDT 2016

1. First of all do not use environment variables like %temp% inside the proc.StartInfo.Arguments. Instead like I told you create a temp directory and put it inside the Arguments string and delete it after the process terminates.

2. Regarding your other post: Don't be too happy now. While changing the username of your service might work for you now, It might break, when you deploy on a server. The difference is, that you probably have a user session open (i.e. the user that the service starts with is logged onto the machine). On a server that will not be the case, and again you might run into trouble. So you really should implement a logging of the error messages of DOORS correctly.

3. You need to pass the module name to the DXL. You can do this from a file or generate a temp DXL where you hardcode it as a variable (would be my preference) like I told you above. You can use a config file to store these things, but this will not relieve you from passing the data over the commandline. How to do this in C# is not really a topic for this forum.

Regards, Mathias

 

Hi Mathias,

As you mentioned, solution I suggested is temporary.

I was searching for how to generate log file. I wanted to know if log file is directly generated by the command or we have to put appropriate code into DXL script.

Could you please provide simple working example so that I can get clear idea.

 

Thanks in advance

Dastan Ali

Re: Getting Doors data via web service
Mathias Mamsch - Tue Aug 23 03:50:54 EDT 2016

DastanAli - Tue Aug 23 01:36:58 EDT 2016

Hi Mathias,

As you mentioned, solution I suggested is temporary.

I was searching for how to generate log file. I wanted to know if log file is directly generated by the command or we have to put appropriate code into DXL script.

Could you please provide simple working example so that I can get clear idea.

 

Thanks in advance

Dastan Ali

You need to carefully read the advice you already have, try to implement it and come up with specific questions. I will not chime in and do the work for you. Regards, Mathias

Re: Getting Doors data via web service
DastanAli - Wed Aug 24 01:18:54 EDT 2016

Mathias Mamsch - Tue Aug 23 03:50:54 EDT 2016

You need to carefully read the advice you already have, try to implement it and come up with specific questions. I will not chime in and do the work for you. Regards, Mathias

Hi Mathias,

I am sorry if my question mislead into anything.

By simple working example means I wanted to say how can I form below string properly

proc.StartInfo.Arguments = "-u " + userId + " -P " + password + " -f D:\\tempdata -d 36677@RTCWAS -b " + dxlFullPath + " -W logfile D:\\ASPUser\\textlog.log";

-W is command to generate log file to catch any fatal errors. but above command is not working for me. I wanted to know how to generate logs to catch errors.

 

Thanks in advance

Dastan Ali

Re: Getting Doors data via web service
Mathias Mamsch - Wed Aug 24 06:13:07 EDT 2016

DastanAli - Wed Aug 24 01:18:54 EDT 2016

Hi Mathias,

I am sorry if my question mislead into anything.

By simple working example means I wanted to say how can I form below string properly

proc.StartInfo.Arguments = "-u " + userId + " -P " + password + " -f D:\\tempdata -d 36677@RTCWAS -b " + dxlFullPath + " -W logfile D:\\ASPUser\\textlog.log";

-W is command to generate log file to catch any fatal errors. but above command is not working for me. I wanted to know how to generate logs to catch errors.

 

Thanks in advance

Dastan Ali

You mixed up the parameters. The -W (or -nowait) command is for telling DOORS not to wait for a keypress after the batch ends with output, but to directly quit. The -logfile is a separate parameter.

You need to worry about the following things: 

- DOORS internal error (e.g. no license could be aquired). Make sure you set the FLEX LM Batch parameter to avoid FlexLM License popups. 

- DOORS Fatal Error (your DXL Crashed the DOORS Process). In this case you might not get any indication of an error, just that the process ended. If you are lucky you get a crashdump in the error logfile (-logfile). 

- DXL Syntax error: If you dynamically create DXL code its always possible that your DXL does not translate correctly. The DXL will not start. An error will go to the logfile.

- DXL Runtime error: Somewhere in your DXL an error occurred which ended the DXL. An DXL Traceback should go to the logfile. 

So you got three sources of information: 

- The standard output (stdout and stderr) from DOORS Process. Not sure if they receive output from the DXL but check them. 

- the error log file that you passed as a parameter

- the exit code of the DOORS batch process

After the DOORS batch process ends, you need to check for the expected output. If the output is not there (e.g. result file), obviously an error occurred. In this case I would take the exit code of the process, the stdout/stderr of the DOORS process and the contents of the error log file that DOORS wrote and put it to an error message that you present to the user over the webservice (e.g. HTTP Code 500 with html output and the content of the files). This way, you will always know what happened on your DOORS Service. 

Of course if you use the Webservice from the browser through Ajax or from another C# component you need to catch the HTTP error response and display the error accordingly. 

Regards, Mathias

Edit: Of course you need to handle errors inside your DXL also somehow. That is you need to establish a way to report errors, either by throwing a DXL error (should wind up in the logs) or writing an error to your result file. (which your webservice again needs to translate).