SoapSender & SoapEnvelope
本文关键字:SoapEnvelope amp SoapSender | 更新日期: 2023-09-27 18:28:47
enter code here
我正试图从c#客户端调用web服务。我发现我们可以使用SoapSender和SoapReceiver类。请参阅下面的web服务的WSDL
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WelcomeService" targetNamespace="http://test/">
<types>
<xs:schema xmlns:tns="http://test/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test/" version="1.0">
<xs:element name="WelcomeMessage" type="tns:WelcomeMessage"/>
<xs:element name="WelcomeMessageResponse" type="tns:WelcomeMessageResponse"/>
<xs:complexType name="WelcomeMessage">
<xs:sequence>
<xs:element minOccurs="0" name="message" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="WelcomeMessageResponse">
<xs:sequence/>
</xs:complexType>
</xs:schema>
</types>
<message name="Welcome_WelcomeMessageResponse">
<part element="tns:WelcomeMessageResponse" name="WelcomeMessageResponse"/>
</message>
<message name="Welcome_WelcomeMessage">
<part element="tns:WelcomeMessage" name="WelcomeMessage"/>
</message>
<portType name="Welcome">
<operation name="WelcomeMessage" parameterOrder="WelcomeMessage">
<input message="tns:Welcome_WelcomeMessage"/>
<output message="tns:Welcome_WelcomeMessageResponse"/>
</operation>
</portType>
<binding name="WelcomeBinding" type="tns:Welcome">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="WelcomeMessage">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="WelcomeService">
<port binding="tns:WelcomeBinding" name="WelcomePort">
<soap:address location="http://127.0.0.1:8080/SoapSeam/Welcome"/>
</port>
</service>
</definitions>
我很难弄清楚如何填充Soap信封对象。
您一定在网上找到了旧的或不好的信息。有关当前信息,请参阅如何使用Web服务。
另请参阅wcf。WCF是您应该用来处理SOAPWeb服务的技术。