Click here to Skip to main content
15,890,717 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone. I am a little bit new to soap request and response. I am working on a project assigned to me where our partner has provided us there wsdl. In a request, they have mentioned an attribute which accepts multiple values. For the values to be passed they have provided us '*.xsd' file. Now I don't have any idea how can I pass the request and also how I can pass multiple values in the attribute using the provided *.xsd file in C#.Net. Can anyone please help me to do this with a step by step example would be a great help.

Below is an example of soap request generated through soap UI.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cre="http://creation.soapws.progressoft.com/">
   <soapenv:Header>
      <cre:paymentOperation>?</cre:paymentOperation>
      <cre:requestTimeStamp>?</cre:requestTimeStamp>
      <cre:securityToken>?</cre:securityToken>
      <cre:username>?</cre:username>
   </soapenv:Header>
   <soapenv:Body>
      <cre:createPayment>
         <!--Optional:-->
         <remitterBankBIC>?</remitterBankBIC>
         <!--Optional:-->
         <requestMsg>?</requestMsg>
      </cre:createPayment>
   </soapenv:Body>
</soapenv:Envelope>

Note : In the above sample the attribute in which i have to pass multiple values.
<requestMsg>?</requestMsg>


Thanks In Advance

What I have tried:

I have searched for the tutorials. But couldn't find any helpfull post.
Posted
Updated 30-Dec-17 23:51pm
v2

1 solution

Just have multiple instances of the element

<cre:createPayment>
    <!--Optional:-->
    <remitterBankBIC>?</remitterBankBIC>
    <!--Optional:-->
    <requestMsg>Message 1</requestMsg>
    <requestMsg>Message 2</requestMsg>
</cre:createPayment>


If you have their WSDL file you should be able to add a service reference to your project and point it to the WSDL and Visual Studio will construct all the code you need to call the method so it should generate an enumerable "requestMsg" property of the request object as well as methods that call the service for you and you shouldn't need to worry about the exact XML at all. Google "c# add service reference" for more details.
 
Share this answer
 
v2
Comments
Member 10189763 31-Dec-17 6:20am    
Brother, you are right but it is not giving me any fields after REquest Message

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900