Custom SOAP Body... How to handle?

G

Guest

Hi all,

The client is sending a SOAP body with the following information:

<soap:Body>

<MyFunction xmlns="http://mycompany/services/t1">
<header>
... Custom Elements Here
</header>
<body>
... My Function Call Parameters Go Here (The regular stuff)
<MyID>1</MyID>
</body>
</MyFunction>
</soap:Body>

As you see this is very different than a normal web service call ...
what is the best way to parse such data in .NET?

P.S. How about sending such data ... I'll probably need to build a test
client to send samples to myself.

Thanks!
 
J

John Saunders [MVP]

Spam Catcher said:
Hi all,

The client is sending a SOAP body with the following information:

<soap:Body>

<MyFunction xmlns="http://mycompany/services/t1">
<header>
... Custom Elements Here
</header>
<body>
... My Function Call Parameters Go Here (The regular stuff)
<MyID>1</MyID>
</body>
</MyFunction>
</soap:Body>

As you see this is very different than a normal web service call ...
what is the best way to parse such data in .NET?

P.S. How about sending such data ... I'll probably need to build a test
client to send samples to myself.

Did the client give you a WSDL? If you add a web reference, does a proxy
class get created?
 
G

Guest

Did the client give you a WSDL? If you add a web reference, does a proxy
class get created?

Since I'm building the service ... I guess I'm the one providing the
WSDL? If I receive a WSDL from the customer, I don't think I can just
reference it an create an interface to implement right?

However, the customer does have this interface implemented in a couple
other systems (Java based), but even our Java developer is a bit
confused about the messaging. Seems like this sort of format is custom
and requires custom parsing?
 
J

John Saunders [MVP]

Spam Catcher said:
Since I'm building the service ... I guess I'm the one providing the
WSDL? If I receive a WSDL from the customer, I don't think I can just
reference it an create an interface to implement right?

However, the customer does have this interface implemented in a couple
other systems (Java based), but even our Java developer is a bit
confused about the messaging. Seems like this sort of format is custom
and requires custom parsing?

The reason I asked about a WSDL is that it would have provided a schema
describing the format. You can start from an XSD schema if they have one
(they really must). From that, you can use XSD.EXE to generate C# classes
that will serialize into that format. You can then try to create a WebMethod
that accepts the header and body as two parameters. I believe that will get
you the format you want.

Worse come to worst, you could define your web method to accept a single
parameter of type MyFunction, or, at absolute worst, a single parameter of
XmlNode type.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top