You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Eric Le Goff <el...@gmail.com> on 2007/12/07 16:46:59 UTC

jaxws_dispatch_provider demo

I have playing with the jaxws_dispatch_provider demo sample after a
recent svn checkout

Then I tried to update the source files to try and understand how this works ;)

1 )  in wdsl/hello_world.wsdl

I replaced every occurence of
"http://apache.org/hello_world_soap_http"
to
"http://foobar.com/my_soap_http"


2) In Client.java

I replaced the
import org.java.hello_world_http.*;
to
import com.foobar.my_soap_http.*;


3) In each GreetMeDocLiteral*.xml  (server & client)
I replaced every namespace occurence of
"http://apache.org/hello_world_soap_http"
to
"http://foobar.com/my_soap_http"

4) In GreeterSoapProvider
I updated the targetNamespace to "http://foobar.com/my_soap_http"





Now I am certainly missing something because I get an Exception... I
know I am a bad guy, and I should not have touched the nice demo ;)
, but I am puzzled with the stack trace :


[java] INFO: Interceptor has thrown exception, unwinding now
     [java] org.apache.cxf.interceptor.Fault: Unable to create
envelope from given source:
     [java] 	at
org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor$PostDispatchSOAPHandlerInterceptor.handleMessage(DispatchInDatabindingInterceptor.java:225)
     [java] 	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
     [java] 	at
org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:312)
     [java] 	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1948)
     [java] 	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
     [java] 	at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
     [java] 	at
org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
[...]
java] Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable
to create envelope from given source:
     [java] 	at
com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:114)
     [java] 	at
com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:71)

[...]
   [java] Caused by: javax.xml.transform.TransformerException:
org.xml.sax.SAXParseException: Premature end of file.
     [java] 	at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:673)
     [java] 	at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
     [java] 	at
com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:390)
     [java] 	at
com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102)
     [java] 	... 15 more
     [java] Caused by: org.xml.sax.SAXParseException: Premature end of file.
     [java] 	at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1269)
     [java] 	at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
     [java] 	at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:607)
     [java] 	at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:661)
     [java] 	... 18 more


This "premature end of file" is very strange to me. I guess I forgot
to update another piece of code to make it run from an updated
hello_world.wsdl file.

Any help to understand would be appreciated



-- 
Eric Le Goff

Re: jaxws_dispatch_provider demo

Posted by Eric Le Goff <er...@babelgum.com>.
FWIW I fixed the issue by replacing "foobar.com"  with "foobar.net"
I must admit that I don't understand why it now works...


-- 
Eric Le Goff

Re: jaxws_dispatch_provider demo

Posted by Eric Le Goff <er...@babelgum.com>.
James, Jervis

Thanks for your help,

First I checked if my XML modified file were still well-formed :
actually they are well-formed...
Then I checked my Client code, but I had correctly updated the service
and port QName to reflect my changes.

I did not have the opportunity yet to use tcpmon (which is a tool I
don't really know how to use but will learn...)

One more thing about my tests around this jaxws_dispatch_demo :

1) Let's say I update the WSDL namespaces (and consequently Client
source, XML updates etc...) like I said previously

=> http://apache.org/hello_world_soap_http"
to
"http://foobar.com/my_soap_http"

This fails with the "Premature end of file" SOAP envelope parsing issue

But if

2) I change
from
http://apache.org/hello_world_soap_http"
to
http://apache.org/my_soap_http

it works fine....


I guess it should be possible to to change from "apache.org"to
"whateverDomain" in WSDL, am I wrong ?
I am stuck with this for a couple of days, and would like to
understand what I am doing wrong...

FYI, here is the updated XML file :

<?xml version="1.0" encoding="utf-8" ?>
<SOAP-ENV:Envelope
	xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<SOAP-ENV:Body>
		<ns4:greetMe xmlns:ns4="http://foobar.com/my_soap_http/types">
			<ns4:requestType>Gil</ns4:requestType>
		</ns4:greetMe>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>










