Hi Tom 

Can you please help on this any further

Regards
Deepak

-----Original Message-----
From: Gupta,D,Deepak,XJG4C C 
Sent: 22 February 2005 16:28
To: '[email protected]'; 'Tom Oinn'
Subject: RE: Problem in talking to Web Service


Hi Tom 

I tried the way you said. I am enclosing the sample code also. But I am
getting this following error. Please help me how to proceed further from
here 


org.xml.sax.SAXException: Bad types (class java.lang.String -> class
oasisNamesT
cSPML101.BatchRequest)



Regards
Deepak

-----Original Message-----
From: Tom Oinn [mailto:[EMAIL PROTECTED] 
Sent: 22 February 2005 13:39
To: [email protected]
Subject: Re: Problem in talking to Web Service


[EMAIL PROTECTED] wrote:
> Hi Tom
> 
> Thanks a lot for the reply. Can you just explain a little bit further
> on this.
> 
> 1)  How to I cast the bean to the autogenerated class

You don't - in fact, I'd avoid all autogenerated code other than your 
XMLBeans, forget about the Axis tools in this case.

> 2) Can you provide some information on document style dynamic
> invocation

The idea is that you give Axis the entire XML payload - in this case 
Axis is responsible for enclosing that payload in the requisite SOAP 
body, managing the network communication etc. It is also resonsible, 
where this is configured, for handling aspects such as WS-security. This

is why there's actually a point to having Axis rather than just making 
the call yourself (which can seem similar at first glance)

To invoke the service you create an array of SOAPBodyElement objects 
from your XML (you get the XML from the XMLBean). This array should be 
length 1 unless you're doing something really strange (I think, anyone 
correct me on this?). You should be able to find the appropriate methods

to populate the SOAPBodyElement in the javadoc.

You then need to create a Call object - this is the handle Axis uses to 
the service which you can then use to invoke it :

        String url = "http://foo.bar.com/ServiceEndpoint";;
        Service service = new Service();
        Call call = (Call) service.createCall();
        call.setTargetEndpointAddress(url);

(You'll need to further configure the call object with your operation 
name etc)

To invoke you then use :

        Vector result = (Vector) call.invoke(input)

Where 'input' is your SOAPBodyElement[] you created earlier. The result 
is a Vector object which contains a SOAPBodyElement corresponding to the

result, you can get the DOM objects from this element with :

        SOAPBodyElement resultElement = (SOAPBodyElement)result.get(0);
        Element e = resultElement.getAsDOM();

You should then have an instance of org.w3c.dom containing your results 
as per the schema in the WSDL file, I'm not familiar with XMLBeans 
particularly but I would imagine you could use this to create a 
corresponding result XMLBean?

> 3) Can it be found out from the WSDL file that our service is document
> style or not. I am enclosing the WSDL file with the mail

It can, and yours is - look for :

- <wsdl:binding name="SPMLSoapBinding" type="tns:SPMLRequestPortType">
   <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"; />
- <wsdl:operation name="SPMLBatchRequest">
   <soap:operation style="document" 
soapAction="urn:oasis:names:tc:SPML:1:0/batchRequest" />

You'll also find various use="literal" statements.

Cheers,

Tom


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.3.0 - Release Date: 2/21/2005

Reply via email to