Thanks for your answer Guillaume.
I have looked up the binding in the wsn-http-binding wsdl, and the declared
namespace corresponds to SOAP 1.2.
In this case the declared Content Type should be application/soap+xml
instead of text/xml, as in the response sent by the Broker.
I have tried to use wsimport in two different ways to solve this issue:
- Having modified SOAP 1.2 to 1.1 in the binding of the Broker's wsdl.
- Using the original Broker's wsdl, but setting a custom SOAP 1.1 binding
for the client.
However, the generated code uses SOAP 1.2.

Can anyone suggest a workaround?

Thanks

On Thu, Jan 29, 2009 at 9:23 PM, Guillaume Nodet <[email protected]> wrote:

> I think this is a difference between soap 1.1 and soap 1.2 (the
> content type has changed between both versions afaik).
> I guess the jaxws client uses the wrong soap version somehow.
>
> On Thu, Jan 29, 2009 at 20:06, Filipe Campos <[email protected]> wrote:
> > I have used a JAX-WS client to perform notifications to the broker
> > sucessfully, but when I try to perform a subscription something
> > extraordinary happens: an exception is risen.
> >
> > com.sun.xml.ws.server.UnsupportedMediaException: Unsupported
> Content-Type:
> > text/xml; charset=utf-8 Supported ones are: [application/soap+xml]
> >
> > The craziest part is that, by sending the exact same message using
> soapUI, I
> > get a correct soap response:
> >
> > <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope";>
> >   <S:Body>
> >      <ns4:SubscribeResponse xmlns:ns2="
> http://www.w3.org/2005/08/addressing";
> > xmlns:ns4="http://docs.oasis-open.org/wsn/b-2"; xmlns:ns3="
> > http://docs.oasis-open.org/wsrf/bf-2"; xmlns:ns5="
> > http://docs.oasis-open.org/wsn/t-1"; xmlns:ns6="
> > http://docs.oasis-open.org/wsn/br-2";>
> >         <ns4:SubscriptionReference>
> >            <ns2:Address>
> >
> http://servicemix.org/wsnotification/Subscription/ID-59130-1233255110070-3-3
> > </ns2:Address>
> >         </ns4:SubscriptionReference>
> >         <ns4:TerminationTime xsi:nil="true" xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance"/>
> >      </ns4:SubscribeResponse>
> >   </S:Body>
> > </S:Envelope>
> >
> >
> >
> > The sent message is as follows:
> >
> > <?xml version='1.0' encoding='UTF-8'?>
> > <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope";>
> >  <S:Body>
> >    <ns5:Subscribe
> >        xmlns:ns2="http://docs.oasis-open.org/wsn/t-1";
> >        xmlns:ns3="http://docs.oasis-open.org/wsrf/bf-2";
> >        xmlns:ns4="http://www.w3.org/2005/08/addressing";
> >        xmlns:ns5="http://docs.oasis-open.org/wsn/b-2";
> >        xmlns:ns6="http://docs.oasis-open.org/wsn/br-2";
> >        xmlns:ns7="http://docs.oasis-open.org/wsrf/r-2";>
> >        <ns5:ConsumerReference>
> >            <ns4:Address>
> >
> >
> http://localhost:11111/wsn/NotificationConsumer/?http.soap=true&amp;http.soapVersion=1.1<http://localhost:11111/wsn/NotificationConsumer/?http.soap=true&http.soapVersion=1.1>
> >            </ns4:Address>
> >        </ns5:ConsumerReference>
> >        <ns5:Filter>
> >            <ns5:TopicExpression Dialect="
> > http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple";>
> >                myTopic
> >            </ns5:TopicExpression>
> >        </ns5:Filter>
> >    </ns5:Subscribe>
> >  </S:Body>
> > </S:Envelope>
> >
> > Has this happened to anybody else? And could someone share their
> solution?
> >
> > Thanks
> >
> > On Thu, Jan 29, 2009 at 10:10 AM, Filipe Campos <[email protected]
> >wrote:
> >
> >> Just to share some of the discoveries performed during my experience
> with
> >> the wsn-http-binding
> >> Contrarily to what is described in
> >> http://servicemix.apache.org/ws-notification-http-binding.html, I have
> >> been able, by using the soapUI project, to subscribe a consumer endpoint
> >> using the URL
> >> http://localhost:11111/wsn/NotificationConsumer/?http.soap=true instead
> of
> >> http://localhost:11111/wsn/NotificationConsumer?http.soap=true<
> http://localhost:11111/wsn/NotificationConsumer/?http.soap=true>
> >> .
> >> And regarding the soap version I had to use the &'s special character in
> >> the URL:
> >>
> http://localhost:11111/wsn/NotificationConsumer/?http.soap=true&amp;http.soapVersion=1.1<http://localhost:11111/wsn/NotificationConsumer/?http.soap=true&http.soapVersion=1.1>
> <http://localhost:11111/wsn/NotificationConsumer/?http.soap=true>
> >>
> >> However, I still haven't been able to perform a subscription or a
> publisher
> >> registration from my JAX-WS web services and clients.
> >>
> >>
> >> <
> http://localhost:11111/wsn/NotificationConsumer?http.soap=true&http.soapVersion=1.1
> >
> >
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>

Reply via email to