Accessing Soap service using java adapter in mobilefirst

雨燕双飞 提交于 2019-12-12 05:08:12

问题


I have written a SOAP WSDL application using mobilefirst by:

1) Using the Discover backend services option

2) Writing my own JavaScript adapter code to follow the documentation provided by IBM.

Now my final R&D is to consume this soap service using a java adapter.

I have gone through many StackOverflow topics and samples but I haven't been able to find anything related. Can anyone explain the steps to invoke a SOAP-based webservice request using java adapter?


回答1:


The following video blog post details the following about Java adapers: https://www.youtube.com/watch?v=cKM5480-6wI

  1. Creating Java Adapter
  2. Understanding Java Adapter structure
  3. Implementing simple sayHello procedure for HTTP GET method
  4. Implementing several procedures for different HTTP methods
  5. Working with various types of request parameters
  6. Using Java code to access MobileFirst server functionality and Java servlet functionality
  7. Debugging Java Adapters
  8. Communicating with a simple backend using using Apache HTTP Client
  9. Leveraging WSDL files and communicating with a SOAP based webservice
  10. Using WLResourceRequest in client applications to communicate with Java Adapters
  11. Using Postman REST client for communicating with Java Adapters



回答2:


  1. Create HTTP Adapter
  2. In xml add WebService Host and Port in Domain/Port elements
  3. Assemble soapXMLRequest
  4. Use HTTP Invoke to call server

ex.

var input = {
    method : 'post',
    returnedContentType : 'xml',
    headers : {
        SOAPAction : SOAP_FULL_URL
    },
    path : WEBSERVICE_PATH,
    body : {
        content : soapXMLRequest,
        contentType : 'text/xml; charset=utf-8'
    }
};
var response = WL.Server.invokeHttp(input);


来源:https://stackoverflow.com/questions/35033095/accessing-soap-service-using-java-adapter-in-mobilefirst

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!