Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
maryjohnson

Member
Registered:
Posts: 19
Reply with quote  #1 
I need help getting the web service to communicate with Metastorm login:

1 - Published a simple Map Process, logged on to the Metastorm web client as user: webservice, password: process to the Devengine service (also worked with the DevDCOM service).
2 - Used Process Activator to create the web service for the Blank Form (Initiate Request)
3 - web service has 8 methods:
BlankFormsInitiateRequest
LoggedIn
Login
Logout
ServiceNames
SetServiceName
StartBlankFormsInitiateRequest
SubmitBlankFormsInitiateRequest

4 - wrote a simple .NET web app:
try
{
  WebReference.EmployeeLeaveRequestService wr = new WebReference.EmployeeLeaveRequestService();
  wr.SessionIdSoapHeaderValue = new WebReference.SessionIdSoapHeader();
  wr.PreAuthenticate = true;
  wr.Credentials = System.Net.CredentialCache.DefaultCredentials;
  wr.SetServiceName("Devengine");
  wr.Login("webservice", "process");
}5 - The first time through, the error for Login is:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Metastorm.ECL.TPObjects.ExceptionType
Source: ERequestBroker
Type: ERequestBroker
Value: No Engines are available in the "Devengine" service.
      The second time through, the error for Login is:
System.Web.Services.Protocols.SoapException was caught
  Message="System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.Remoting.RemotingException: Cannot create channel sink to connect to URL ''. An appropriate channel has probably not been registered.\n   at System.Runtime.Remoting.RemotingServices.Unmarshal(Type classToProxy, String url, Object data)\n   at System.Activator.GetObject(Type type, String url, Object state)\n   at Metastorm.ECL.RequestBroker.ERequestBroker.EngineInstance()\n   at Metastorm.ECL.RequestBroker.ERequestBroker.SimpleLogin(CultureInfo culture, String clientData, String userName, String password, eErrorResponse& error)\n   at Metastorm.ECL.ESession.Login(String userNameValue, String passwordValue)\n   at Metastorm.ProcessActivator.WebServices.EmployeeLeaveRequestService.Login(String userName, String password) in c:\\Inetpub\\wwwroot\\Employee Leave Request\\App_Code\\Service.cs:line 70\n   --- End of inner exception stack trace ---"
  Source="System.Web.Services"
  Actor=""
  Lang=""
  Node=""
  Role=""
  StackTrace:
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at WebApplication1.WebReference.EmployeeLeaveRequestService.Login(String userName, String password) in C:\Documents and Settings\maryj\My Documents\Visual Studio 2008\Projects\WebApplication1\WebApplication1\Web References\WebReference\Reference.cs:line 127
       at WebApplication1._Default.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\maryj\My Documents\Visual Studio 2008\Projects\WebApplication1\WebApplication1\Default.aspx.cs:line 33
  InnerException:

6 - went back to the server to browse and invoke the methods
7 - the ServiceNames method only returned the one service name DevDCOM
8 - the SetServiceName method returned HTTP 500 - Internal server error when invoked with DevDCOM as servicename

I have included my EngineServiceConfig.xml and my SSO js scripts.  The SSO scripts are in the following order:
0  eSSO_Web_DomainRemoved.js
1 eSSO_Win32_DomanRemoved.js
2 eWSLDAPAuth.js
3 eSSOError.js
4 eSSO_Web.js
0
maryjohnson

Member
Registered:
Posts: 19
Reply with quote  #2 

Attachment.

 
Attached Files
zip Metastorm_Authentication.zip (11.35 KB, 52 views)

0
Nappy

Avatar / Picture

Guru
Registered:
Posts: 1,087
Reply with quote  #3 

You should see the actions you exposed with the process activator you have to check them in the activator

Below is the code i use, ManageAddress is one of the forms

Dim wsMaster As New bpmMaster.MasterService
wsMaster.SessionIdSoapHeaderValue = New bpmMaster.SessionIdSoapHeader
Dim sType As ServerType = FindServerType()
wsMaster.Url = SetURL(wsMaster.Url, sType)
wsMaster.Login(My.Settings.bpmSOAPLogin, My.Settings.bpmSOAPPass)

