Warm greetings Everybody...i had come across a
problem when working out an example from a tutorial
"Registering and publishing your Web
service" by Mr. Graham Glass..I am working behind the
firewall so to authenticate the proxy server i have
added these lines in the given code
SOAPHTTPConnection s = new SOAPHTTPConnection();
s.setUserName("username");
s.setPassword("password");
s.setProxyHost("host");
s.setProxyPort(8080);
UDDIProxy uddi = new UDDIProxy();
uddi.setTransport(s);
But when i was trying to run the code it was giving an
exception
**************************************************
[SOAPException: faultCode=SOAP-ENV:Protocol;
msg=Unsupported response content type "text/html",
must be: "text/xml". Response was:
<html><head><title>Error 407</title>
<meta name="robots" content="noindex">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1"></head>
<body>
<h2>HTTP Error 407</h2>
<p><strong>407 Proxy Authentication
Required</strong></p>
<p>You must authenticate with a proxy server before
this request can be serviced. Please log on to your
proxy server, and then try again.</p>
<p>Please contact the Web server's administrator if
this problem persists.</p>
</body></html>
]
at
org.apache.soap.rpc.Call.getEnvelopeString(Call.java:173)
at
org.apache.soap.messaging.Message.receiveEnvelope(Message.java:141)
at
com.ibm.uddi.client.UDDIProxy.send(UDDIProxy.java:1219)
at
com.ibm.uddi.client.UDDIProxy.send(UDDIProxy.java:1187)
at
com.ibm.uddi.client.UDDIProxy.find_business(UDDIProxy.java:192)
at Client1.main(Client1.java, Compiled Code)
Exception in thread "main" Normal Termination
*******************************************************
So I look into the source code(after decompiling
SOAPHttpConnection.class) for
SOAPHttpConnection.java (In SOAP 2.0) and i find out
that there was a line
hashtable.put("Authorization", s3);
But i think In place of "Authorization" this should be
"Proxy-Authorization" so i replace the above line with
hashtable.put("Proxy-Authorization", s3);
and again run the example(ofcourse after compiling
SOAPHttpConnection.java -:) ) this time there was no
problem and i got the results.
The same problem i found in SOAP 2.1 in this version
if we change the line
public static final String HEADER_AUTHORIZATION =
"Authorization";
to
public static final String HEADER_AUTHORIZATION =
"Proxy-Authorization"; in Constants.java
then it works properly.
Please let me know if i m wrong somewhere. I have
downloaded the SOAP.jar file from the IBM site
alongwith web service toolkit.
Thanx and Warm Regards
Mohammad Nauman
=====
MOHAMMAD NAUMAN
IBM Global Services Pvt. Ltd.
Parvaaz Building; Shankar Seth Road
Pune - 4110001, Maharashtra
India
Phone 91-20-6349724 ext: 1104
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/