Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unsupported response content type "text/html", must be: "tex

843834May 17 2004 — edited Apr 24 2007
Hi Gurus,

I'm trying to access a WebService (http://200.68.11.21/WebServices/RecibeMsgSoapISP.wsdl), but I've been facing the following problem below. Could anybody help me?

//****************************** MY CODE
FileInputStream file = new FileInputStream("c:\\EXE\\deuda2.xml");
byte[] bytes = new byte[file.available()];
file.read(bytes);
String xml = new String(bytes);
System.out.println("Xml:\n" + xml);

URL endPoint =
new URL(
"http://200.68.11.21/WebServices/RecibeMsgSoapISP.wsdl");
Call call = new Call();
SOAPTransport m_httpConnection =
new org.apache.soap.transport.http.SOAPHTTPConnection();
call.setSOAPTransport(m_httpConnection);
call.setTargetObjectURI("urn:RecibeMsgSoapIsp");
call.setMethodName("RecibeM2TGR");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
//SOAPTransport st = new SOAPHTTPConnection();
//call.setSOAPTransport(st);
Vector params = new Vector();
params.addElement(new Parameter("StrXml", String.class, xml, null));
call.setParams(params);
//call.setHeader();
Response response = call.invoke(endPoint, "");
Parameter result = response.getReturnValue();
System.out.println("result:" + result);


//****************************** MY EXCEPTION
[SOAPException: faultCode=SOAP-ENV:Protocol; msg=Unsupported response content type "text/html", must be: "text/xml". Response was:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html dir=ltr>
<head>
<style> a:link {font:8pt/11pt verdana; color:FF0000} a:visited {font:8pt/11pt verdana; color:#4e4e4e}
</style>
<META NAME="ROBOTS" CONTENT="NOINDEX">
<title>No se puede mostrar la p&aacute;gina</title>
<META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
</head>
<script>
function Homepage(){
<!--
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
//For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
DocURL=document.URL;
//this is where the http or https will be, as found by searching for :// but skipping the res://
protocolIndex=DocURL.indexOf("://",4);
//this finds the ending slash for the domain server
serverIndex=DocURL.indexOf("/",protocolIndex + 3);
//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
//urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
BeginURL=DocURL.indexOf("#",1) + 1;
urlresult=DocURL.substring(BeginURL,serverIndex);
//for display, we need to skip after http://, and go to the next slash
displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
InsertElementAnchor(urlresult, displayresult);
}
function HtmlEncode(text)
{
return text.replace(/&/g, &apos;&amp&apos;).replace(/&apos;/g, &apos;&quot;&apos;).replace(/</g, &apos;&lt;&apos;).replace(/>/g, &apos;&gt;&apos;);
}
function TagAttrib(name, value)
{
return &apos; &apos;+name+&apos;="&apos;+HtmlEncode(value)+&apos;"&apos;;
}
function PrintTag(tagName, needCloseTag, attrib, inner){
document.write( &apos;<&apos; + tagName + attrib + &apos;>&apos; + HtmlEncode(inner) );
if (needCloseTag) document.write( &apos;</&apos; + tagName +&apos;>&apos; );
}
function URI(href)
{
IEVer = window.navigator.appVersion;
IEVer = IEVer.substr( IEVer.indexOf(&apos;MSIE&apos;) + 5, 3 );
return (IEVer.charAt(1)==&apos;.&apos; && IEVer >= &apos;5.5&apos;) ?
encodeURI(href) :
escape(href).replace(/%3A/g, &apos;:&apos;).replace(/%3B/g, &apos;;&apos;);
}
function InsertElementAnchor(href, text)
{
PrintTag(&apos;A&apos;, true, TagAttrib(&apos;HREF&apos;, URI(href)), text);
}
//-->
</script>
<body bgcolor="FFFFFF">
<table width="410" cellpadding="3" cellspacing="5">
<tr>
<td align="left" valign="middle" width="360">
<h1 style="COLOR:000000; FONT: 13pt/15pt verdana"><!--Problem-->No se puede mostrar la p&aacute;gina</h1>
</td>
</tr>
<tr>
<td width="400" colspan="2"> <font style="COLOR:000000; FONT: 8pt/11pt verdana">No se puede mostrar la p&aacute;gina que est&aacute; buscando porque la direcci&oacute;n de la p&aacute;gina es incorrecta.</font> </td>
</tr>
<tr>
<td width="400" colspan="2"> <font style="COLOR:000000; FONT: 8pt/11pt verdana">
<hr color="#C0C0C0" noshade>
<p>Pruebe lo siguiente:</p>
<ul>
<li>Si escribi&oacute; la direcci&oacute;n de la p&aacute;gina en la barra de direcciones, compruebe que la ha escrito correctamente.<br>
</li>
<li>Abra la p&aacute;gina principal

<script>
<!--
if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))
{
Homepage();
}
//-->
</script>
y busque v&iacute;nculos a la informaci&oacute;n que desee.</li>
</ul>
<h2 style="COLOR:000000; FONT: 8pt/11pt verdana">HTTP 405 &ndash; Resource not allowed<br> Servicios de Internet Information Server</h2>
<hr color="#C0C0C0" noshade>
<p>Informaci&oacute;n t&eacute;cnica (para personal de soporte)</p>
<ul>
<li>M&aacute;s informaci&oacute;n:<br> Soporte t&eacute;cnico de Microsoft
</li>
</ul>
</font></td>
</tr>
</table>
</body>
</html>
]
at org.apache.soap.rpc.Call.getEnvelopeString(Call.java:208)
at org.apache.soap.rpc.Call.invoke(Call.java:255)
at test.Test.main(Test.java:42)

Best regards,
George
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 22 2007
Added on May 17 2004
3 comments
755 views