Ask a questionAsk a question
 

Proposed AnswerInclude more than one namespace in web service

  • Tuesday, November 03, 2009 8:40 AMVijay5335590 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hi,

    I created a web service, but what should I need to do to include more than one namespace.
    For eg: my web service soap request is like this now

     <DeliverSms xmlns="http://tempuri.org">
    <DeliverSmsRequestElement>
    ..body...
    </DeliverSmsRequestElement>
    </DeliverSms>
    and I need it like this

     <DeliverSms xmlns="http://tempuri.org
    "  xmlns:ns2="http://something.com" xmlns:ns3="http://something.com"
    >
    <DeliverSmsRequestElement>
    --body--
    </DeliverSmsRequestElement>
    </DeliverSms>
    Please advice

All Replies

  • Tuesday, November 03, 2009 3:06 PMJohn SaundersMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    Your example is not using ns2 or ns3. Did you mean to use those namespaces?
    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects
  • Wednesday, November 04, 2009 1:46 AMVijay5335590 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    Yes, I need to use those namespaces

    Vijay
  • Wednesday, November 04, 2009 3:57 AMJohn SaundersMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    If you emit XML which is in those namespaces, then the namespace declarations will also be emitted.

    Can you give an example of what you're trying to accomplish? Please show how the two other namespaces are used, and how you are currently generating the XML.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects