dev@jax-ws.java.net

Re: Dispatch with JAXBContext Problem

From: Kathy Walsh <Kathleen.Walsh_at_Sun.COM>
Date: Wed, 04 Jan 2006 13:05:01 -0500

mark,

I am looking into this and checking into the implementation, past notes,
and spec. An HTTP GET may not be allowed when using JAXB objects with
Dispatch-

I will get back to you later today-
Regards,
Kathy

mark_at_javector.com wrote:

>I'm using the JAX-WS version in Glassfish (built yesterday from source). Even
>though I create the Dispatch with a JAXBContext, it is returning a
>StreamSource. Is this the intended behavior when doing an HTTP "GET"?
>
>Here is code:
>
> JAXBContext jc =
> JAXBContext.newInstance("com.example.oms:com.example.css");
> // Get the new orders
> Service svc = Service.create(svcQName);
> svc.addPort(orderQName, HTTPBinding.HTTP_BINDING, newOrdersUrl);
> Dispatch<Object> getOrdersDispatch =
> svc.createDispatch(orderQName, jc, Service.Mode.PAYLOAD);
> Map<String, Object> requestContext = getOrdersDispatch.getRequestContext();
> requestContext.put(MessageContext.HTTP_REQUEST_METHOD, "GET");
> JAXBElement<OrdersType> newOrdersElt =
> (JAXBElement<OrdersType>) getOrdersDispatch.invoke(null);
>
>Here is run time error:
>
> [java] Exception in thread "main" java.lang.ClassCastException:
>javax.xml.transform.stream.StreamSource
> [java] at samples.OrderToCustHistJAXB.main(OrderToCustHistJAXB.java:45)
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe_at_jax-ws.dev.java.net
>For additional commands, e-mail: dev-help_at_jax-ws.dev.java.net
>
>
>