2

Good day,

We have the requirement to call a MobileFirst Adapter via curl and SOAP, ommiting authentication.

An example how to do it with curl and application/x-www-form-urlencoded looks like this, but we also require to invoke the adapter using SOAP.

curl -XPOST -d 'adapter=PushAdapter&procedure=sendNotifications&parameters=["[\"UserA\",\"UserB\"]", "Pushed.you"]' http://localhost:10080/application/invoke

The reason is, we want to trigger sending PushNotifications through a network zone that only allows SOAP.

We are open to different suggestions, like implementing a new JavaAdapter (not JS), implementing an extra WebService, or anything that pops up which could fulfil the requirement in an acceptable way.

I hope someone can come up with an idea how to call Adapters via SOAP, ommiting authentication.

Thank you, gizmore

---- Edit ---

I added a new Java Adapter, like the video from Hasan suggests. Thank you very much for that hint :)

There i added a WebService like this:

@WebService
@Path("/soap")
@OAuthSecurity(enabled=false) // Disable the imfAuthentication :)
public class ExternalPushService {

    @POST
    @Path("/push")
    @WebMethod(action="push")
    public String push(@WebParam(name="name") String name) {
        return name + "ABC";
    }
}

I can now do HTTP POST Requests to the http://localhost:10080/app/adapters/PushBridge/soap/push Endpoint, but the SOAP is not parsed. Instead i get the complete Envelope in the "name" parameter. If i do a SOAP call to PushBridge/soap, i get 405 Method not allowed.

Does someone have an idea, how i can get SOAP working out of the box there?

Juno Liu
  • 66
  • 6
gizmore
  • 88
  • 7
  • you can get little bit idea **Idan Adar** this answer http://stackoverflow.com/questions/35033095/accessing-soap-service-using-java-adapter-in-mobilefirst – Nazmul Hasan Jan 27 '16 at 09:38
  • Thank you very much. I am a step further now and appended my next steps. – gizmore Jan 27 '16 at 12:09
  • Oh, and i think you misunderstood my question a bit. I do not want to consume a SOAP service, but provide a SOAP Service to a third party application. – gizmore Jan 27 '16 at 12:15

1 Answers1

1

Answer is: NO

when you adding @WebService in your java adapter this the warring facing:

Problem description:This annotation requires a web service project. Convert the Java project to a web project targeting the specified runtime environment

SOAP base service are based on the JAX-WS specification.

but

Java adapters are based on the JAX-RS specification. https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/server-side-development/java-adapter/

Nazmul Hasan
  • 10,130
  • 7
  • 50
  • 73
  • Thank you very much for clarifying some of my assumptions :) So will probably parse the SOAP myself.... Would there be better options to expose a SOAP providing service with our MFP app? – gizmore Feb 11 '16 at 23:30
  • I think you misunderstood my question again. I do not want to consume a SOAP service, but provide a SOAP Service to a third party application. Like i wanna do POST mobilefirstserver calladapter=Push payload=SOAP_calling adapter via 3 party curl. – gizmore Feb 13 '16 at 23:55
  • Yes, and i marked this answer as correct. I am still guessing you confuse providing and consuming. Thanks anyway :) – gizmore Mar 23 '16 at 22:36