| |

VerySource

 Forgot password?
 Register
Search
View: 754|Reply: 6

help! Boss, please take a look, the problem that has troubled for a long time (call webservice)

[Copy link]

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-29 15:40:01
| Show all posts |Read mode
Error message:
An unhandled "System.InvalidOperationException" type exception appears in system.web.services.dll.

Additional information: The method PresenceSupplierService.getMyWatchers cannot be reflected.
===============================
PresenceSupplierService.dll was generated using the rendered wsdl and added to the project's reference along with System.Web.Services.dll, the relevant code:
getMyWatchers y_object = new getMyWatchers ();
y_object.presentity = "sip: kk@192.168.2.251: 50611";
PresenceSupplierService ps = new PresenceSupplierService (); // This step is suggested
string [] result = ps.getMyWatchers (y_object);
===============================
When I call the PresenceNotificationService in a similar way, it is normal (the service is sag upstream to the sp side, and supplierservice is the sag downstream of the sp side); the younger first came to .net, for advice and advice
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-6-16 20:15:01
| Show all posts
Try to regenerate the proxy class. I don’t know the definition of the server-side class. It is best if you expose part of the code (or interface). There may be a problem with the server-side code.
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-6-20 14:00:01
| Show all posts
Thank you for the reply from zcbb. The generated proxy class is definitely problematic. I generated the proxy class based on the parlay standard wsdl file. The source code of the proxy class and the project source code of the test program can be provided. The following is the source code of the getMywatchers method part of the proxy class (A bit messy, open it with ultraedit):
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
        [return: System.Xml.Serialization.XmlArrayAttribute("getMyWatchersResponse", Namespace="http://www.csapi.org/schema/parlayx/presence/supplier/v3_1/local")]
        [return: System.Xml.Serialization.XmlArrayItemAttribute("result", Namespace="http://www.csapi.org/schema/parlayx/presence/supplier/v3_1/local", DataType="anyURI", IsNullable=false )]
        public string[] getMyWatchers([System.Xml.Serialization.XmlElementAttribute("getMyWatchers", Namespace="http://www.csapi.org/schema/parlayx/presence/supplier/v3_1/local")] getMyWatchers getMyWatchers1) {
            object[] results = this.Invoke("getMyWatchers", new object[] {
                        getMyWatchers1});
            return ((string[])(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BegingetMyWatchers(getMyWatchers getMyWatchers1, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("getMyWatchers", new object[] {
                        getMyWatchers1}, callback, asyncState);
        }
        
        /// <remarks/>
        public string[] EndgetMyWatchers(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((string[])(results[0]));
        }



    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csapi.org/schema/parlayx/presence/supplier/v3_1/local")]
    public class getMyWatchers {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")]
        public string presentity;
    }
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-6-21 01:45:01
| Show all posts
The method described in the parlayx standard is as follows:
8.3.4.1 Input message: getMyWatchersRequest
Part name presentity
Part type xsd:anyURI

8.3.4.2 Output message: getMyWatchersResponse
Part name Result
Part type xsd:anyURI [0..unbounded]
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-6-22 08:00:01
| Show all posts
The wsdl of another interface of the standard deploys the webservice client in the same way, there is no problem,

Below is the information of this successful webservice
      
============Related code in the agent class:
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("statusEndResponse", Namespace="http://www.csapi.org/schema/parlayx/presence/notification/v3_1/local")]
public statusEndResponse statusEnd([System.Xml.Serialization.XmlElementAttribute("statusEnd", Namespace="http://www.csapi.org/schema/parlayx/presence/notification/v3_1/local")] statusEnd statusEnd1) {
     object[] results = this.Invoke("statusEnd", new object[] {
                 statusEnd1});
     return ((statusEndResponse)(results[0]));
}

/// <remarks/>
public System.IAsyncResult BeginstatusEnd(statusEnd statusEnd1, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("statusEnd", new object[] {
                 statusEnd1}, callback, asyncState);
}

/// <remarks/>
public statusEndResponse EndstatusEnd(System.IAsyncResult asyncResult) {
     object[] results = this.EndInvoke(asyncResult);
     return ((statusEndResponse)(results[0]));
}

[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csapi.org/schema/parlayx/presence/notification/v3_1/local")]
    public class statusEndResponse {
    }
   
   
============== Code in the client
statusEnd x_object =new statusEnd();
x_object.correlator=textBox1.Text;
PresenceNotificationService pn=new PresenceNotificationService();
pn.statusEnd (x_object);
   
   
    ========== description of the method in the parlayx standard
8.2.2.1 Input message: statusEndRequest
Part name Correlator
Part type xsd:string

8.2.2.2 Output message: statusEndResponse
Part name None
Part type
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-23 00:30:02
| Show all posts
Follow Parlay X
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-25 00:30:01
| Show all posts
Regenerate the proxy class. The WSDL published by the server has changed
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list