cancel
Showing results for 
Search instead for 
Did you mean: 

SAP ME Message Board Web Services

Former Member
0 Kudos

Hi All,

I'm new to SAP ME and exploring about the web services available for various modules.

I'm specifically searching for web service related to Message Board Services and different operations which can be performed in Message Board with the help of web service (actions like getting message list, claim, transfer, close etc.).

I've gone through "Web Service Guide SAP ME 6.0" document but could not find specific to my requirement.

Is there any web service available for Message Board to perform its various operations ?

Appreciate your help in advance.

Thanks,

Sumit

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

There is a public API that can perform these tasks: MessageService.  It has not been exposed as a Web Service yet.

Former Member
0 Kudos

Thanks Mike.

I assume this public API is within SAP ME framework and can be used through SAP ME SDK. Is there any way to invoke it from third party non Java application ?

Regards,

Sumit

tim_drury
Active Participant
0 Kudos

You can use the SDK to expose the public API as a web service and call it that way.

Former Member
0 Kudos

Thanks Tim.

Is there any freely hosted SAP environment where one can test and explore about SAP ME web services.

Regards,

Sumit

Former Member
0 Kudos

Hi Tim,

I am trying to expose Message Board feature as a web service from ME to external world using SAP ME SDK 6.0. Here I have few questions.

1. Do I need to use Inbound WebService or WebService project?

2. What are the other PAPIs apart from MessageService that I need to use?

3. Colud you please give me a highlevel steps to achieve this functionality.

Thanks in advance.

Eshwar

tim_drury
Active Participant
0 Kudos

I wrote a blog entry on this process using NWDI here: http://scn.sap.com/people/tim.drury/blog/2011/01/28/creating-a-custom-sap-me-web-service-utilizing-s...

Using our SDK shouldn't be much different.

Former Member
0 Kudos

Hi Tim,

Thanks for the blog. Its very nice.

I am using MessageService API to develop web service. I have written a method to close a message closeMessage, Its working fine. I have added another method for creating a message createMessage. In both the methods service lookup code is common and I have written in a separate method. Now If I do full deployment, I am getting exception as shown below. Is it mandatory that service lookup code should be present in every method. Can someone tell me how to implement two or more methods of MessageService API.

  Error: Application cannot be started.

  Error Type: [com.sap.ASJ.web.000591]

  Troubleshooting Guide https://sdn.sap.com/irj/sdn/wiki?path=/display/JSTSG/Home

Details: com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Exception occurred during web services deployment. Unable to generate serialization framework for web service MySAPMEMessageService, application sap.com/me~ear.
at com.sap.engine.services.webservices.server.deploy.ws.WSInitialStartProcess.generateJAXWSFramework(WSInitialStartProcess.java:386)
at com.sap.engine.services.webservices.server.deploy.ws.WSInitialStartProcess.generateJAXWSFramework(WSInitialStartProcess.java:224)
at com.sap.engine.services.webservices.server.deploy.ws.WSInitialStartProcess.execute(WSInitialStartProcess.java:145)
at com.sap.engine.services.webservices.server.deploy.WSBaseAbstractDProcess.makeProcess(WSBaseAbstractDProcess.java:334)
at com.sap.engine.services.webservices.server.deploy.WebServicesDeployManager.makeStartInitially(WebServicesDeployManager.java:769)
at com.sap.engine.services.deploy.server.utils.container.ContainerWrapper.makeStartInitially(ContainerWrapper.java:1045)
at com.sap.engine.services.deploy.server.application.StartInitiallyTransaction.makeStartInitially(StartInitiallyTransaction.java:220)
at com.sap.engine.services.deploy.server.application.StartInitiallyTransaction.prepare(StartInitiallyTransaction.java:178)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:430)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:473)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeNestedTransaction(ApplicationTransaction.java:749)
at com.sap.engine.services.deploy.server.application.StartTransaction.doStartInitially(StartTransaction.java:580)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:324)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:310)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:430)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:473)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesSequentially(ParallelAdapter.java:311)
at com.sap.engine.services.deploy.server.application.StartTransaction.makeAllPhases(StartTransaction.java:598)
at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:1828)
at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:2480)
at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationOnInstanceWait(DeployServiceImpl.java:2732)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:679)
at com.sap.engine.services.servlets_jsp.server.deploy.impl.ApplicationManager.start(ApplicationManager.java:174)
at com.sap.engine.services.servlets_jsp.server.deploy.impl.ApplicationManager.analyseAppStatusMode(ApplicationManager.java:287)
at com.sap.engine.services.servlets_jsp.server.DeployContext.startLazyApplication(DeployContext.java:391)
at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:165)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:81)
at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)
at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.SessionSizeFilter.process(SessionSizeFilter.java:26)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.MemoryStatisticFilter.process(MemoryStatisticFilter.java:57)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.DSRHttpFilter.process(DSRHttpFilter.java:43)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:475)
at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.process(Processor.java:269)
at com.sap.engine.services.httpserver.server.rcm.RequestProcessorThread.run(RequestProcessorThread.java:56)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)
Caused by: javax.xml.bind.JAXBException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
com.sap.me.messaging.MessageServiceInterface is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
  at com.sap.me.messaging.MessageServiceInterface
  at private com.sap.me.messaging.MessageServiceInterface com.medemo.customwebservice.jaxws.LookUpServiceResponse.Return
  at com.medemo.customwebservice.jaxws.LookUpServiceResponse
