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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:30:34+00:00 2026-05-21T09:30:34+00:00

I am currently working on a project for the company that I work for.

  • 0

I am currently working on a project for the company that I work for. The project will need to make a SOAP request to another company (by means of PHP). I have the SoapClient in my PHP code communicating with the SOAP server of the other company, but all I get is “INVALID XML.” After examining their WSDL and the response I notice that their namespaces are different. I need to change my namespaces to match theirs.

For example: The tags in my request show “ns1.” and “env.”, but theirs show “soap.”

How can I change this?

Here is an example of my code, the request that is sent out and the response that is received.

---------------- CODE ----------------

  $client = new SoapClient("http://ws.example.com/test/test.asmx?WSDL", array('soap_version'=>SOAP_1_2, 'trace' => 1));

  $result = $client->TestFunction(array('Packet'=>'<Email>test@example.com</Email><Password>examplepassword</Password>'));

  $sessionid = $result->TestFunctionResult;

  print $sessionid;


  echo "REQUEST HEADER:\n" . htmlentities($client->__getLastRequestHeaders()) . "\n";

  echo "REQUEST:\n" . htmlentities($client->__getLastRequest()) . "\n";

  echo "RESPONSE HEADER:\n" . htmlentities($client->__getLastResponseHeaders()) . "\n";

  echo "RESPONSE:\n" . htmlentities($client->__getLastResponse()) . "\n";


------------ REQUEST SENT -------------

POST /test/test.asmx HTTP/1.1
Host: ws.example.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.3.4
Content-Type: application/soap+xml; charset=utf-8; action="http://ws.example.com/test/TestFunction"
Content-Length: 352

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://ws.example.com/resumes/">
  <env:Body>
    <ns1:TestFunction>
      <ns1:Packet>
        <Email>test@example.com</Email>
        <Password>examplepassword</Password>
      </ns1:Packet>
    </ns1:TestFunction>
  </env:Body>
</env:Envelope>

---------- RESPONSE RECEIVED ----------

HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Length: 450
Content-Type: application/soap+xml; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
X-PBY: BEARWS2
Date: Mon, 18 Apr 2011 15:33:51 GMT
Connection: close

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <TestFunctionResponse xmlns="http://ws.example.com/test/">
      <TestFunctionResult>
        <Packet>
          <Error>Invalid XML</Error>
        </Packet>
      </TestFunctionResult>
    </TestFunctionResponse>
  </soap:Body>
</soap:Envelope>

How can I get around this problem?

  • 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-21T09:30:34+00:00Added an answer on May 21, 2026 at 9:30 am

    The prefix names are irrelevant. They are not the cause of your problem. It looks like you have a mismatched tag here:

    <ns1:TestFunciton>
        <ns1:Packet>
            <Email>test@example.com</Email>
            <Password>examplepassword</Password>
        </ns1:Packet>
    </ns1:TestFunction>
    

    Note the misspelling of TestFunciton.

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

Sidebar

Related Questions

I'm currently working on a project that needs to have a process that assigns
I am currently working on a project about calculations.I have done the main part
I am currently working on a project that requires me to display PDF documents
I am currently working on a project that implements Azure ACS. I got the
I am currently working on grails project. I have created eight different plugins. Each
I am currently working on a project that is looking at having a database
I am currently working on a project where I need to implement a parallel
I am currently working on a project that is hosted at GoDaddy and it
I'm currently working on a JSF 1.2 project (IBM implementation and a company layer).
Currently I'm working on a project at work and we're looking at upgrading our

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.