Oops, I was wrong, it wasn't the code below failing, it was the second attempt
using the wsdl2java classes that failed...
final APASQueueServiceStub service;
service = new APASQueueServiceStub();
APASQueueServiceStub.GetHostInstitution hostInst;
hostInst = new APASQueueServiceStub.GetHostInstitution();
APASQueueServiceStub.GetHostInstitutionResponse resp =
service.GetHostInstitution(hostInst);
System.out.println("Institution: " +
resp.getGetHostInstitutionResult().getEducationalInstitutionName());
I can post the WSDL if you like.
Trenton D. Adams
Systems Analyst/Web Software Engineer
Navy Penguins at your service!
Athabasca University
(780) 675-6195
:wq!
----- "Trenton D. Adams" <[email protected]> wrote:
> From: "Trenton D. Adams" <[email protected]>
> To: "axis-user" <[email protected]>
> Sent: Tuesday, May 12, 2009 9:49:05 AM GMT -07:00 US/Canada Mountain
> Subject: axis 2 unexpected Subelement
>
> Hi Guys,
>
> I can't figure out why I'm getting this error; is there something
> wrong with the service's XML output?
>
> ServiceClient client;
> client = new ServiceClient();
> Options options = new Options();
> options.setTo(new
> EndpointReference("https://apasproxy.athabascau.ca/axis/services/APASQueueService"));
> client.setOptions(options);
> OMElement request;
> OMFactory factory;
> factory = OMAbstractFactory.getOMFactory();
> request = factory.createOMElement(new
> QName("http://APASProxy.DataTypes/2007/04/", "GetHostInstitution"));
> OMElement response;
> response = client.sendReceive(request);
> System.out.println(response.toString());
>
> <GetHostInstitutionResponse
> xmlns="http://APASProxy.DataTypes/2007/04/"><ns1:GetHostInstitutionResult
> xmlns:ns1="http://APASProxy.DataTypes/2007/04"><ns1:SourceId>48002000</ns1:SourceId><ns1:EducationalInstitutionName>Athabasca
> University</ns1:EducationalInstitutionName></ns1:GetHostInstitutionResult></GetHostInstitutionResponse>
> org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException:
> Unexpected subelement GetHostInstitutionResult
> at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
> at
> servicecontracts.apasproxy._2007._04.APASQueueServiceStub.fromOM(APASQueueServiceStub.java:35302)
> at
> servicecontracts.apasproxy._2007._04.APASQueueServiceStub.GetHostInstitution(APASQueueServiceStub.java:2467)
> at ca.athabascau.apas.APAS.main(APAS.java:70)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
> Caused by: java.lang.Exception:
> org.apache.axis2.databinding.ADBException: Unexpected subelement
> GetHostInstitutionResult
> at
> servicecontracts.apasproxy._2007._04.APASQueueServiceStub$GetHostInstitutionResponse$Factory.parse(APASQueueServiceStub.java:12645)
> at
> servicecontracts.apasproxy._2007._04.APASQueueServiceStub.fromOM(APASQueueServiceStub.java:35226)
> ... 7 more
> Caused by: org.apache.axis2.databinding.ADBException: Unexpected
> subelement GetHostInstitutionResult
> at
> servicecontracts.apasproxy._2007._04.APASQueueServiceStub$GetHostInstitutionResponse$Factory.parse(APASQueueServiceStub.java:12639)
> ... 8 more
>
> Process finished with exit code 0
>
>
>
> Trenton D. Adams
> Systems Analyst/Web Software Engineer
> Navy Penguins at your service!
> Athabasca University
> (780) 675-6195
> :wq!
>
> __
> This communication is intended for the use of the recipient to
> whom it
> is addressed, and may contain confidential, personal, and or
> privileged
> information. Please contact us immediately if you are not the
> intended
> recipient of this communication, and do not copy, distribute, or
> take
> action relying on it. Any communications received in error, or
> subsequent reply, should be deleted or destroyed.
> ---