2 Replies Latest reply on Dec 3, 2014 11:08 AM by Murilo Lima

    Webservice - Problem with Operation field

    Murilo Lima Novice

      Hello everyone,

      I am trying to setup a web service to between one of our web applications and our Ariba Buyer On-Premise.

      I am getting an error when starting up Buyer:

      An error occurred when configuring the handler for event cpar1/GeneralDataRequestService for channel WS. Event will be disabled. Exception: InvalidMessageDefinition: The Operation must be one of the following {Export,Import}

      ariba.integration.core.ConfigurationException: InvalidMessageDefinition: The Operation must be one of the following {Export,Import}

       

       

      I believe my .table files are setup correct but can’t figure why the WSConfigUtil is complaining about them:

      My ../Server/config/variants/cvar1/messages/MessageDefinition.table:

          GeneralDataRequestService = {

              Signature = {

                     Error = {};

                     ListenerClass = "integration.service.GeneralDataRequestProcessor";

                  Request = {};

                  Response = {};

              };

              TopicName = GeneralDataRequestService;

              Type = Service;

          };

       

       

      My ../Server/config/variants/cvar1/partitions/cpar1/ws/MessageConfiguration.table:

      {

           GeneralDataRequestService = {

                Channel = {

                     Encoding = UTF-8;

                     WSDLLocation = "config/variants/cvar1/wsdl/GeneralDataRequestService.wsdl";

                     Operation = "GeneralDataRequest";

                     Port = "";

                     ObjectNameTag = "DataRequest";

                     TimeoutInSec = 60;

                     FileType = SOAP;

                     Name = WS;

                };

                MessageParameters = {

                     Request = {

                          Parameters = {

                               EventSource = "External";

                               Operation = "Export";

                               Filename = "TBD";

                          };

                          SchemaName = ariba.integration.SimpleFileSchema;

                     };

                };

                TopicName = GeneralDataRequestService;

           };

      }

       

       

      Any idea of what I am doing wrong?

       

        • Re: Webservice - Problem with Operation field
          Frédéric Henri Expert

          Hi,

           

          I havent done Export service, only import so far but I have few questions :

           

          did you define a new class as Listener in MessageDefintion :

              GeneralDataRequestService = {

                  Signature = {

                         Error = {};

                         ListenerClass = "integration.service.GeneralDataRequestProcessor";

                      Request = {};

                      Response = {};

                  };

                  TopicName = GeneralDataRequestService;

                  Type = Service;

              };

           

          Just to make check, use the default ws handler

          ListenerClass = "ariba.channel.ws.WebServiceServiceMessageHandler";

           

          in MessageConfiguration.table is probably the error indicated by the log as the Operation in channel part is not supported I think so you need to remove this one

           

               GeneralDataRequestService = {

                    Channel = {

                         Encoding = UTF-8;

                         WSDLLocation = "config/variants/cvar1/wsdl/GeneralDataRequestService.wsdl";

                         Operation = "GeneralDataRequest";

                         Port = "";

                         ObjectNameTag = "DataRequest";

                         TimeoutInSec = 60;

                         FileType = SOAP;

                         Name = WS;

                    };

                    MessageParameters = {

                         Request = {

                              Parameters = {

                                   EventSource = "External";

                                   Operation = "Export";

                                   Filename = "TBD";

                              };

                              SchemaName = ariba.integration.SimpleFileSchema;

                         };

                    };

                    TopicName = GeneralDataRequestService;

               };

           

          Hope that helps

           

          Thanks,

          Fred

          1 of 1 people found this helpful
            • Re: Webservice - Problem with Operation field
              Murilo Lima Novice

              One problem was in the MessageDefinition.table.

              I was missing the Operation type (Operation = Export;). So this is how another web service shows up now!

              UserCoreRequestService = {
                Operation = Export;
                      Signature = {
                Error = {};
                ListenerClass = "integration.service.GeneralDataRequestProcessor";
                Reply = {
                Schema = "ariba.user.core.User";
                };
              Request = { BasicMessage = integration.messages.WebServiceBasicMessage; };
                          Response = {};
                      };
                      TopicName = UserCoreRequestService;
                      Type = Service;
                  };
              

               

              The reason why I have my own listener class is because I want to process the request and response on a custom fashion.

              For example, I would like to list all PRs associated to a user.

               

              One thing I noticed is the Request needs to be an ClusterRoot type. I tried something like below but got a 500 validation error:

              Request = { AuthtenticatedUser = java.lang.String; };
              

               

              FYI, this is how my actual ../Server/config/variants/@variant/partitions/@partition/ws/MessageConfiguration.table looks like:

              UserCoreRequestService = {
                                  Channel = {
                                            Encoding = UTF-8;
                                            WSDLLocation = "config/variants/cvar1/wsdl/UserCoreRequestService.wsdl";
                                            Operation = "UserCoreRequest";
                                            Port = "";
                                            ObjectNameTag = "DataRequest";
                                            TimeoutInSec = 60;
                                            Decoder = {
                                                      Name = WSChannelDecoder;
                                            };
                                            Encoder = {
                                                      Name = WSChannelEncoder;
                                            };
                                            FileType = SOAP;
                                            Name = WS;
                                  };
                                  MessageParameters = {
                                            Request = {
                                                      Parameters = {
                                                                EventSource = "External";
                                                                Operation = "Export";
                                                                Filename = "TBD";
                                                      };
                                                      SchemaName = ariba.integration.SimpleFileSchema;
                                            };
                                  };
                                  TopicName = UserCoreRequestService;
                        };
              

               

               

              With this I was able to start up the application and see the web service listed under my service URL: https://buyer.com/Buyer/soap/@partition

               

              As a heads up, if you try to generate the WSDL by clicking on the link https://buyer.com/Buyer/soap/@partition/UserCoreRequestService?wsdl you a 500 error.

              It is because it is trying to validate. To work around this you just add "&validate=false":

              https://buyer.com/Buyer/soap/@partition/UserCoreRequestService?wsdl&validate=false

               

              I am still working on a web page to make a SOAP request to that service and see how it goes.

               

              Regards

              Murilo