Hi Guys,

I'm a newbie, and I'm using axis-1.4.  I have a web service that I am 
connecting to, which I did not write, which was written using axis-1.4.  I am 
having problems using the WSDL2Java generated files, as well as using the soap 
call api.  Neither appear to work as expected.

I'm almost at my wits end, and feel like doing a manual call using 
HttpsURLConnection.  But boy would it be nice to be able to use the WSDL2Java 
generated classes, or at the very least, use the axis-SOAP api to make the call.

In both cases, I am getting proper XML responses.  I can tell, because I step 
through the code, and the soap response has the same XML that I would get if I 
did the request manually.

1. WSDL2Java does not generate code that is able to access the soap service I 
am accessing; I get an error that says...
org.xml.sax.SAXException: Invalid element in 
DataTypes.APASProxy._2007._04.ReceivedTranscript - ReceivedTranscript

The code was generated from the wsdl from the service directly.  i.e. 
http://localhost/axis/service/ServiceName?wsdl

I have no idea where to start.  Simple requests that take no parameters, and 
return strings, work just fine.  But when it's a complex return value, such as 
an array, it doesn't appear to work, AT ALL.  Here's an example of one that 
fails for me; which I do manually here to show that it works fine without the 
WSDL generated classes.


openssl s_client -connect hostname:443

POST /axis/services/APASQueueService HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: apasproxy.athabascau.ca
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: 
"http://APASProxy.ServiceContracts/2007/04/GetRegisteredEducationalInstitutions";
Content-Length: 351

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/200
1/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soapenv:Body><GetRegisteredEducationalInstitutions
 
xmlns="http://APASProxy.ServiceContracts/2007/04"/></soapenv:Body></soapenv:Envelope>

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soapenv:Body><GetRegisteredEducationalInstitutionsResponse
 
xmlns="http://APASProxy.ServiceContracts/2007/04";><GetRegisteredEducationalInstitutionsResult><RegisteredEducationalInstitution
 xsi:type="ns1:RegisteredEducationalInstitution" 
xmlns:ns1="http://APASProxy.DataTypes/2007/04";><ns1:SourceId>48024000</ns1:SourceId>
......blah, blah, blah, yada, yada, yada.
</GetRegisteredEducationalInstitutionsResult></GetRegisteredEducationalInstitutionsResponse></soapenv:Body></soapenv:Envelope>closed

2. I am unable to make an axis Call connection either; I keep getting an error 
that says....
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which 
is NOT expected, in something it was trying to deserialize.

The above one, is the "simple" request I mentioned earlier.  Just a string 
retrieval.

Here's an example of the java code...
            Service soapService = new Service();
            Call call = (Call) soapService.createCall();
            call.setTargetEndpointAddress(
              new java.net.URL
              ("https://hostname/axis/services/APASQueueService";));
            call.setOperationName(
              new QName("", "GetHostInstitution"));
            call.setReturnType(XMLType.XSD_STRING);   // this is not working
            try {
              System.out.println(call.invoke(
                new Object[] { }));
            } catch (java.rmi.RemoteException re) {
              re.printStackTrace();
            }

Here's an example from doing it manually.  If I step through the code, it is 
getting the same response, but is unable to handle it.  Try to ignore any 
wrapping that occurs, as I'm sure my mail client will wrap some of it.

openssl s_client -connect hostname:443

POST /axis/services/APASQueueService HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: hostname
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://APASProxy.ServiceContracts/2007/04/GetHostInstitution";
Content-Length: 333

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/200
1/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soapenv:Body><GetHostInstitution
 
xmlns="http://APASProxy.ServiceContracts/2007/04"/></soapenv:Body></soapenv:Envelope>
HTTP/1.1 200 OK
Date: Fri, 08 May 2009 15:40:34 GMT
Content-Type: text/xml;charset=utf-8
Connection: close

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soapenv:Body><GetHostInstitutionResponse
 
xmlns="http://APASProxy.ServiceContracts/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></soapenv:Body></soapenv:Envelope>closed

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.
---

Reply via email to