Avoid some tags in .Net web services call
Hello everybody,
First of all, sorry for my english, and now let me explain you the scenario I have.
I have to consume some web services another company made. In cases where one of the parameters is null, .Net automatically builds the tag like this: <longitud/>
The problem I have, is that the other company doesn´t understand that tag, their sytem thinks that it has a value and returns an error.
The question now is, if there is a way to prevent .Net from incluiding that tag in those cases.
I would need .Net building instead of this xml:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ExampleMethod xmlns="http://example.com/moncholv/">
<exampleParameter1>USUTCA</exampleParameter1>
<exampleParameter2 />
</ExampleMethod>
</soap:Body>
</soap:Envelope>
To build this one:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ExampleMethod xmlns="http://example.com/moncholv/">
<exampleParameter1>USUTCA</exampleParameter1>
</ExampleMethod>
</soap:Body>
</soap:Envelope>
Thanks in advance
Last edited by moncholv; October 26th, 2009 at 08:30 PM..
|