Hi all, I'm writing a java application that calls a .NET web service. I have generated the java-side code using the wsdl2java ant task.
The .NET web service generates a pdf document and sends it back to the client as a SOAP attachment. I am wondering what the 'correct' way of obtaining soap attachments from a call to a web service is. The code I currently have (that works) involves casting the 'soap' object to a 'soap stub' object.. as the soap stub has methods to get the attachments. see the code below for what i mean. ----- ReportGeneratorLocator rgl = new ReportGeneratorLocator(); ReportGeneratorSoapStub reportGeneratorSoap = (ReportGeneratorSoapStub) rgl.getReportGeneratorSoap(); reportGeneratorSoap.doReport(new DoReportDataSet(result.get_any()), "pdf"); Object[] attachments = reportGeneratorSoap.getAttachments(); ----- As I said, this code actually works but I'm concerned that i'm having to cast to the stub object to get the attachments. The documentation i've found so far mentions the MessageContext class.. but when i call MessageContext.getCurrentContext(), i receive a null value. Can anybody clue me in as to whether i'm doing the right thing? Or if not, what the 'right thing' actually is? thanks, Paul.
