For Programmers: Free Programming Magazines  


Home > Archive > Microsoft Webservices > April 2006 > Consume web service on client side









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Consume web service on client side
John Smith

2006-04-11, 8:11 am


I've tried importing WSDL file in VS 8.0 and it failed (as I describer few
topics below this one). Now I wish to call web service without having WSDL
file and without importing it. This is Java example:

Document doc1 = parseXmlFile("C:/request.xml", true, false);
SOAPBodyElement[] input = new SOAPBodyElement[1];
input[0] = new SOAPBodyElement(doc1.getDocumentElement());

Options opts = new Options(args);
opts.setDefaultURL("http://www.example.com/SomeService/");

Service service = new Service();
Call call = (Call) service.createCall();

call.setTargetEndpointAddress( new URL(opts.getURL()) );

Vector elems = (Vector) call.invoke( input );
SOAPBodyElement elem = null ;
Element e = null ;

elem = (SOAPBodyElement) elems.get(0);
e = elem.getAsDOM();

String str = XMLUtils.ElementToString(e);

its SOAP handling class taked XML document or XML element in constructor and
send it to some URL.

Does .Net have something like that? Plaese show me some example.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com