Atilla ACAR

Atilla ACAR

  • NA
  • 1
  • 0

SOAP Serialization

Apr 29 2008 4:12 AM
Hi,

I am new to SOAP in .net, I have learned many things so far web services, wsdl, xsd, xml and XML Serialization, but I am stuck now and cannot contiune because of two main problems which needs an expert look.

First of all, I have N different wsdl files in N different directories with same name, and each wsdl contains 4 message 2 in and 2 out with same name. For example in directory A I have A.wsdl and A1in, A1out, A2in and A2out messages. All message definitions are in the differnet xml schema files A1in.xsd, A1out.xsd, A2in.xsd, A2out.xsd and they use some core schema core.xsd for common data types.

Problem 1- I have generated codes for one wsdl file and got a huge file. Then I have found the A1in message's class and I have created and object testA. Xsd organized such that each XML element have a name and type
<xsd:element name="MCCI_IN000001TR01" type="hl7:MCCI_IN000001TR01.Message"/>

When I deserialize testA1 I got

<?xml version="1.0" encoding="utf-8"?>
<MCCI_IN000001TR01.Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
</MCCI_IN000001TR01.Message>

which should be

<hl7:MCCI_IN000001TR01 xsi:schemaLocation="muayene.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:hl7="urn:hl7-org:v3">
</hl7:MCCI_IN000001TR01>

What I am missing?


Problem-2) As I stated above I have a core schema for all message, however when I create different namespaces for each wsdl I have same types in all namespaces, and I cannot reuse core schema. If I create one file for all wsdl by using wsdl.exe and par option sharetypes = true, because of same message name and same types in message schema files I cannot handle generated code. Any advice?

Sincerely,

Atilla



Answers (1)