fid = wsMaster.ManageAddresses(fid, Me.tAStreet.Text,.......)

' done so log out
wsMaster.Logout()


__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.

PS that's for V6/7 for V9 the problem is V9 at the moment ;)
0
maryjohnson

Member
Registered:
Posts: 19
Reply with quote  #4 

It appears that the problem is with the SSO scripts.  When I take them out and put only the euser.js as the SAP, the login  works.  But I need SSO and process orchestrator to work.

0
maryjohnson

Member
Registered:
Posts: 19
Reply with quote  #5 
The answer is to modify the code in the service.cs file in the App_Code directory that the Process Activator created.

Add code immediately under the 'using Microsoft.Web.Services;':

    using Microsoft.Web.Services3;
    using System.Security.Cryptography;  //for hash code
    using System.Text;                   //for hash code
    using System.Globalization;

Create a CustomLogin method:

        /// <summary>
        ///Custom authentication method using Complex Login (allow calling specific script and
        ///client type).
        ///</summary>
        ///<param name="userName">eUser, Metastorm user ID</param>
        ///<param name="password">Password for the specified user.</param>
        [WebMethod()]
        [SoapHeader("sessionIdHeader", Direction = SoapHeaderDirection.InOut)]
        public void CustomLogin(string userName, string password)
        {
            ISession2 session = eclSession;
            //construct fieldlist for complexe login
            FieldList loginData = new Metastorm.ECL.FieldList();
            loginData.Add("username", new Metastorm.ECL.Field("username", userName));
            loginData.Add("password", new Metastorm.ECL.Field("password", PasswordEncrypt(password)));
            //complex login with eUser.js
            session.Login(ConfigurationManager.AppSettings["ClientType"], ConfigurationManager.AppSettings["SingleSignOnSapNumber"], loginData);
            //original call
            //session.Login(userName, password);
            sessionIdHeader.SessionID = session.SessionID;
            sessionIdHeader.ServiceName = session.ServiceName;
        }
        /* Method to MD5 encode the password - using System.Security.Cryptography; */
        public string PasswordEncrypt(string passwordInput)
        {
            string result = passwordInput;
            {
               MD5 md5 = new MD5CryptoServiceProvider();
                byte[] byteArray = new byte[passwordInput.Length];
                for (int i = 0; i < passwordInput.Length; i++)
                {
                    byteArray[i] = (byte)passwordInput[i];
                }
                byte[] digest = md5.ComputeHash(byteArray);
                StringBuilder hexString = new StringBuilder();
                for (int i = 0; i < digest.Length; i++)
                {
                    int val = 0xFF & digest[i];
                    String hex = val.ToString("x", CultureInfo.InvariantCulture);
                    if (hex.Length == 1)
                    {
                        hexString.Append("0" + hex);
                    }
                    else
                    {
                        hexString.Append(hex);
                    }
                }
                result = hexString.ToString().ToUpper(CultureInfo.InvariantCulture);
            }
            return result;
        }

Then modify the code in the web.config file in the root of the web service, right under the   <add key="EngineServiceList" line (enter the value that you have the euser.js in your SAP listing):

                <add key="SingleSignOnSapNumber" value="5" />
                <add key="ClientType" value="WEB;"/>

This works, you just have to remember to make these changes for each new web service or if you recreate the web service.

0
pdkaman

Senior Member
Registered:
Posts: 71
Reply with quote  #6 
I know this is a little stale but this happened to us, couldn't figure out what was going on as it worked in our DEV, but not when we deployed to PROD.

Found a gem in the OpenText documentation they left on another project that fixed it:

"

Sometimes when a BPM process is deployed via the Process Activator, the <identity> tag attribute of impersonation value in the web.config file gets set to “true”.   If this is the case, then some web servers will not allow access to the web service.  If this is the case, change the impersonation value to “false”, and that will fix the problem.


"
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!