2
votes

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?

1
you can get little bit idea Idan Adar this answer stackoverflow.com/questions/35033095/… - Nazmul Hasan
Thank you very much. I am a step further now and appended my next steps. - gizmore
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

1 Answers

1
votes

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/