0

I am trying to create stub for SMS, functionality is working as expected, but when i see the structure of xml request object it's completely different.

Actual provided request XML structure :

   <soapenv:Body>
      <sms:sendMessage>
<sms:applicationName>TestUI</sms:applicationName>
<sms:applicationModuleName>ModuleTest</sms:applicationModuleName>
         <sms:destination>+641001001001</sms:destination>
         <sms:content>SMS SOAP Test</sms:content>
         <sms:reference>reference</sms:reference>
      </sms:sendMessage>
   </soapenv:Body>
</soapenv:Envelope>

How the names d4p1, and s are generating in XML not getting, could any body suggest what went wrong in this , please let me know if any other information require. Thank you.

Chiranjeevi
  • 161
  • 1
  • 4
  • 22
  • They're automatic (though not relevant provided the declarations match what's expected). Show some more code - include how you are creating your message and the definitions of the classes that serialize to `SendMobileMessage` and `objSoapMessage`. Also, what is the value of the `xmlns:sms` attribute in the sample structure? – Charles Mager May 25 '15 at 12:54
  • @Charles: added my service code in the question – Chiranjeevi May 25 '15 at 12:59
  • And the other 3 things? – Charles Mager May 25 '15 at 13:01
  • The class definitions for `sendMessageRequest`, `sendMessage` and the value of the `xmlns:sms` attribute in the sample request. – Charles Mager May 25 '15 at 13:07
  • @Charles: added interface , but xmlns:sms attribute , the above xml only i got for reference – Chiranjeevi May 25 '15 at 13:07
  • The sample xml isn't valid, you're missing the opening `` element, and this will likely contains the ns declarations (`xmlns:...`). – Charles Mager May 25 '15 at 13:08
  • This is something internal to 'DataContractSerializer'. – Amit Kumar Ghosh May 25 '15 at 13:18
  • 1
    You need to set the [namespace](https://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.namespace%28v=vs.110%29.aspx) for your `DataContract` attributes to `""`. See https://stackoverflow.com/questions/3807508/what-does-adding-name-and-namespace-to-datacontract-do and [DataContractAttribute Class](https://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute%28v=vs.110%29.aspx.). – dbc May 25 '15 at 16:56
  • @dbc22: When I make that my xml is looking like this. but i would like to add sms:DestinationField to replicate the request,could you let me know what was the issue of this? – Chiranjeevi May 25 '15 at 17:21

0 Answers0