com.sap.me.messaging.MessageServiceInterface does not have a no-arg default constructor.
this problem is related to the following location:
  at com.sap.me.messaging.MessageServiceInterface
  at private com.sap.me.messaging.MessageServiceInterface com.medemo.customwebservice.jaxws.LookUpServiceResponse.Return
  at com.medemo.customwebservice.jaxws.LookUpServiceResponse

- with linked exception:
[com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
com.sap.me.messaging.MessageServiceInterface is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
  at com.sap.me.messaging.MessageServiceInterface
  at private com.sap.me.messaging.MessageServiceInterface com.medemo.customwebservice.jaxws.LookUpServiceResponse.Return
  at com.medemo.customwebservice.jaxws.LookUpServiceResponse
com.sap.me.messaging.MessageServiceInterface does not have a no-arg default constructor.
this problem is related to the following location:
  at com.sap.me.messaging.MessageServiceInterface
  at private com.sap.me.messaging.MessageServiceInterface com.medemo.customwebservice.jaxws.LookUpServiceResponse.Return
  at com.medemo.customwebservice.jaxws.LookUpServiceResponse
]
at com.sap.engine.services.webservices.jaxws.j2w.JaxWsSchemaGenerator.genJaxbMappings(JaxWsSchemaGenerator.java:285)
at com.sap.engine.services.webservices.jaxws.j2w.JaxWsIMappingGenerator.generateWSDL(JaxWsIMappingGenerator.java:113)
at com.sap.engine.services.webservices.server.deploy.ws.WSInitialStartProcess.generateJAXWSFramework(WSInitialStartProcess.java:305)
... 53 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
com.sap.me.messaging.MessageServiceInterface is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
  at com.sap.me.messaging.MessageServiceInterface
  at private com.sap.me.messaging.MessageServiceInterface com.medemo.customwebservice.jaxws.LookUpServiceResponse.Return
  at com.medemo.customwebservice.jaxws.LookUpServiceResponse
com.sap.me.messaging.MessageServiceInterface does not have a no-arg default constructor.
this problem is related to the following location:
  at com.sap.me.messaging.MessageServiceInterface
  at private com.sap.me.messaging.MessageServiceInterface com.medemo.customwebservice.jaxws.LookUpServiceResponse.Return
  at com.medemo.customwebservice.jaxws.LookUpServiceResponse

at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
at com.sap.engine.services.webservices.jaxws.j2w.JaxWsSchemaGenerator.genJaxbMappings(JaxWsSchemaGenerator.java:282)
... 55 more

Thanks,

Eshwar.

tim_drury
Active Participant
0 Kudos

Is your code short enough to post here?  I need to see how you are using MessageServiceInterface - from the error message it seems as if you are passing this interface to or from your web service.  That won't work.

Former Member
0 Kudos

Hi Tim,

Thanks for the reply. I am using MessageServiceInterface as follows.

public class MyMessageService {

@Resource
protected WebServiceContext wsContext;


public MessageServiceInterface lookUpService(String user, String site) throws InvalidInputException{
  String userBO = "UserBO:"+site+","+user;
  if ((null == site)||"".equals(site)) {
         throw new InvalidInputException("No site defined in request message", "site", site);
     }
  ServiceReference serviceRef = new ServiceReference("com.sap.me.messaging", "MessageService");
        RunAsServiceLocator serviceLocator = new RunAsServiceLocator(userBO, site, null);
        MessageServiceInterface service = serviceLocator.getService(serviceRef, MessageServiceInterface.class);
        return service;
}

  @WebMethod
    @WebResult(name = "CloseMessageResponse_Sync", targetNamespace = "http://xxx.medemo.com/webservices/CloseMessage")
    public CloseMessageResponse closeMessage(
               @WebParam(name = "Site", targetNamespace = "http://xxx.medemo.com/webservices/CloseMessage") String site,
               @WebParam(name = "CloseMessageRequest_Sync", targetNamespace = "http://xxx.medemo.com/webservices/CloseMessage") CloseMessageRequest closeMsgRequest
              ) throws BusinessException
{
  String user = wsContext.getUserPrincipal().getName();

  // Run service
        CloseMessageResponse closeMsgserviceResponse = lookUpService(user, site).closeMessage(closeMsgRequest);
        return closeMsgserviceResponse;

}

