Sending SOAP messages in OpenSAML v3
Stefan Rasmusson
rasmusson.stefan at gmail.com
Thu Apr 28 02:11:46 EDT 2016
Hi Brent
Thanks for answering and thanks for the information.
I have started experimenting and I am getting somewhere. I have managed to
send a SOAP message, recieved it, sent a response. But when Im trying to
recieve the response, I get nothing. I know that the respons is being sent
because if I disable the response encoder I get "Premature end of file" at
the reciever.
Any ideas what I'm doing wrong? By the way is the code I have put together
the correct way of using the pipeline and encoder etc? I based it on a
example you gave in a earlier mailing list conversation, it was refered to
as the "quick and dirty way" =).
AbstractPipelineHttpSOAPClient<SAMLObject, SAMLObject> soapClient =
new AbstractPipelineHttpSOAPClient() {
protected HttpClientMessagePipeline newPipeline() throws SOAPException {
HttpClientRequestSOAP11Encoder encoder = new
HttpClientRequestSOAP11Encoder();
HttpClientResponseSOAP11Decoder decoder = new
HttpClientResponseSOAP11Decoder();
decoder.setBodyHandler(new EnvelopeBodyHandler());
BasicHttpClientMessagePipeline pipeline = new
BasicHttpClientMessagePipeline(
encoder,
decoder
);
BasicMessageHandlerChain<SAMLObject> outboundPayloadHandler =
new BasicMessageHandlerChain<SAMLObject>();
outboundPayloadHandler.setHandlers(Lists.<MessageHandler<SAMLObject>>newArrayList(
new SAMLOutboundProtocolMessageSigningHandler()));
pipeline.setOutboundPayloadHandler(outboundPayloadHandler);
return pipeline;
}};
HttpClientBuilder clientBuilder = new HttpClientBuilder();
soapClient.setHttpClient(clientBuilder.buildClient());
soapClient.send(IDPConstants.ARTIFACT_RESOLUTION_SERVICE, context);
System.out.println(contextin.getMessage());
--
Stefan
On Tue, Apr 26, 2016 at 10:12 PM, Brent Putman <putmanb at georgetown.edu>
wrote:
>
>
> On 4/26/16 3:12 PM, Stefan Rasmusson wrote:
>
> Hi, how are you supposed to send SOAP messages in v3. i have tried to use
> the HTTPSOAP11Encoder, but it just encodes the envelope onto the
> httpservlet response.
>
>
> Yeah, that's for the server side (inbound SOAP message), so not what you
> want.
>
> For the client side, there is a completely different set of components, in
> opensaml-soap-api and opensaml-soap-impl. See under package
> org.opensaml.soap.client.http.
>
> The old one is HttpSOAPClient. It's not formally deprecated yet
> (eventually probably will be though) and probably works for simple cases,
> but we've not really used it much, if at all.
>
> The new one with the modern supported approach is represented by
> AbstractPipelineHttpSOAPClient and PipelineFactoryHttpSOAPClient and the
> required client side encoder and decoder impls in
> org.opensaml.soap.client.soap11.decoder.http.impl and
> org.opensaml.soap.client.soap11.encoder.http.impl.
>
> There is unfortunately no documentation or examples on those really at the
> moment. I'm actually right now in the middle of working on our usage of
> them for server-side inbound artifact resolution and backchannel logout for
> 3.3.0 later this year. If you want to experiment with them, feel free. I
> can answer questions, but I don't have any more concrete examples, etc at
> the moment published.
>
> --
> To unsubscribe from this list send an email to
> dev-unsubscribe at shibboleth.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20160428/bb6407fe/attachment.html>
More information about the dev
mailing list