Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6998453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:24:49+00:00 2026-05-27T20:24:49+00:00

<wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/ xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/ xmlns:tns=http://ttdev.com/ss xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:sp=http://schemas.xmlsoap.org/ws/2005/07/securitypolicy xmlns:wsp=http://schemas.xmlsoap.org/ws/2004/09/policy xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd name=SecureService targetNamespace=http://ttdev.com/ss> <wsp:Policy wsu:Id=p1> <sp:SignedParts> <sp:Body

  • 0
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 xmlns:tns="http://ttdev.com/ss"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
 xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
 xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd"
 name="SecureService" targetNamespace="http://ttdev.com/ss">


<wsp:Policy wsu:Id="p1">
 <sp:SignedParts>
 <sp:Body />
 </sp:SignedParts>
</wsp:Policy>

<wsdl:binding name="SecureServiceSOAP" type="tns:SecureService">

<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />

<wsdl:operation name="concat">
<wsp:PolicyReference URI="#p1" wsdl:required="true" />
<soap:operation soapAction="http://ttdev.com/ss/concat" />
<wsdl:input>
<soap:body parts="concatRequest" use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body parts="concatResponse" use="literal" />
</wsdl:output>
</wsdl:operation>

</wsdl:binding>

<wsdl:service name="SecureService">
<wsdl:port binding="tns:SecureServiceSOAP" name="SecureServiceSOAP">
<soap:address location="http://localhost:8080/axis2/services/SecureService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

This WSDL contains a policy section and an operation section
So on the basis of the operation anme and the URI attribute of Tag wsp:PolicyReference
I want to fetch the whole Policy XMl part from this WSDl

<wsp:Policy wsu:Id="p1">
     <sp:SignedParts>
     <sp:Body />
     </sp:SignedParts>
    </wsp:Policy>

There can be many policy but whose ID matched with URI value of Policy refence whose operation name i pass , that policy I want .

can u help me to fetch policy XML part.

When some one pass value of pOperationName variable as concat then output string should be following:

<wsp:Policy wsu:Id="p1">
 <sp:SignedParts>
 <sp:Body />
 </sp:SignedParts>
</wsp:Policy>

Done it using following Code

 private string GetPolicy()
        {
            XDocument wsdlDocument = XDocument.Load(_wsdlPath);

            XName operationElementName = XName.Get("operation", "http://schemas.xmlsoap.org/wsdl/");
            XName policyReferenceElementName = XName.Get("PolicyReference", "http://schemas.xmlsoap.org/ws/2004/09/policy");
            XName policyElementName = XName.Get("Policy", "http://schemas.xmlsoap.org/ws/2004/09/policy");
            XName idAttributeName = XName.Get("Id", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd");

            var operationPolicy = from operation in wsdlDocument.Descendants(operationElementName)
                                  where operation.Attribute("name").Value == _operationSelected
                                  from policyReference in operation.Descendants(policyReferenceElementName)
                                  where policyReference.Attribute("URI").Value.StartsWith("#")
                                  let uri = policyReference.Attribute("URI").Value.Substring(1)
                                  from policy in wsdlDocument.Descendants(policyElementName)
                                  where policy.Attribute(idAttributeName).Value == uri            
                                  select policy.ToString();

            #region Removing Embedded Namespaces
            string temp = operationPolicy.FirstOrDefault();
            if (temp.Contains(Constants.WSPolicyNsURI.XMLNS_SP) || temp.Contains(Constants.WSPolicyNsURI.XMLNS_WSP) || temp.Contains(Constants.WSPolicyNsURI.XMLNS_WSU))
            {
                temp = temp.Replace(Constants.WSPolicyNsURI.XMLNS_SP, String.Empty);
                temp = temp.Replace(Constants.WSPolicyNsURI.XMLNS_WSP, String.Empty);
                temp = temp.Replace(Constants.WSPolicyNsURI.XMLNS_WSU, String.Empty);
            }

            #endregion
            return temp;
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:24:49+00:00Added an answer on May 27, 2026 at 8:24 pm
        private string GetPolicy(string pWsdlPath, string pOperationName)
        {
            XDocument wsdlDocument = XDocument.Load(pWsdlPath);
    
            XName operationElementName = XName.Get("operation", "http://schemas.xmlsoap.org/wsdl/");
            XName policyReferenceElementName = XName.Get("PolicyReference", "http://schemas.xmlsoap.org/ws/2004/09/policy");
            XName policyElementName = XName.Get("Policy", "http://schemas.xmlsoap.org/ws/2004/09/policy");
            XName idAttributeName = XName.Get("Id", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd");
    
            var operationPolicy = from operation in wsdlDocument.Descendants(operationElementName)
                                  where operation.Attribute("name").Value == "concat"
                                  from policyReference in operation.Descendants(policyReferenceElementName)
                                  where policyReference.Attribute("URI").Value.StartsWith("#")
                                  let uri = policyReference.Attribute("URI").Value.Substring(1)
                                  from policy in wsdlDocument.Descendants(policyElementName)
                                  where policy.Attribute(idAttributeName).Value == uri
                                  select policy.ToString();
    
            return operationPolicy.FirstOrDefault();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<?xml version=1.0 encoding=UTF-8?> <definitions xmlns:def=http://www.w3.org/2002/ws/databinding/examples/6/09/ xmlns:xs=http://www.w3.org/2001/XMLSchema xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance> <types> <xs:schema xmlns=http://www.w3.org/2002/ws/databinding/examples/6/09/ targetNamespace=http://www.w3.org/2002/ws/databinding/examples/6/09/ elementFormDefault=qualified> <xs:include xmlns:wsdl11=http://schemas.xmlsoap.org/wsdl/
I'm using this wsdl-file to describe my webservice: <?xml version=1.0 encoding=UTF-8 ?> <wsdl:definitions targetNamespace=http://www.myapproach.de/knowledgebase
I have a library I am creating based on some WSDL/XSD definitions. I am
I have a WebService with following wsdl file: <?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name=BBAppWebAccessService targetNamespace=com.test xmlns:ns1=http://schemas.xmlsoap.org/soap/http
I'm trying to use a simple wsdl file and make a soap call but
I have a following wsdl from a WCF service. <?xml version=1.0 encoding=utf-8?> <wsdl:definitions name=Service
I'm trying to create a PHP soap server based on a WSDL I was
wsdl.exe , appears to be the default tool for .Net to generate proxy class
The WSDL generated by WCF is describing all my bindings, and I want it
I recently heard of WSDL.Exe, but I am not sure where to find this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.