On Dec 10, 2007 4:11 AM, Liu, Jervis <jl...@iona.com> wrote:
> Hi Eric, it looks like your client did not sent out an valid request to the server. A quick way to verify this is using sth like tcpmon to sniff the message you send on wire. In your client code, did you change the service and port QName to reflect your own namespaces? I.e., following lines:
>
>         QName serviceName1 = new QName("http://apache.org/hello_world_soap_http", "SOAPService1");
>         QName portName1 = new QName("http://apache.org/hello_world_soap_http", "SoapPort1");
>
>         SOAPService1 service1 = new SOAPService1(wsdlURL, serviceName1);
>
> Cheers,
> Jervis
>
>
>
> > -----Original Message-----
> > From: Eric Le Goff [mailto:elegoff@gmail.com]
> > Sent: 2007年12月7日 23:47
> > To: cxf-user@incubator.apache.org
> > Subject: jaxws_dispatch_provider demo
> >
> > I have playing with the jaxws_dispatch_provider demo sample after a
> > recent svn checkout
> >
> > Then I tried to update the source files to try and understand how this
> > works ;)
> >
> > 1 )  in wdsl/hello_world.wsdl
> >
> > I replaced every occurence of
> > "http://apache.org/hello_world_soap_http"
> > to
> > "http://foobar.com/my_soap_http"
> >
> >
> > 2) In Client.java
> >
> > I replaced the
> > import org.java.hello_world_http.*;
> > to
> > import com.foobar.my_soap_http.*;
> >
> >
> > 3) In each GreetMeDocLiteral*.xml  (server & client)
> > I replaced every namespace occurence of
> > "http://apache.org/hello_world_soap_http"
> > to
> > "http://foobar.com/my_soap_http"
> >
> > 4) In GreeterSoapProvider
> > I updated the targetNamespace to "http://foobar.com/my_soap_http"
> >
> >
> >
> >
> >
> > Now I am certainly missing something because I get an Exception... I
> > know I am a bad guy, and I should not have touched the nice demo ;)
> > , but I am puzzled with the stack trace :
> >
> >
> > [java] INFO: Interceptor has thrown exception, unwinding now
> >      [java] org.apache.cxf.interceptor.Fault: Unable to create
> > envelope from given source:
> >      [java]   at
> > org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor$PostDi
> > spatchSOAPHandlerInterceptor.handleMessage(DispatchInDatabindingInterc
> > eptor.java:225)
> >      [java]   at
> > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> > hain.java:207)
> >      [java]   at
> > org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:312)
> >      [java]   at
> > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleR
> > esponse(HTTPConduit.java:1948)
> >      [java]   at
> > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(H
> > TTPConduit.java:1791)
> >      [java]   at
> > org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> >      [java]   at
> > org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
> > [...]
> > java] Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable
> > to create envelope from given source:
> >      [java]   at
> > com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(Envelop
> > eFactory.java:114)
> >      [java]   at
> > com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelope
> > FromSource(SOAPPart1_1Impl.java:71)
> >
> > [...]
> >    [java] Caused by: javax.xml.transform.TransformerException:
> > org.xml.sax.SAXParseException: Premature end of file.
> >      [java]   at
> > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Tra
> > nsformerImpl.java:673)
> >      [java]   at
> > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Tra
> > nsformerImpl.java:300)
> >      [java]   at
> > com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransformer.tr
> > ansform(EfficientStreamingTransformer.java:390)
> >      [java]   at
> > com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(Envelop
> > eFactory.java:102)
> >      [java]   ... 15 more
> >      [java] Caused by: org.xml.sax.SAXParseException: Premature end of
> > file.
> >      [java]   at
> > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abstra
> > ctSAXParser.java:1269)
> >      [java]   at
> > org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
> >      [java]   at
> > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIde
> > ntity(TransformerImpl.java:607)
> >      [java]   at
> > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Tra
> > nsformerImpl.java:661)
> >      [java]   ... 18 more
> >
> >
> > This "premature end of file" is very strange to me. I guess I forgot
> > to update another piece of code to make it run from an updated
> > hello_world.wsdl file.
> >
> > Any help to understand would be appreciated
> >
> >
> >
> > --
> > Eric Le Goff
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>



-- 
Eric Le Goff

RE: jaxws_dispatch_provider demo

Posted by "Liu, Jervis" <jl...@iona.com>.
Hi Eric, it looks like your client did not sent out an valid request to the server. A quick way to verify this is using sth like tcpmon to sniff the message you send on wire. In your client code, did you change the service and port QName to reflect your own namespaces? I.e., following lines:

        QName serviceName1 = new QName("http://apache.org/hello_world_soap_http", "SOAPService1");
        QName portName1 = new QName("http://apache.org/hello_world_soap_http", "SoapPort1");

        SOAPService1 service1 = new SOAPService1(wsdlURL, serviceName1);

Cheers,
Jervis


