You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Juergen Mayrbaeurl <ju...@hvb.sozvers.at> on 2006/04/28 23:16:14 UTC

servicemix-http NPE of XFire based webservice without soap version

I'm not sure, if this is a bug of ServiceMix or XFire. Anyway. Calling a
XFire based webservice, exposed on the ESB with servicemix.http (as
described in http://www.servicemix.org/servicemix-http for a provider
endpoint) causes an NPE thrown by the XFire 1.0 based webservice.

The reason for this is, that the soap version attribut of SoapEndpoint is
not explicitly set, but accessed in 'public ProviderProcessor(HttpEndpoint
endpoint)'. Setting the soap version to "1.1" fixes the problem and the
webservice works correctly.

I suggest to set the attribut 'soapVersion' to the default value '1.1' in
the class SoapEndpoint.

Kind regards
Juergen
--
View this message in context: http://www.nabble.com/servicemix-http-NPE-of-XFire-based-webservice-without-soap-version-t1526887.html#a4147786
Sent from the ServiceMix - User forum at Nabble.com.


Re: servicemix-http NPE of XFire based webservice without soap version

Posted by Guillaume Nodet <gn...@gmail.com>.
Yeah, the difference is that it will use the soap 1.2 by default.
Not sure if the problem is on the xfire side or the servicemix-http
side, but there is a problem and I do not think that changing the
default soap version is a good solution (you can always do that on the
http endpoint deployment when needed).
Could you please raise a JIRA ?
If you ever reproduce the NPE, please put in the JIRA, it will
certainly help ...

Cheers,
Guillaume Nodet

On 4/29/06, Juergen Mayrbaeurl <ju...@hvb.sozvers.at> wrote:
>
> You're right. The code in ProviderProcessor constructor doesn't have any
> problems and won't throw a NPE. The XFire based webservice that gets called
> by the servicemix-http component will throw the NPE. I don't know how to
> show you the misbehaviour, because I would have to provide an XFire based
> webservice.
>
> Anyway. Do you think it's a good idea to use an uninitialized attribute in
> the ProviderProcessor constructor?
>
>     public ProviderProcessor(HttpEndpoint endpoint) {
>         this.endpoint = endpoint;
>         this.soapMarshaler = new SoapMarshaler(endpoint.isSoap());
>         if (endpoint.isSoap() && "1.1".equals(endpoint.getSoapVersion())) {
>             this.soapMarshaler.setSoapUri(SoapMarshaler.SOAP_11_URI);
>         }
>         this.jbiMarshaler = new JBIMarshaler();
>     }
>
> What happens after
> 'this.soapMarshaler.setSoapUri(SoapMarshaler.SOAP_11_URI);' is called? Any
> difference in calling the webservice?
>
> Kind regards
> Juergen
> --
> View this message in context: http://www.nabble.com/servicemix-http-NPE-of-XFire-based-webservice-without-soap-version-t1526887.html#a4148377
> Sent from the ServiceMix - User forum at Nabble.com.
>
>

Re: servicemix-http NPE of XFire based webservice without soap version

Posted by Juergen Mayrbaeurl <ju...@hvb.sozvers.at>.
You're right. The code in ProviderProcessor constructor doesn't have any
problems and won't throw a NPE. The XFire based webservice that gets called
by the servicemix-http component will throw the NPE. I don't know how to
show you the misbehaviour, because I would have to provide an XFire based
webservice.

Anyway. Do you think it's a good idea to use an uninitialized attribute in
the ProviderProcessor constructor?

    public ProviderProcessor(HttpEndpoint endpoint) {
        this.endpoint = endpoint;
        this.soapMarshaler = new SoapMarshaler(endpoint.isSoap());
        if (endpoint.isSoap() && "1.1".equals(endpoint.getSoapVersion())) {
            this.soapMarshaler.setSoapUri(SoapMarshaler.SOAP_11_URI);
        }
        this.jbiMarshaler = new JBIMarshaler();
    }

What happens after
'this.soapMarshaler.setSoapUri(SoapMarshaler.SOAP_11_URI);' is called? Any
difference in calling the webservice?

Kind regards
Juergen
--
View this message in context: http://www.nabble.com/servicemix-http-NPE-of-XFire-based-webservice-without-soap-version-t1526887.html#a4148377
Sent from the ServiceMix - User forum at Nabble.com.


Re: servicemix-http NPE of XFire based webservice without soap version

Posted by Guillaume Nodet <gn...@gmail.com>.
Do you have the full stack trace ? I do not really see the problem...
The code in ProviderProcessor constructor should not thrown an exception:
   if (endpoint.isSoap() && "1.1".equals(endpoint.getSoapVersion())) {

Even if getSoapVersion() returns null, no NPE would be thrown.

Thanks,
Guillaume Nodet

On 4/28/06, Juergen Mayrbaeurl <ju...@hvb.sozvers.at> wrote:
>
> I'm not sure, if this is a bug of ServiceMix or XFire. Anyway. Calling a
> XFire based webservice, exposed on the ESB with servicemix.http (as
> described in http://www.servicemix.org/servicemix-http for a provider
> endpoint) causes an NPE thrown by the XFire 1.0 based webservice.
>
> The reason for this is, that the soap version attribut of SoapEndpoint is
> not explicitly set, but accessed in 'public ProviderProcessor(HttpEndpoint
> endpoint)'. Setting the soap version to "1.1" fixes the problem and the
> webservice works correctly.
>
> I suggest to set the attribut 'soapVersion' to the default value '1.1' in
> the class SoapEndpoint.
>
> Kind regards
> Juergen
> --
> View this message in context: http://www.nabble.com/servicemix-http-NPE-of-XFire-based-webservice-without-soap-version-t1526887.html#a4147786
> Sent from the ServiceMix - User forum at Nabble.com.
>
>