I'm new to Axis - 'bout a week - I'm attempting to connect to a 3rd-party
webservice running on my localhost. I've gen'd the files using wsdl2java,
and everything compiles and runs up to the actual "response =
portType.calculateSquareRoot(request);" call, when I get the "No request
found in SOAP envelope". I know the webservice is OK because same basic C#
program works. My project links to all the axis jars in axis_1_4 + xerces
-2_9_0. I'll include the simple code snippet and pertinent stack trace.
(I've been googling on this for days + looked thru archives but couldn't
find the right clue). Can anybody help? Or give me pointers to how I might
track this down in debugger?
Thanks!
Paul Miller
Code:
try {
// inputNum comes from user-entered value in TextField
double inputNum = Double.parseDouble(inputTextField.getText());
// default value until webservice caclulates it
double outputNum = 0;
// create the webservice obj with the ServiceLocator
ExampleService_Service theService = new
ExampleService_ServiceLocator();
// get the port-type obj from theService - we make the calls to
this obj
ExampleService_PortType portType = theService.
getExampleService();
// create a request obj to hold all input and in/out params
CalculateSquareRootRequest request = new
CalculateSquareRootRequest();
// response obj will hold results of service invocation
CalculateSquareRootResponse response = null;
request.setTheNumber(inputNum); // set in/out param "TheNumber"
// this makes the call with the request obj as in params and we
get response obj back
response = portType.calculateSquareRoot(request);
// extract output value of inout param "TheNumber" from response
outputNum = response.getTheNumber();
// just display it
outputTextField.setText("" + outputNum);
} catch (Exception e) {
System.err.println("Execution failed. Exception: " + e );
e.printStackTrace();
}
Stack Trace
Execution failed. Exception: No request found in SOAP envelope
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: No request found in SOAP envelope
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:No request found in SOAP
envelope
at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:2
22)
at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:12
9)
at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationCo
ntext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext
.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChe
cker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at
com.aimms.www.generated_namespaces.ExampleService.ExampleServiceHandlerSOAPB
indingStub.calculateSquareRoot(ExampleServiceHandlerSOAPBindingStub.java:216
)
at javaaimmsexample.MainFrame.doSqrt(MainFrame.java:54)
etc
--
Paul Miller
Applied Optimization, LLC
812.853.9544
812.431.1075
[EMAIL PROTECTED]
www.applied-optimization.com <http://www.applied-optimization.com/>