dev@jax-ws.java.net

Re: Dispatch with JAXBContext Problem

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Wed, 04 Jan 2006 10:31:55 -0800

One small note, and someone can correct me if I wrong, but this subject
should be better discussed on the users_at_jax-ws.dev.java.net mailing list
so more users are exposed to this type of question. This mailing list is
used to discuss implementation design/direction etc.

Thank you

Kathy Walsh wrote:

> 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
>>
>>
>>
>
> ---------------------------------------------------------------------
> 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
>

-- 
 - Doug