| Author |
Axis2 Transport error calling stub
|
Mat Anthony
Ranch Hand
Joined: May 21, 2008
Posts: 195
|
|
Hi All,
I have created the following test to call my service, but on calling stub.findPersonID
the following error gets thrown
org.apache.axis2.AxisFault: Transport error: 302 Error: Moved Temporarily
Has anybody got any idea???
package org.test.common.service.impl;
import org.test.common.service.impl.MyServiceImplStub;
public class MyServiceTest
{
public static void main(String[] args)
{
try{
MyServiceImplStub stub = new MyServiceImplStub();
webservice.common.opus.xsd.FindPersonIDDocument document =webservice.common.opus.xsd.FindPersonIDDocument.Factory.newInstance();
webservice.common.opus.xsd.FindPersonIDDocument.FindPersonID findPersonID=
webservice.common.opus.xsd.FindPersonIDDocument.FindPersonID.Factory.newInstance();
long personId=3579470;
findPersonID.setPersonId(personId);
document.setFindPersonID(findPersonID);
System.out.println("personId="+stub.findPersonID(document).toString());
}catch(Exception e){System.out.println(e);}
}
}
|
 |
Mat Anthony
Ranch Hand
Joined: May 21, 2008
Posts: 195
|
|
Hi All,
I'm currently using acegi security and have to go threw a class that implements AuthenticationEntryPoint, before
forwarding the request to my web service.
My previous error was caused by:-
httpServletResponse.sendRedirect(full)
instead of using:-
RequestDispatcher dispatcher = httpServletRequest.getRequestDispatcher(httpServletResponse.toString());
dispatcher.forward(httpServletRequest, httpServletResponse);
I'm now getting the following response back:-
org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found HTML
I have added the following lines to my client code above, to solve this problem:-
HttpTransportProperties.Authenticator authenticator = new HttpTransportProperties.Authenticator();
authenticator.setUsername("12345");
authenticator.setPassword("password");
authenticator.setPreemptiveAuthentication(true);
stub._getServiceClient().getOptions().
setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,
Boolean.FALSE);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTHENTICATE, authenticator);
Has any body got any idea.
|
 |
 |
|
|
subject: Axis2 Transport error calling stub
|
|
|