Consuming a .NET web service from a Java Soap Client?

Hwoarang

New Member
I'm looking for a simple way to construct a soap request in order to consume a .NET web service, but i found little to no documentation at all regarding this subject. The default library javax.xml.soap is more than ambiguous in how to construct the request.Are there any libraries available that will make my life easier?I found this piece of code somewhere, and i don't now how it's used or what library it's from, but i would very much like something similar, instead of constructing the entire xml message manually using DOM, or something similar (because it takes the Simple out of SOAP)\[code\]SoapRequestBuilder s = new SoapRequestBuilder();s.Server = "127.0.0.1"; // server ip address or names.MethodName = "ConcatWithSpace";s.XmlNamespace = "http://tempuri.org/";s.WebServicePath = "/SimpleService/Service1.asmx";s.SoapAction = s.XmlNamespace+s.MethodName;s.AddParameter("one", "David");s.AddParameter("two", "Hobbs");String response = s.sendRequest();\[/code\]This is the message form that i have to send:\[code\]POST /webservice/TimrService.asmx HTTP/1.1Host: not.important.hostContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://tempuri.org/GetTimetableForBachelorYear"<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetTimetableForBachelorYear xmlns="http://tempuri.org/"> <year>I1</year> <halfYear>A</halfYear> </GetTimetableForBachelorYear> </soap:Body></soap:Envelope>\[/code\]
 
Back
Top