Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

403 Forbidden Error, while trying to make a webservice call  RSS feed

 
Biswajit Paria
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Everyone,
I am facing a problem while trying to make a webservice call.
Its giving me 403 Forbidden error. The Webservice is running on WebLogic server and I am trying to make a call through a standalone java class.

As this call goes through proxy, here is the classpath setting details:
-Dhttp.proxyHost=ema-ca-http.csfb.net
-Dhttp.proxyPort=8080
-Dweblogic.webservice.transport.http.proxy.host=ema-ca-http.csfb.net
-Dweblogic.webservice.transport.http.proxy.port=8080
-Dweblogic.webservice.verbose=true

Code Details:
***********
ArchiveSearchServiceSoap arServ = new ArchiveSearchService_Impl("http://wbsrvc.relegence.com/Services/ArchiveSearchService.asmx?wsdl").getArchiveSearchServiceSoap("test","test");//

Request request = new Request();
Response response;
ArrayList myQueries = new ArrayList();
PhraseQuery PH = new PhraseQuery();
PH.setUserQueryString("test");
myQueries.add(PH);
PaginationDefinition pd = new PaginationDefinition();
pd.setDocumentsPerPage(40);
pd.setPageNumber(pd.getPageNumber()+1);
request.setPageDefinitions(pd);
request.setQueries((Query[])myQueries.toArray( new Query[myQueries.size()]));


response = arServ.search(request); //..Getting Error here !


Error Details:
****************
java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: The server at http://wbsrvc.relegence.com/Services/ArchiveSearchService.asmx returned a 403 error code (Forbidden). Please ensure that your URL is correct and that the correct protocol is in use.; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: The server at http://wbsrvc.relegence.com/Services/ArchiveSearchService.asmx returned a 403 error code (Forbidden). Please ensure that your URL is correct and that the correct protocol is in use.
at com.csfb.equity.wt.webservice.relegencesearch.ArchiveSearchServiceSoap_Stub.search(ArchiveSearchServiceSoap_Stub.java:38)
at com.csfb.equity.wt.webservice.relegencesearch.ArchiveSearchServiceSoap_Stub.search(ArchiveSearchServiceSoap_Stub.java:58)
at com.csfb.equity.wt.internet.RelegenceWebServiceClientProtocol.connectRelegence(RelegenceWebServiceClientProtocol.java:114)
at com.csfb.equity.wt.internet.RelegenceWebServiceClientProtocol.main(RelegenceWebServiceClientProtocol.java:126)
Caused by: javax.xml.rpc.soap.SOAPFaultException: The server at http://wbsrvc.relegence.com/Services/ArchiveSearchService.asmx returned a 403 error code (Forbidden). Please ensure that your URL is correct and that the correct protocol is in use.
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:498)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:360)
at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:244)
at com.csfb.equity.wt.webservice.relegencesearch.ArchiveSearchServiceSoap_Stub.search(ArchiveSearchServiceSoap_Stub.java:33)



Could you please help me out, Do I need to set any classpath variable or anythings else? As user/password and URL are correct.

Regards,
Biswajit.
 
Karthik Rajendiran
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friend
HOw are you passing the user id and password
1.If it is basic authentication, you can pass it as arguments
2. Are you able to access the service atleast in browser without client java program. Give us more detail about the java class program you write.How are you generating the stubs?

Regards
Karthik R
 
Biswajit Paria
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karthik Rajendiran,

Thanks for showing interest.

Yes, It is using BASIC authentication and I am able to access the this service in browser without client java program.

Please let me anything more information required.

Thanks,
Biswajit.
 
Paul Bourdeaux
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know I am digging up an old thread, but I recently came across the same problem and was wondering if anybody has a solution.

I am using OC4J, and have AXIS installed. I have two web services running, one that requires authentication, one that does not.

The web service that does not require authentication works correctly. The one that does will give me a 403, but only after entering the correct credentials. If I enter in the incorrect credentials, I get a 401 (as expected).

This tells me that it is authentication correctly, and there is something else in the OC4J config that is preventing the server from returning the page... but only if it is subject to authentication.

FYI, I took authentication off from both web services and they both work correctly. If I add it back in again, the same web service fails.

Very frustrating. Any ideas? Thanks in advance for any help!
 
Paul Bourdeaux
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An update to last, we were able to get it to work... kind of.

The problem is that the new role that we defiend in the system-jazn and the web.xml wasn't working. When we changed the security over to restrict the web service to the users role, it works correctly. Now we are left trying to figure out what we did wrong with the role. Here is some of the code we are using...

web.xml


system-jazn-data.xml

[ September 11, 2008: Message edited by: Paul Bourdeaux ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!