  @WebMethod
  @WebResult(name = "CreateMessageResponse_Sync", targetNamespace = "http://xxx.medemo.com/webservices/CreateMessage")
public CreateMessageResponse createMessage(
           @WebParam(name = "Site", targetNamespace = "http://xxx.medemo.com/webservices/CreateMessage") String site,
           @WebParam(name = "CreateMessageRequest_Sync", targetNamespace = "http://xxx.medemo.com/webservices/CreateMessage") CreateMessageRequest createMsgRequest
          )throws BusinessException
{
  String user = wsContext.getUserPrincipal().getName();
   
        // Run service
        CreateMessageResponse createMsgserviceResponse = lookUpService(user, site).createMessage(createMsgRequest);
        return createMsgserviceResponse;
}

}

Thanks,

Eshwar.

tim_drury
Active Participant
0 Kudos

You didn't include your imports, so I can't tell if CreateMessageResponse is our com.sap.me.messaging.CreateMessageResponse class your own?  If it's yours, what does that class look like?

Former Member
0 Kudos

Hi Tim,

I am using com.sap.me.messaging.CreateMessageResponse class. for remaining methods also I am uisng classes provide by SAP. I am not using any custom classes. I have followed your blog for creating custom WS using PAPI. I am trying to impement two or more methods insteadof one method.

Thanks,

Eshwar.

tim_drury
Active Participant
0 Kudos

Change the scope of lookUpService from "public" to "protected".  It seems that NetWeaver wants to make all public methods services and MessageServiceInterface is not JAXB-serializable. 

Former Member
0 Kudos

Thanks Tim,

I changed the scope of lookUpService from "public" to "protected" and now its working fine. But could not get what is "NetWeaver wants to make all public methods services and MessageServiceInterface is not JAXB-serializable". Colud you please elaborate it more.

Thanks,

Eshwar.

tim_drury
Active Participant
0 Kudos

When the class is loaded by NetWeaver, it seems that NW is trying to take your lookUpService() method and turn it into a web service even though you didn't annotate it.  This is why JAXB is complaining about trying to serialize MessageServiceInterface.  MessageServiceInterface is returned by lookUpService.  By making the method protected, NW is no longer trying to turn it into a web service.

It would seem this is a bug in NW, but the JEE spec is often vague about things like this so it may be acceptable that NW is trying to make a web service from all public methods whether the are annotated with @WebMethod or not.

Former Member
0 Kudos

Hi Tim,

Thanks a lot for the clear explanation.

Now I have deployed my webservice successfully with all the operations which are in MessageService API. When I am testing createMessage operation thruogh SOAP UI my request XML is as below. What needs to be set in payloadAttributeList.Is it Message Subject and Message Body? if i pass message suject and body in attribute and value pairs, its not working. How do I set message subject and body using this soap request. I have used CreateMessageRequest class for this. Do I need to write custom CreateMessageRequest class for this?

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://abc.defg.com/webservices" xmlns:cre="http://abc.defg.com/webservices/CreateMessage" xmlns:mes="http://www.sap.com/me/messaging">

   <soapenv:Header/>

   <soapenv:Body>

      <web:CreateMessage>

         <!--Optional:-->

         <cre:Site>MYSITE</cre:Site>

         <!--Optional:-->

         <cre:CreateMessageRequest_Sync>

            <mes:messageTypeRef>MessageTypeBO:MYSITE,SIMPLE_MESSAGE</mes:messageTypeRef>

           <!--Zero or more repetitions:-->

           <mes:payloadAttributeList>

               <attribute> Simple message Test</attribute>

               <value>Test Message</value>

            </mes:payloadAttributeList>

             </cre:CreateMessageRequest_Sync>

      </web:CreateMessage>

   </soapenv:Body>

</soapenv:Envelope>

Thanks,

Eshwar.

tim_drury
Active Participant
0 Kudos

my reading of the XSD shows it should be

<mes:payloadAttributeList>

     <com:AttributeValue>

               <com:attribute>see below</com:attribute>

              <com:value>see below</com:value>

     </com:AttributeValue>

</mes:payloadAttributeList>

where 'com' is the namespace http://www.sap.com/me/common

The attribute would be one of the ones listed in the online help:

http://help.sap.com/saphelp_me61/helpdata/EN/4e/419781d94f479096ecdb82c304c3ce/frameset.htm


Former Member
0 Kudos

Hi Tim,

Just wanted a confirmation from you about the security of this web service. So far we are using NW basic authentication.

Is it enough?

How can we provide the security to these custom web services?

Is ther any PAPI available for security?

Regards, Eshwar.

sergiy_katerinich
Active Contributor
0 Kudos

Hi Sumit,

The list of all web services can be found in Single Service Administration (NWA > SOA tab > Application and Scenario Communication). I do not see any WS for Message Board there. And thus the guide seems to reflect the same.

So, it does look as if it is not implemented yet.

Regards,

Sergiy