Avoid xmlns in Body for SOAP Request created by WSDL

Discussion in 'ASP .Net Web Services' started by BusyBoy, Mar 28, 2009.

  1. BusyBoy

    BusyBoy Guest

    Hi

    This is a question which I have on SOAP Request created by a
    WSDL.exe.

    The SOAP Request to be created is the one which we don't want the
    xmlns
    tag to be in the SOAP:BODy. but all xmlns in the SOAP:Envelope

    something like this ( not exact SOAP Request ... just enough to
    illustrate my question. )

    <?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"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:cus="http://mydomain/customers" >
    <soap:Body>
    <cus:ClassA >
    <cus:ClassARequest>

    <cus:/ClassARequest>
    </cus:ClassA>
    </soap:Body>
    </soap:Envelope>

    but in case of the proxy generated by wsdl.exe the SOAP Request turns
    out be as below :

    <?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"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    >

    <soap:Body xmlns="http://mydomain/customers">
    <ClassA >
    <ClassARequest>
    </ClassARequest>
    </ClassA>
    </soap:Body>
    </soap:Envelope>


    i.e. the a default xmlns is getting created in the soap:body.

    Instead of the default xmlns in soap body i want all xmlns in the
    soap:head ...

    is their any switch in wsdl.exe command or any option which I can use
    to ensure this?

    Hope my question is clear !!

    Rajan
    BusyBoy, Mar 28, 2009
    #1
    1. Advertising

  2. Why do you care about this? The two pieces of XML are identical.

    --
    John Saunders | MVP - Connected System Developer


    "BusyBoy" <> wrote in message
    news:...
    > Hi
    >
    > This is a question which I have on SOAP Request created by a
    > WSDL.exe.
    >
    > The SOAP Request to be created is the one which we don't want the
    > xmlns
    > tag to be in the SOAP:BODy. but all xmlns in the SOAP:Envelope
    >
    > something like this ( not exact SOAP Request ... just enough to
    > illustrate my question. )
    >
    > <?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"
    > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    > xmlns:cus="http://mydomain/customers" >
    > <soap:Body>
    > <cus:ClassA >
    > <cus:ClassARequest>
    >
    > <cus:/ClassARequest>
    > </cus:ClassA>
    > </soap:Body>
    > </soap:Envelope>
    >
    > but in case of the proxy generated by wsdl.exe the SOAP Request turns
    > out be as below :
    >
    > <?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"
    > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    > >

    > <soap:Body xmlns="http://mydomain/customers">
    > <ClassA >
    > <ClassARequest>
    > </ClassARequest>
    > </ClassA>
    > </soap:Body>
    > </soap:Envelope>
    >
    >
    > i.e. the a default xmlns is getting created in the soap:body.
    >
    > Instead of the default xmlns in soap body i want all xmlns in the
    > soap:head ...
    >
    > is their any switch in wsdl.exe command or any option which I can use
    > to ensure this?
    >
    > Hope my question is clear !!
    >
    > Rajan
    John Saunders, Mar 29, 2009
    #2
    1. Advertising

  3. BusyBoy

    BusyBoy Guest

    On Mar 29, 8:10 am, "John Saunders" <> wrote:
    > Why do you care about this? The two pieces of XML are identical.
    >
    > --
    > John Saunders | MVP - Connected System Developer
    >
    > "BusyBoy" <> wrote in message
    >
    > news:...
    >
    > > Hi

    >
    > > This is a question which I have on SOAP Request created by a
    > > WSDL.exe.

    >
    > > The SOAP Request to be created is the one which we don't want the
    > > xmlns
    > > tag to be in the SOAP:BODy. but all xmlns in the SOAP:Envelope

    >
    > > something like this ( not exact SOAP Request ... just enough to
    > > illustrate my question. )

    >
    > > <?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"
    > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    > > xmlns:cus="http://mydomain/customers" >
    > > <soap:Body>
    > > <cus:ClassA >
    > > <cus:ClassARequest>

    >
    > > <cus:/ClassARequest>
    > > </cus:ClassA>
    > > </soap:Body>
    > > </soap:Envelope>

    >
    > > but in case of the proxy generated by wsdl.exe the SOAP Request turns
    > > out be as below :

    >
    > > <?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"
    > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

    >
    > > <soap:Body xmlns="http://mydomain/customers">
    > > <ClassA >
    > > <ClassARequest>
    > > </ClassARequest>
    > > </ClassA>
    > > </soap:Body>
    > > </soap:Envelope>

    >
    > > i.e. the a default xmlns is getting created in the soap:body.

    >
    > > Instead of the default xmlns in soap body i want all xmlns in the
    > > soap:head ...

    >
    > > is their any switch in wsdl.exe command or any option which I can use
    > > to ensure this?

    >
    > > Hope my question is clear !!

    >
    > > Rajan


    This is a requirement while accessing the service endpoint on
    DataPower where the service is exposed.

    Rajan
    BusyBoy, Mar 30, 2009
    #3
  4. "BusyBoy" <> wrote in message
    news:...
    > This is a requirement while accessing the service endpoint on
    > DataPower where the service is exposed.
    >
    > Rajan


    I hope you don't mean this DataPower:
    http://en.wikipedia.org/wiki/DataPower. That would be scary. You'd expect
    IBM to understand how XML works.

    --
    John Saunders | MVP - Connected System Developer
    John Saunders, Mar 30, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Bedford
    Replies:
    0
    Views:
    580
    Chris Bedford
    Aug 21, 2003
  2. Replies:
    0
    Views:
    1,354
  3. afshar
    Replies:
    3
    Views:
    24,264
    aljar
    May 19, 2010
  4. Me
    Replies:
    2
    Views:
    430
  5. droesler
    Replies:
    2
    Views:
    492
    droesler
    Aug 31, 2010
Loading...

Share This Page