Problems with content-type

I've build a web service and deployed it using tomcat and JAXRPC.

The only method that I invoke is called getResponses with a parameter of type String wich is a well formed xml doc.

When I try to do this the program raise the following exception.

[java] javax.xml.soap.SOAPException: Invalid Content-Type:text/html

[java] at com.sun.xml.messaging.soap.MessageImpl.verify(MessageImpl.java:159)

[java] at com.sun.xml.messaging.soap.MessageImpl.<init>(MessageImpl.java:91)

[java] at com.sun.xml.messaging.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:32)

[java] at com.sun.xml.rpc.client.http.HttpClientTransport.invoke(HttpClientTransport.java:136)

[java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:59)

[java] at SmsWS.SmsWSIF_Stub.getResponses(Unknown Source)

[java] at SmsWS.SmsWSClient.main(Unknown Source)

[java] java.rmi.RemoteException: HTTP transport error: javax.xml.soap.SOAPException: Unable to internalize message...

I wonder if the problem reside on the format of the string (represents an xml doc), if it's compatible with a SOAP message content.

How can I eventually set the content-type to, for example, plain-text or whatever else?

Can anybody help me to solve this problem?

Thanks

[1356 byte] By [marcrist] at [2007-9-19]
# 1
I've got the same problem. Is it a JAXRPC Api problem? My Soap message only contains a string...Have you resolved?thanks.Andrea
andytv at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 2
i've tried to debug stub class. soapPart remains empty, but i don't think this is the real problem. anyone can help?Andrea
andytv at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 3
JAXRPC Servlet responds sending a HTML page that contains the directory of web application. Seems that it don't recognize a soap call... anyone can help?
andytv at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 4

I think I've found the solution. You must modify the endpoint address: in web.xml configuration file there is

<servlet-mapping>

<servlet-name>JAXRPCEndpoint</servlet-name>

<url-pattern>/jaxrpc/*</url-pattern>

</servlet-mapping>

so, your endpoint must be : "http://yourhost:yourport/yourWebService/jaxrpc/yourMethodtoInvoke".

by this way, my Web Service works fine, stub and ties classes are ok.

andytv at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 5
you need to start Xindice DB before running the CoffeeBreak application.goto JWSDPHomeDir/bin/ and run xindice-start.sh (Linux) xindice-start.bat (Windows)this will start the Registry Server. It fixed the problem for me.
suganc at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 6

Its over a year since this message was posted, but I am having the same problem. Started xindice as suggested in one of the replies but of no avail. Could you please tell what exactly should web.xml look like? I tried replacing JAXRPCEndpoint with the name of the servlet but it didn't work either. Any help is highly appreciated.

Thanks,

ashish7s_ at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...