users@jax-ws.java.net

Re: Dispatch with JAXBContext Problem

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

Post to users mail list

Kathy Walsh wrote:

> mark,
>
> I looked at the JAX-WS Public Final Draft which you can find at
> www.jcp.org
> and the spec seems to indicate that only the Source object is allowed
> to have a null
> value when used with an HTTP GET. Given this, a Source would be
> expected.
>
> Since this isn't stated in the JAXB object case(invocation parameter
> can be null)
> the implementation did not implement this. In this case, the error
> could have
> been found before the GET reguest was invoked.
> Please enter a bug for this at java.net-
>
> Thanks so much for using JAX-WS 2.0.
> 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
>>
>>
>>