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 7023785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:45:18+00:00 2026-05-27T23:45:18+00:00

i’m rewriting a soap web service from .net to php. by default, php is

  • 0

i’m rewriting a soap web service from .net to php. by default, php is giving me tags that look like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Header><ns1:FindAllCategories/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:FindAllCategoriesResponse><ns1:FindAllCategoriesResult><ns1:ArtistCategoryDto>

etc…

but i need this:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><FindAllCategoriesResponse xmlns="http://tempuri.org/"><FindAllCategoriesResult><ArtistCategoryDto>

This is similar to the question here: PHP AND SOAP. Change envelope however i’d like to not hack it the way he did. Also, i am creating a soap service that will be consumed by an existing iphone app, not using PHP to consume a soap service using SoapClient. The iphone app just parses the raw xml and i can’t change the iphone app right now.

  • 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-27T23:45:19+00:00Added an answer on May 27, 2026 at 11:45 pm

    After re-reading what it is you want and searching through the php documentation here is my solution and a couple of assumptions that I made

    Assumptions

    • If I’m correct you are aware that the SOAP prefix itself isn’t the issue (you are allowed to use any prefix as long as it is consistent).
    • We need to create a work-around for this specific Iphone app that makes use of a (xml) parser that currently can not be modified/upgraded by you

    What do you want?

    1. You would like to use a native API to alter the SOAP prefix
    2. You want to catch the SoapServer response so you can alter the SOAP prefix before it is being returned

    Solution

    1. Currently there is no native SoapServer API method to alter the SOAP prefix
    2. You can catch the SoapServer response and process the response either by regex or xml parser see example below
    <?php
    
    // Create you parse function - Regex
    function SoapServerRegexParser($input)
    {
        // $input contains your XML Response
        // Do str_replace or preg_replace   
        $request = preg_replace({do replace});
    
        //return modified output to client
        return $request;
    }
    
    // OR create you parse function - Regex XML Parser
    function SoapServerXMLParser($input)
    {
        // $input contains your XML Response
        // Use any xml parser that you would like   
        $xml = new DOMDocument();
        $xml->formatOutput = true;
        $xml->preserveWhiteSpace = false;
        $xml->loadXML($input);
        //Do replacement have a looke at: DOMNode::replaceChild
    
        //return modified output to client
        return $xml->saveXML();
    }
    
    // Make php buffer all output
    // Send all output to a callBack function
    
    // Replace 'SoapServerRegexParser' with the callback function name of choice
    ob_start('SoapServerRegexParser'); //buffer output and set callback function
    
    // Create SoapServer
    $server = new SoapServer('wsdlfile.wsdl');
    $server->handle(); //Handle incoming request
    ob_end_flush(); //Release buffer, but send through callback function first
    
    ?>
    

    This should do the trick, I haven’t created the regex part or the actual xlm node replacement but I figure you can do that yourself

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to create an if statement in PHP that prevents a single post
I have some data like this: 1 2 3 4 5 9 2 6

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.