1. The soaphttpclientprotocol class can directly access the specified WebService method.
Prerequisites:
- You must assign a value to the URL of this class. This URL indicates the specific path of the service.
- The specific class must inherit the class.
- You must add these features on the inheritance class, especially webservicebinding (name = "Soap", namespace = "http://tempuri.org/")]
- Complete features include: [generatedcode ("system. Web. Services", "2.0.50727.3053 "),
Designercategory ("Code"), debuggerstepthrough,
Webservicebinding (name = "Soap", namespace = "http://tempuri.org/")]
- The call method is as follows:
Take string as the parameter
Public String request (string requestxml)
{
Object [] array = base. Invoke ("request", new object []
{
Requestxml
});
Return (string) array [0];
}
Passing parameters as objects
[System. web. services. protocols. soapdocumentmethodattrispace ("http://tempuri.org/Request", requestnamespace = "http://tempuri.org/", responsenamespace = "http://tempuri.org/", use = system. web. services. description. soapbindinguse. literal, parameterstyle = system. web. services. protocols. soapparameterstyle. wrapped)]
Public jobmsgentity request (entity jme)
{
Object [] Results = This. Invoke ("request", new object [] {
Jme });
Return (entity) (results [0]);
}
Note:
Request: indicates the method to be called.
Requestxml: indicates the input parameter. this parameter is a serialized XML parameter.
The format is similar to the following:
<? XML version = "1.0"?>
<Request>
<Header userid = "120201" requesttype = "flight. Order. flightmessage. sendmessage" asyncrequest = "false" timeout = "0" messagepriority = "3"/>
<Sendmessagerequest>
<Orderid> 511017689 </orderid>
<Message> notification content </message>
<Type> Issue ticket </type>
<Priority> 10 </Priority>
<Sender> System </sender>
<Recipients> CP </recipients>
<Sendcode/>
</Sendmessagerequest>
</Request>