You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Sauquet Dominique <ds...@prosodie.com> on 2002/12/03 14:35:27 UTC

Newbie question

Hi
I am a newbie to SOAP and my problem is the following :
I have downloaded examples from the OReilly book JavaWebServices.

If I try the very simple SimpleGenericHTTPSoapClient and if this client
sends its SOAP
message to a very simple servlet which is "SOAP unaware" it works
 
 <<SimpleGenericHTTPSoapClient.java>> 

If I use the same code and if the message is sent to a Servlet that is SOAP
"aware"
the message is received by the servlet BUT in my client I get the following
exception
in the send method :

SOAPException: faultCode=SOAP-ENV:Protocol; msg=Missing content type.]
       at org.apache.soap.transport.TransportMessage.read(Unknown Source)
       at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
       at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
       at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown
Source

       at org.apache.soap.messaging.Message.send(Unknown Source)
       at org.apache.soap.messaging.Message.send(Unknown Source)
       at
SimpleGenericHTTPSoapClient.sendSOAPMessage(SimpleGenericHTTPSoapClie
t.java:91)
       at
SimpleGenericHTTPSoapClient.main(SimpleGenericHTTPSoapClient.java:171


The 2 servlets are :

 <<SimpleHTTPReceive.java>>  <<HTTPReceive.java>> 


thanks a lot with your help

> Dominique Sauquet
> Direction des Moyens Informatiques
> Tel : 01 46 84 13 12
> <ma...@prosodie.com>
> 
> Prosodie	
> 150, rue Galliéni
> 92100 Boulogne
> <http://www.prosodie.com/>
> 
> 
> 

Re: Newbie question

Posted by Scott Nichol <sn...@scottnichol.com>.
I saved the attached files, compiled them, deployed the servlets, and
everything works for me.

Is the servlet doing what you expect, i.e. does it print the headers and
body elements?  If not, there is something wrong with your deployment,
e.g. there is no XML parser or the Apache SOAP classes cannot be loaded.
If the servlet does do what you expect, then I recommend you look at the
SOAP response directly.  If you are working with client and server on
separate machines, you can use a network sniffer (such as tcpdump on
Unix/Linux or network monitor on win2k).  If your client and server are
on a single machine, you need to use a proxy or relay.  Apache SOAP
includes a relay, TcpTunnelGui.  You start it like

    java org.apache.soap.util.net.TcpTunnelGui 81 localhost 8080

which tells it to listen on port 81 and relay to port 8080 (which should
be replaced by the port on which your servlet can be found).  You then
point the client port 81 instead, e.g.

    java SimpleGenericHTTPSoapClient -url
http://localhost:81/examples/servlet/SimpleHTTPReceive

Scott Nichol

----- Original Message -----
From: "Sauquet Dominique" <ds...@prosodie.com>
To: <so...@xml.apache.org>
Sent: Tuesday, December 03, 2002 8:35 AM
Subject: Newbie question


Hi
I am a newbie to SOAP and my problem is the following :
I have downloaded examples from the OReilly book JavaWebServices.

If I try the very simple SimpleGenericHTTPSoapClient and if this client
sends its SOAP
message to a very simple servlet which is "SOAP unaware" it works

 <<SimpleGenericHTTPSoapClient.java>>

If I use the same code and if the message is sent to a Servlet that is
SOAP
"aware"
the message is received by the servlet BUT in my client I get the
following
exception
in the send method :

SOAPException: faultCode=SOAP-ENV:Protocol; msg=Missing content type.]
       at org.apache.soap.transport.TransportMessage.read(Unknown
Source)
       at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
       at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
       at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown
Source

       at org.apache.soap.messaging.Message.send(Unknown Source)
       at org.apache.soap.messaging.Message.send(Unknown Source)
       at
SimpleGenericHTTPSoapClient.sendSOAPMessage(SimpleGenericHTTPSoapClie
t.java:91)
       at
SimpleGenericHTTPSoapClient.main(SimpleGenericHTTPSoapClient.java:171


The 2 servlets are :

 <<SimpleHTTPReceive.java>>  <<HTTPReceive.java>>


thanks a lot with your help

> Dominique Sauquet
> Direction des Moyens Informatiques
> Tel : 01 46 84 13 12
> <ma...@prosodie.com>
>
> Prosodie
> 150, rue Galliéni
> 92100 Boulogne
> <http://www.prosodie.com/>
>
>
>



------------------------------------------------------------------------
--------


> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>


Re: Newbie question

Posted by Scott Nichol <sn...@scottnichol.com>.
I saved the attached files, compiled them, deployed the servlets, and
everything works for me.

Is the servlet doing what you expect, i.e. does it print the headers and
body elements?  If not, there is something wrong with your deployment,
e.g. there is no XML parser or the Apache SOAP classes cannot be loaded.
If the servlet does do what you expect, then I recommend you look at the
SOAP response directly.  If you are working with client and server on
separate machines, you can use a network sniffer (such as tcpdump on
Unix/Linux or network monitor on win2k).  If your client and server are
on a single machine, you need to use a proxy or relay.  Apache SOAP
includes a relay, TcpTunnelGui.  You start it like

    java org.apache.soap.util.net.TcpTunnelGui 81 localhost 8080

which tells it to listen on port 81 and relay to port 8080 (which should
be replaced by the port on which your servlet can be found).  You then
point the client port 81 instead, e.g.

    java SimpleGenericHTTPSoapClient -url
http://localhost:81/examples/servlet/SimpleHTTPReceive

Scott Nichol

----- Original Message -----
From: "Sauquet Dominique" <ds...@prosodie.com>
To: <so...@xml.apache.org>
Sent: Tuesday, December 03, 2002 8:35 AM
Subject: Newbie question


Hi
I am a newbie to SOAP and my problem is the following :
I have downloaded examples from the OReilly book JavaWebServices.

If I try the very simple SimpleGenericHTTPSoapClient and if this client
sends its SOAP
message to a very simple servlet which is "SOAP unaware" it works

 <<SimpleGenericHTTPSoapClient.java>>

If I use the same code and if the message is sent to a Servlet that is
SOAP
"aware"
the message is received by the servlet BUT in my client I get the
following
exception
in the send method :

SOAPException: faultCode=SOAP-ENV:Protocol; msg=Missing content type.]
       at org.apache.soap.transport.TransportMessage.read(Unknown
Source)
       at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
       at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
       at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown
Source

       at org.apache.soap.messaging.Message.send(Unknown Source)
       at org.apache.soap.messaging.Message.send(Unknown Source)
       at
SimpleGenericHTTPSoapClient.sendSOAPMessage(SimpleGenericHTTPSoapClie
t.java:91)
       at
SimpleGenericHTTPSoapClient.main(SimpleGenericHTTPSoapClient.java:171


The 2 servlets are :

 <<SimpleHTTPReceive.java>>  <<HTTPReceive.java>>


thanks a lot with your help

> Dominique Sauquet
> Direction des Moyens Informatiques
> Tel : 01 46 84 13 12
> <ma...@prosodie.com>
>
> Prosodie
> 150, rue Galliéni
> 92100 Boulogne
> <http://www.prosodie.com/>
>
>
>



------------------------------------------------------------------------
--------


> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>