aspose file tools
The moose likes Web Services and the fly likes Axis2 Transport error calling stub Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Axis2 Transport error calling stub" Watch "Axis2 Transport error calling stub" New topic
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Axis2 Transport error calling stub
 
Similar Threads
Calling .NET webservice from java client
Axis2 client to invoke NTLM .NET WCF web services
unable to run GetListItems Webservice
Extract SOAP object from HttpServletRequest
RMI with JavaSE 6 - UnicastRemoteObject.exportObject(Remote object) fails