Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

400 Bad Request

Help
jdp153
2011-10-11
2013-06-06
  • jdp153
    jdp153
    2011-10-11

    I'm new to soap in general and am stuck on a problem. I'm hoping someone with more experience can help.

    I have built a simple php client that is consuming a .NET server. Upon call of the function, I receive a "Unsupported HTTP response status 400 Bad Request" error.

    Here is my code for the client:

                   $mysoapmsg = '<?xml version="1.0"?><Message>Some stuff in here</Message>';

    $wsdl = 'https://api.thisdomain.com/someservice.svc?wsdl';
    $username= 'xusername';
    $password = 'xpassword';
    $soapHeaderParameters = Array('login' => $username, 'password' => $password);
    $soapFunction = 'XFunction';

    $client = new soapclient($wsdl, true);
    $client->setHeaders($soapHeaderParameters);

    $msg = $client->serializeEnvelope("$mysoapmsg");

    $result = $client->call($soapFunction, $msg);

    I know the $mysoapmsg is good because it was given to me by the developer of the server. For what it's worth, I am using the latest version of nusoap.

    Forgive my ignorance, but any thoughts of why I'm receiving a 400 error? Thank you in advance!