| |

VerySource

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

Web Service Custom Entity Class Transfer

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-26 18:00:01
| Show all posts |Read mode
Hello everyone, ask if the parameter in the Web Service is an entity class object defined in other projects, for example, the entity model in the factory mode Model layer defines an Order class. I now create a new Web Service project, call this Model.dll, and define a WebMethod eg: public void InsertOrder (Model.Order order) {.....}, but in the project that calls this service, I When I pass in an object of Model.Order, I can't convert it. I need a reference to this Web service plus the entity class defined by this type. If I refer to this Web Service and name it WebServ, I will use the WebServ.Model.Order entity. That is, I must manually convert the entities of Model.Order into WebServ.Model.Order objects? May I ask if I did something wrong, the first time I used Web Service. The entity type has been set to Serializable
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-5-9 20:00:02
| Show all posts
The landlord posted the code ..
The entity type has been set to Serializable and it can be serialized by XML.
But I do n’t know how to do it.
Learn....
Reply

Use magic Report

0

Threads

6

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-7-31 11:15:01
| Show all posts
Call error, web service reference is different from dll call, first report your prepared web service and publish it (similar to website publishing), and then make web reference on the client side
Reply

Use magic Report

0

Threads

6

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-7-31 11:45:02
| Show all posts
The above answer is a little bit small. Correct: you add using WebServ in the using position when you call;
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