How to get “Single Reference” soap body


we have developed web service using soaprpcmethod. expecting “single reference” soap envelop client request. but sample envelop generated web service is  “multi-reference”.

 

please suggest us, need done web service can accept “single reference” soap request , process it.

 

the signature of web service is:

 

[soaprpcservice]

      public class service1 : system.web.services.webservice

      {

            [webmethod]

            [soaprpcmethod]

            public soapresult mywebmethod(soaprequest objrequest)

            {

                  //some code....

                  soapresult objresult= new soapresult();

                  //some code....

                  return objresult;

            }

           

      }

      public class soapresult

      {

            public string username;

            public child_1 objchild_1;

 

      }

      public class soaprequest

      {

            public child_1 objchild_1;

 

      }

      public class child_1

      {

            public child_2 objchild_2;

      }

      public class child_2

      {

            public string strvalue;

      }

 

current soap style (multi reference):

 
<?xml version="1.0" encoding="utf-8"?>
<soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlnstongue tiedoapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:types="http://tempuri.org/encodedtypes" xmlnstongue tiedoap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:body soap:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/">
    <tns:mywebmethod>
      <objrequest href="#id1" />
    </tns:mywebmethod>
    <tnstongue tiedoaprequest id="id1" xsi:type="tnstongue tiedoaprequest">
      <objchild_1 href="#id2" />
    </tnstongue tiedoaprequest>
    <tns:child_1 id="id2" xsi:type="tns:child_1">
      <objchild_2 href="#id3" />
    </tns:child_1>
    <tns:child_2 id="id3" xsi:type="tns:child_2">
      <strvalue xsi:type="xsdtongue tiedtring">string</strvalue>
    </tns:child_2>
  </soap:body>
</soap:envelope>

 

 

expected style (single reference):

 
<?xml version="1.0" encoding="utf-8"?>
<soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlnstongue tiedoapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:types="http://tempuri.org/encodedtypes" xmlnstongue tiedoap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:body soap:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/">
<mywebmethod>
        <objrequest xsi:type="tnstongue tiedoaprequest" />
               <objchild_1 xsi:type="tns:child_1"/>  
                       <objchild_2 xsi:type="tns:child_2"/>
                           <strvalue xsi:type="xsdtongue tiedtring">string</strvalue> 
                       </objchild_2>
               </objchild_1>
        </objrequest>
</tns:mywebmethod>
  </soap:body>
</soap:envelope>

 

we using .net framework 1.1

 

thanks in advance.

 

soapdocumentmethod give expected behaviour

 

thanks



Archived Forums A-B  >  ASMX Web Services and XML Serialization



Comments

Popular posts from this blog

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

wcf-sql adapter bug for operation on same table

Error connecting to Azure Blob using Shared Access signature