It appears that Tomcat 4.0.4 suppresses Content-Type when there is no content. For Tomcat 4.0.1, I got a response of
HTTP/1.1 200 OK Content-Type: text/xml Content-Length: 0 Date: Mon, 09 Dec 2002 17:59:59 GMT Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector) Scott Nichol ----- Original Message ----- From: "Sauquet Dominique" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 12:14 PM Subject: RE: Newbie question Hi thank you Scott for your help. Here is what I get in the TcpTunnelGui window (same as in Tomcat window !!) : on the left : POST /VoiceXML/servlet/HTTPReceive HTTP/1.0 Host: dsauquet:81 Content-Type: text/xml; charset=utf-8 Content-Length: 695 SOAPAction: "urn:oreilly-jaws-samples" Accept-Encoding: x-gzip <?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <PurchaseOrder xmlns="urn:oreilly-jaws-samples"> <shipTo country="US"> <name>Joe Smith</name> <street>14 Oak Park</street> <city>Bedford</city> <state>MA</state> <zip>01730</zip> </shipTo> <items> <item partNum="872-AA"> <productName>Candy Canes</productName> <quantity>444</quantity> <price>1.68</price> <comment>I want candy!</comment> </item> </items> </PurchaseOrder> </SOAP-ENV:Body> </SOAP-ENV:Envelope> on the right : HTTP/1.1 200 OK Content-Length: 0 Date: Mon, 09 Dec 2002 17:37:47 GMT Server: Apache Tomcat/4.0.4 (HTTP/1.1 Connector) and in my dos window where I start the client : _________________________________________________________ Starting SimpleGenericHTTPSoapClient: host url = http://dsauquet:81/VoiceXML/servlet/HTTPReceive data file = ./PO.xml ___________________________________________________________ step 1: URI :urn:oreilly-jaws-samples step 1: envelope :[Attributes={ xmlns:xsi="http://www.w3.org/2001/XMLSchema-ins tance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schem as.xmlsoap.org/soap/envelope/"}] [Header=null] [Body=[Attributes={}] [BodyEntrie s= [(0)=[PurchaseOrder: null]] ]] [EnvelopeEntries=] step 1: target :http://dsauquet:81/VoiceXML/servlet/HTTPReceive [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 nt.java:91) at SimpleGenericHTTPSoapClient.main(SimpleGenericHTTPSoapClient.java:171 ) Thanks a lot Dominique -----Message d'origine----- De : Scott Nichol [mailto:[EMAIL PROTECTED]] Envoyé : lundi 9 décembre 2002 16:11 À : [EMAIL PROTECTED] Objet : Re: Newbie question 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" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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 > <mailto:[EMAIL PROTECTED]> > > Prosodie > 150, rue Galliéni > 92100 Boulogne > <http://www.prosodie.com/> > > > ------------------------------------------------------------------------ -------- > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>