> -----Original Message-----
> From: Eric Le Goff [mailto:elegoff@gmail.com]
> Sent: 2007年12月7日 23:47
> To: cxf-user@incubator.apache.org
> Subject: jaxws_dispatch_provider demo
> 
> I have playing with the jaxws_dispatch_provider demo sample after a
> recent svn checkout
> 
> Then I tried to update the source files to try and understand how this
> works ;)
> 
> 1 )  in wdsl/hello_world.wsdl
> 
> I replaced every occurence of
> "http://apache.org/hello_world_soap_http"
> to
> "http://foobar.com/my_soap_http"
> 
> 
> 2) In Client.java
> 
> I replaced the
> import org.java.hello_world_http.*;
> to
> import com.foobar.my_soap_http.*;
> 
> 
> 3) In each GreetMeDocLiteral*.xml  (server & client)
> I replaced every namespace occurence of
> "http://apache.org/hello_world_soap_http"
> to
> "http://foobar.com/my_soap_http"
> 
> 4) In GreeterSoapProvider
> I updated the targetNamespace to "http://foobar.com/my_soap_http"
> 
> 
> 
> 
> 
> Now I am certainly missing something because I get an Exception... I
> know I am a bad guy, and I should not have touched the nice demo ;)
> , but I am puzzled with the stack trace :
> 
> 
> [java] INFO: Interceptor has thrown exception, unwinding now
>      [java] org.apache.cxf.interceptor.Fault: Unable to create
> envelope from given source:
>      [java] 	at
> org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor$PostDi
> spatchSOAPHandlerInterceptor.handleMessage(DispatchInDatabindingInterc
> eptor.java:225)
>      [java] 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> hain.java:207)
>      [java] 	at
> org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:312)
>      [java] 	at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleR
> esponse(HTTPConduit.java:1948)
>      [java] 	at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(H
> TTPConduit.java:1791)
>      [java] 	at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
>      [java] 	at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
> [...]
> java] Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable
> to create envelope from given source:
>      [java] 	at
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(Envelop
> eFactory.java:114)
>      [java] 	at
> com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelope
> FromSource(SOAPPart1_1Impl.java:71)
> 
> [...]
>    [java] Caused by: javax.xml.transform.TransformerException:
> org.xml.sax.SAXParseException: Premature end of file.
>      [java] 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Tra
> nsformerImpl.java:673)
>      [java] 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Tra
> nsformerImpl.java:300)
>      [java] 	at
> com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransformer.tr
> ansform(EfficientStreamingTransformer.java:390)
>      [java] 	at
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(Envelop
> eFactory.java:102)
>      [java] 	... 15 more
>      [java] Caused by: org.xml.sax.SAXParseException: Premature end of
> file.
>      [java] 	at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abstra
> ctSAXParser.java:1269)
>      [java] 	at
> org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
>      [java] 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIde
> ntity(TransformerImpl.java:607)
>      [java] 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Tra
> nsformerImpl.java:661)
>      [java] 	... 18 more
> 
> 
> This "premature end of file" is very strange to me. I guess I forgot
> to update another piece of code to make it run from an updated
> hello_world.wsdl file.
> 
> Any help to understand would be appreciated
> 
> 
> 
> --
> Eric Le Goff

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: jaxws_dispatch_provider demo

Posted by James Mao <ja...@iona.com>.
Haven't looked it deeper, but firstly you should check if the modified 
xml still well-formed, you can check that with a browser.

Cheers,
James

> I have playing with the jaxws_dispatch_provider demo sample after a
> recent svn checkout
>
> Then I tried to update the source files to try and understand how this works ;)
>
> 1 )  in wdsl/hello_world.wsdl
>
> I replaced every occurence of
> "http://apache.org/hello_world_soap_http"
> to
> "http://foobar.com/my_soap_http"
>
>
> 2) In Client.java
>
> I replaced the
> import org.java.hello_world_http.*;
> to
> import com.foobar.my_soap_http.*;
>
>
> 3) In each GreetMeDocLiteral*.xml  (server & client)
> I replaced every namespace occurence of
> "http://apache.org/hello_world_soap_http"
> to
> "http://foobar.com/my_soap_http"
>
> 4) In GreeterSoapProvider
> I updated the targetNamespace to "http://foobar.com/my_soap_http"
>
>
>
>
>
> Now I am certainly missing something because I get an Exception... I
> know I am a bad guy, and I should not have touched the nice demo ;)
> , but I am puzzled with the stack trace :
>
>
> [java] INFO: Interceptor has thrown exception, unwinding now
>      [java] org.apache.cxf.interceptor.Fault: Unable to create
> envelope from given source:
>      [java] 	at
> org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor$PostDispatchSOAPHandlerInterceptor.handleMessage(DispatchInDatabindingInterceptor.java:225)
>      [java] 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
>      [java] 	at
> org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:312)
>      [java] 	at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1948)
>      [java] 	at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
>      [java] 	at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
>      [java] 	at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
> [...]
> java] Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable
> to create envelope from given source:
>      [java] 	at
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:114)
>      [java] 	at
> com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:71)
>
> [...]
>    [java] Caused by: javax.xml.transform.TransformerException:
> org.xml.sax.SAXParseException: Premature end of file.
>      [java] 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:673)
>      [java] 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
>      [java] 	at
> com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:390)
>      [java] 	at
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102)
>      [java] 	... 15 more
>      [java] Caused by: org.xml.sax.SAXParseException: Premature end of file.
>      [java] 	at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1269)
>      [java] 	at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
>      [java] 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:607)
>      [java] 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:661)
>      [java] 	... 18 more
>
>
> This "premature end of file" is very strange to me. I guess I forgot
> to update another piece of code to make it run from an updated
> hello_world.wsdl file.
>
> Any help to understand would be appreciated
>
>
>
>