axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eogreen <eogree...@yahoo.com>
Subject WSDLToJava-Generated XML Doesn't Work / But Explicit XML Does Work
Date Sat, 30 Apr 2005 17:49:10 GMT
Greetings,

I would like to ask a fairly concise question to the developers.  I am having
trouble invocating on an endpoint with the XML which is generated by my
WSDLToJava (created from http://mytarget/service?wsdl) emitter-based classes
(returns ClassCastException).  However, I can successfully invoke on the
endpoint if I explicitly define the XML based on specs I have for the endpoint.
 The specs are slightly different from the WSDLToJava-generated XML, although
the overall structure of the WSDLToJava XML is correct.  I know the endpoint
works from running the explicit code and XML below. 


*** THIS EXPLICIT CODE WORKS FINE ***

    String msg = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

    msg += "<soap-env:Envelope
xmlns:soap-env=\"http://schemas.xmlsoap.org/soap/envelope/\">";
    msg += "<soap-env:Header></soap-env:Header>";
    msg += "<soap-env:Body
soap-env:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">";
    msg += "<TraceQuery
xmlns=\"http://www.starviewtechnology.com/schema/2.3/data-query\">";
    msg += "<QueryInterval>";
    msg += "<TimeInterval>";
    msg += "<StartTime>2005-04-29T12:50:00</StartTime>";
    msg += "<EndTime>2005-04-29T12:59:00</EndTime>";
    msg += "</TimeInterval>";
    msg += "</QueryInterval>";
    msg += "<QueryContext>";
    msg += "<Equipment>CVD85</Equipment>";
    msg += "</QueryContext>";
    msg += "<IdList>480,1055,1056,1057,1058</IdList>";    
    msg += "</TraceQuery>";
    msg += "</soap-env:Body>";
    msg += "</soap-env:Envelope>";

    String action = "TraceQuery" ;

    InputStream input = new ByteArrayInputStream(msg.getBytes());
    Service service = new Service();
    Call call = (Call) service.createCall();
    SOAPEnvelope env = new SOAPEnvelope(input);

    call.setTargetEndpointAddress(new URL(URL));
    if (action != null) {
        call.setUseSOAPAction(true);
        call.setSOAPActionURI(action);
    }

    System.out.println("Request:\n" + msg);
    env = call.invoke(env);
    System.out.println("Response:\n" + env.toString());   



*** THIS WDSLToJava generated XML DOES NOT WORK ***

    ... 
        webServiceResponse = queryPort.queryTrace(webServiceTraceQuery);
    ...

... WHICH PRODUCES THE FOLLOWING XML:

    <?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:Header><
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0"></userdefined></soapenv:Header>
   <soapenv:Body>
      <TraceQuery
xmlns="http://www.starviewtechnology.com/schema/2.3/data-query">
         <QueryInterval>
            <TimeInterval>
               <StartTime>2005-04-29T18:12:43.037Z</StartTime>
               <EndTime>2005-04-29T17:12:43.037Z</EndTime>
            </TimeInterval>
         </QueryInterval>
         <QueryContext>
            <Equipment xsi:type="ns1:constraint-value"
xmlns:ns1="http://www.starviewtechnology.com/schema/2.3/data-query">CVD85</Equipment>
         </QueryContext>
         <IdList>480,1055,1056,1057,1058</IdList>
      </TraceQuery>
   </soapenv:Body></soapenv:Envelope>



*** OFFENDING XML LINES ***

By substititing XML lines, one by one, from the WSDLToJava-generated XML into
the explicit code (that works), I can generate errors individually for each of
the follow lines added.

1) msg += "<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\">";

2) msg += "<soapenv:Header><
soapenv:actor=\"http://schemas.xmlsoap.org/soap/actor/next\"
soapenv:mustUnderstand=\"0\"></userdefined></soapenv:Header>";

3) msg += "<soapenv:Body>";    

4) msg += "<Equipment xsi:type=\"ns1:constraint-value\"
xmlns:ns1=\"http://www.starviewtechnology.com/schema/2.3/data-query\">CVD85</Equipment>";


~~~

The question:  Is there is way for me to, while still using the WSDLToJava
classes, explicitly define/tweek these few XML lines which are causing my
problem?

Of course, any info or insight given or time spent addressing my email will be
much appreciated by me.  I can't seem to find, where in the WSDLToJava classes
to change the the offending lines.  Also, I'm not sure why the WSDLToJava
classes would produce XML which doesn't work .. ?

Regards,
Eric Green
Austin, TX

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message