Java SOAP客户端SAAJ
我对SOAP比较陌生,想用JAVA编写一个SOAP客户机。我发现WSDL还有很多其他的垃圾,因为我只使用了其中的一个服务,因此SAAJ将是最短的方法。我得到的第一个WSDL是RPC编码的,不支持SSL连接(http链接)。我的电话是这样的:Java SOAP客户端SAAJ,java,web-services,ssl,soap,saaj,Java,Web Services,Ssl,Soap,Saaj,我对SOAP比较陌生,想用JAVA编写一个SOAP客户机。我发现WSDL还有很多其他的垃圾,因为我只使用了其中的一个服务,因此SAAJ将是最短的方法。我得到的第一个WSDL是RPC编码的,不支持SSL连接(http链接)。我的电话是这样的: String request = "<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001
String request = "<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:AxessInterface\">"
+ " <soapenv:Header/>"
+ " <soapenv:Body>"
+ " <urn:getModemFromACS soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
+ "<ModemIDMACAddressChoice xsi:type=\"urn:ModemIDMACAddressChoiceStruct\">"
+ " <ModemID xsi:type=\"xsd:string\">"
+ modemId
+ "</ModemID>"
+ " </ModemIDMACAddressChoice>"
+ " </urn:getModemFromACS>"
+ " </soapenv:Body>"
+ "</soapenv:Envelope>";
String request=“”
+ " "
+ " "
+ " "
+ ""
+ " "
+摩德米德
+ ""
+ " "
+ " "
+ " "
+ "";
我所拥有的新WSDL可能不是RPC编码的(它在任何地方都没有“style=RPC”标记),并且链接是启用SSL的(带有单向身份验证的https)。在这个WSDL中,样式是“文档”
我有几个问题:
你究竟为什么要用如此艰难的方式进行soap调用?我的意思是手动构造SOAP请求。使用CXF读取WSDL并为您生成客户端代码。不要重新发明轮子。@Namphibian:后端的WSDL很奇怪,它最初不适用于CXF(因为它是RPC编码的)。我已将其更改,现在将尝试使用CXF。