File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Axis2 client - SOAPProcessingException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis2 client - SOAPProcessingException" Watch "Axis2 client - SOAPProcessingException" New topic
Author

Axis2 client - SOAPProcessingException

shannon rocks
Greenhorn

Joined: Nov 20, 2007
Posts: 7
Hi,

Am building a wrapper webservice using Axis2 1.3 for an existing sharepoint webservice. Once i build the web service client, i write a test class to invoke the sharepoint webservice to retrieve a list of items; what am running into is an exception stack which says "org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found html"

Any kind of help is greatly apperciated.

please find the code below:
---------------------------
ListsStub proxy = new ListsStub();

HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();

List schemes = new ArrayList();

schemes.add(HttpTransportProperties.Authenticator.NTLM);
auth.setAuthSchemes(schemes);
auth.setUsername("username");
auth.setPassword("password");
auth.setDomain("domain");
auth.setHost("host");

/*proxy._getServiceClient().getOptions().setProperty(
org.apache.axis2.transport.http.HTTPConstants.CHUNKED,
Boolean.FALSE);*/

proxy._getServiceClient().getOptions().setProperty(
org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
auth);

GetListItems getListItems = new com.microsoft.schemas.sharepoint.soap.ListsStub.GetListItems();
GetListItemsResponse response = new GetListItemsResponse();

response = proxy.GetListItems(getListItems);

Exception stack:
----------------
[INFO] OMException in getSOAPBuilder
org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found html
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:219)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:177)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:163)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:161)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:110)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:609)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:178)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:111)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:87)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:326)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at com.microsoft.schemas.sharepoint.soap.ListsStub.GetListItems(ListsStub.java:2288)
at com.uboc.test.TestingWS.main(TestingWS.java:40)
Exception in thread "main" org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found html
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:89)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:326)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at com.microsoft.schemas.sharepoint.soap.ListsStub.GetListItems(ListsStub.java:2288)
at com.uboc.test.TestingWS.main(TestingWS.java:40)
Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found html
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:219)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:177)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:163)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:161)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:110)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:609)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:178)

thank you.

Regards,
Sharon
shannon rocks
Greenhorn

Joined: Nov 20, 2007
Posts: 7
What is the cause of this problem? How do i fix this? Please advice and help.

Thanks in advance
Sharon
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis2 client - SOAPProcessingException