.NET 웹 서비스를 사용하기 위해 비누 요청을 구성하는 간단한 방법을 찾고 있지만이 주제와 관련하여 전혀 설명서가 거의 없습니다. 기본 라이브러리 javax.xml.soap은 요청 구성 방법이 모호합니다.Java SOAP 클라이언트에서 .NET 웹 서비스 사용?
내 인생을 더 편리하게 할 수있는 라이브러리가 있습니까?
이 코드는 어딘가에 있으며 현재 사용 된 라이브러리 나 라이브러리가 아닌 DOM을 사용하여 전체 XML 메시지를 수동으로 생성하는 대신 비슷하게 사용합니다. (이것은 SOAP의 간단한 아웃이 걸리기 때문에)
SoapRequestBuilder s = new SoapRequestBuilder();
s.Server = "127.0.0.1"; // server ip address or name
s.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();
이 내가 보내야 할 메시지의 형태이다 : 나는 .NET 개발자에게 자신을 해요
POST /webservice/TimrService.asmx HTTP/1.1
Host: not.important.host
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "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>