question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Where does the serialization happen?

See original GitHub issue

I’m trying to find the code that performs the SOAP serialization when we call a ClientBase<T> method of a SvcUtil generated proxy. Which file(s) carry that code?

I have tried to generate the same SOAP envelope that the proxy creates by serializing the SvcUtil generated request classes using DataContractSerializer, XmlSerializer and SoapFormatter (3rd party NuGet package). However, none of them produce the correct SOAP request. So, I’m interested in seeing the code that produces the correct SOAP xml.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
darthkurakcommented, May 28, 2020

Any update here? I am facing same issue. Can’t find a generic way to serialize/deserialize wcf generated classes 😦

0reactions
sameeracommented, Jun 3, 2020

@sameera, if the problem is having so many operations and taking a large amount of memory for the ChannelFactory/large amount of time to create, you can split up your contract into multiple interfaces. That way any one ChannelFactory isn’t too big. That you you only pay the cost of the operations you need.

At operations level, there’s only a handful. However, each operation can work with a large number of types and probably, its the number of these record types that causing the problem. To give more context, this is the Reference.cs generated by ServiceUtil. https://github.com/sameera/lib-netsuite-servicemgr/blob/master/Celigo.SuiteTalk/src/Connected Services/SuiteTalk/Reference.cs

So, I believe splitting up the client in to multiple operations wouldn’t help.

I also had a look at your other issue to get more context. If you use ChannelFactory.CreateChannel(Uri uri), you can have a single channel factory which works against multiple endpoints.

This is only if all endpoints belong to the same domain, isn’t it? In our case, webservice for each customer is accessible through a domain specific to the customer.

If you are using XmlSerializer, you can pre-generate the serializer to reduce startup time.

We’ve done this and it reduced the time by 1-2 seconds. Unfortunately, that’s only about a 10-15% improvement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is serialization and how does it work?
Serialization is the process of converting a data object—a combination of code and data represented within a region of data storage—into a series...
Read more >
Everything You Need to Know About Java Serialization ...
Serialization is the process of saving an object's state to a sequence of bytes, which then can be stored on a file or...
Read more >
Serialization - .NET
Serialization is the process of converting the state of an object into a form that can be persisted or transported.
Read more >
Serialization and Deserialization in Java with Example
Deserialization is the reverse process where the byte stream is used to recreate the actual Java object in memory. This mechanism is used...
Read more >
Introduction to Java Serialization
The serialization process is instance-independent; for example, we can serialize objects on one platform and deserialize them on another.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found