Fatal error: Uncaught SoapFault exception: [prefix0:MessageInformationHeaderRequired]
Results 1 to 12 of 12

Thread: Fatal error: Uncaught SoapFault exception: [prefix0:MessageInformationHeaderRequired]

  1. #1
    Member
    Join Date
    Jan 2009
    Posts
    40

    Smile Fatal error: Uncaught SoapFault exception: [prefix0:MessageInformationHeaderRequired]

    I am trying to create a soap connection , however I'm getting an error when I try and create an instance of the soap client class.

    Code:
    $client = new SoapClient("exampleaddress.wsdl",
            array(  'login'      => 'xxx',
                    'password' => 'xxxx',
                 )
    			);
    The error is

    Code:
    Fatal error: Uncaught SoapFault exception: [prefix1:MessageInformationHeaderRequired]
    
    xxxxx.Addressing.AddressingFault: Message Information Header Required at
    xxxxx.Messaging.SoapHttpRouter.ProcessRequestMessage(SoapEnvelope message) at
    xxxxx.Messaging.SoapHttpRouter.RoutingAsyncResult.ForwardRequest() at
    xxxxx.Messaging.SoapHttpRouter.RoutingAsyncResult..ctor(SoapHttpRouter parent, HttpContext httpContext, AsyncCallback callback,
     Object asyncState) in siteaddress\pagename.php:13 Stack trace: #0 siteaddress\pagename.php(13):
     SoapClient->__call('getPDF', Array) #1 siteaddress\pagename.php(13):
     SoapClient->getPDF(Array) #2 {main} thrown in siteaddress\pagename.php on line 13
    Thanks

  2. #2
    NMaOtBG bpat1434's Avatar
    Join Date
    Oct 2004
    Location
    Around 255.255.255.0
    Posts
    7,849
    From the error it seems like you're not getting a proper wsdl back. I'd check your authentication and also enable debugging and look at the actual XML that is being transmitted back and forth. Posting the actual request and response would be helpful if your authentication is correct.

  3. #3
    Member
    Join Date
    Jan 2009
    Posts
    40
    first of all thanks so much for your time bpat1434. actually i am new in php soap. i have idea how to get info once i access wsdl. but problem is that i am unable to connect. i could not understand exactly your answer. there may be a reason that username and password is not correct??? what could be any other reason.

    i also want to inform you that service is based on Web Services Enhancements (WSE) 3.0 for Microsoft.

    Please let me know if i am not clear in my question. i will be very thankful to you. i badly need to complete this work in time. Thanks again

    one more thing. how we will know authentication domain? it exists in wsdl file somewhere or client need to tell us separately?
    Last edited by bpat1434; 05-28-2012 at 07:55 AM. Reason: Quickly double posting

  4. #4
    NMaOtBG bpat1434's Avatar
    Join Date
    Oct 2004
    Location
    Around 255.255.255.0
    Posts
    7,849
    I would check that the username and password are correct and the URL to the WSDL file is correct. If you are certain they are correct, I'd wonder what authentication mechanism it's using. It may not be basic authentication, it may be Digest in which case you'd have to add the key "authentication" with the value SOAP_AUTHENTICATION_DIGEST to your constructor array:

    PHP Code:
    $client = new SoapClient(
        
    "some.wsdl",
        array
        (
            
    "login" => "myusername",
            
    "password" => "mypassword",
            
    "authentication" => SOAP_AUTHENTICATION_DIGEST// Or SOAP_AUTHENTICATION_BASIC
        
    )
    ); 

  5. #5
    Member
    Join Date
    Jan 2009
    Posts
    40
    i applied above mechanism but still not working

  6. #6
    NMaOtBG bpat1434's Avatar
    Join Date
    Oct 2004
    Location
    Around 255.255.255.0
    Posts
    7,849
    It appears the WSDL is open so no authentication is necessary. Everything worked in my test when I set up the code. I could even strip it down to just passing the WSDL to the constructor and no other options.

    Each time received 10 functions I could run:

    Code:
    getVedbandayfirlitFasteignarResponse getVedbandayfirlitFasteignar(getVedbandayfirlitFasteignar $parameters) (107 byte string)
    getPDFResponse getPDF(getPDF $parameters) (41 byte string)
    getVedbandayfirlitOkutaekisResponse getVedbandayfirlitOkutaekis(getVedbandayfirlitOkutaekis $parameters) (104 byte string)
    isEignStadfestILandskraResponse isEignStadfestILandskra(isEignStadfestILandskra $parameters) (92 byte string)
    getEignastadaResponse getEignastada(getEignastada $parameters) (62 byte string)
    getVedbandayfirlitFasteignarResponse getVedbandayfirlitFasteignar(getVedbandayfirlitFasteignar $parameters) (107 byte string)
    getPDFResponse getPDF(getPDF $parameters) (41 byte string)
    getVedbandayfirlitOkutaekisResponse getVedbandayfirlitOkutaekis(getVedbandayfirlitOkutaekis $parameters) (104 byte string)
    isEignStadfestILandskraResponse isEignStadfestILandskra(isEignStadfestILandskra $parameters) (92 byte string)
    getEignastadaResponse getEignastada(getEignastada $parameters) (62 byte string)
    Is the error you're seeing happening when you call a function?

  7. #7
    Member
    Join Date
    Jan 2009
    Posts
    40
    yes it happens when i call a function. before calling a function i can see the list of functions. but when i call a function than that error appeared

  8. #8
    Member
    Join Date
    Jan 2009
    Posts
    40

    Fatal error: Uncaught SoapFault exception: [prefix0:MessageInformationHeaderRequired]

    I am trying to create a soap connection , however I'm getting an error when I try and create an instance of the soap client class.

    Code:
    $client = new SoapClient("exampleaddress.wsdl",
            array(  'login'      => 'xxx',
                    'password' => 'xxxx',
                 )
                );
    after this i am able to see a list of function using
    Code:
    var_dump($client->__getFunctions());
    but when i call any function error appears

    Code:
    Fatal error: Uncaught SoapFault exception: [prefix1:MessageInformationHeaderRequired]
     
    xxxxx.Addressing.AddressingFault: Message Information Header Required at
    xxxxx.Messaging.SoapHttpRouter.ProcessRequestMessage(SoapEnvelope message) at
    xxxxx.Messaging.SoapHttpRouter.RoutingAsyncResult.ForwardRequest() at
    xxxxx.Messaging.SoapHttpRouter.RoutingAsyncResult..ctor(SoapHttpRouter parent, HttpContext httpContext, AsyncCallback callback,
     Object asyncState) in siteaddress\pagename.php:13 Stack trace: #0 siteaddress\pagename.php(13):
     SoapClient->__call('getPDF', Array) #1 siteaddress\pagename.php(13):
     SoapClient->getPDF(Array) #2 {main} thrown in siteaddress\pagename.php on line 13
    any help will be greatly appreciated

  9. #9
    NMaOtBG bpat1434's Avatar
    Join Date
    Oct 2004
    Location
    Around 255.255.255.0
    Posts
    7,849
    It's either on their side or you're not passing the correct arguments to the soap function. I get the same result. I don't have any real data to test with, but I'm willing to bet that once you call the correct function with the correct parameters you will get a valid response.

  10. #10
    Member
    Join Date
    Jan 2009
    Posts
    40
    Thanks bpat for your reply. bpat i worked some other wsdl files. May be you are right but normally when a wrong function is called than error appears

    Code:
     Fatal error: Uncaught SoapFault exception: [Client] Function ("function name") is not a valid method for this service
    and when a wrong parameters is passed then error appears
    Code:
    Fatal error: SOAP-ERROR: Encoding: object has no 'variable name'(parameter name which should called) property

  11. #11
    NMaOtBG bpat1434's Avatar
    Join Date
    Oct 2004
    Location
    Around 255.255.255.0
    Posts
    7,849
    Looks like you need to specify some extra headers in your SOAP call. See Web Services Addressing @ W3C for more information. If you are not aware of the values, then whomever provides the service should be able to give you instruction on what they should be.

    You can add the headers like so:

    PHP Code:
    <?php
        $client 
    = new SoapClient(
            
    "http://ws-test.fmr.is/SvcThinglysingar_0301/Thinglysingar_0301.wsdl",
            array
            (
                
    "trace" => true,
                
    "exceptions" => true
            
    )
        );

        try
        {
            
    $headers = array();
            
    $headers[] = new SoapHeader("http://schemas.xmlsoap.org/ws/2004/08/addressing""destination""http://www.google.com");
            
    $headers[] = new SoapHeader("http://schemas.xmlsoap.org/ws/2004/08/addressing""action""http://ws-test.fmr.is/SvcThinglysingar_0301/Thinglysingar_0301.wsdl");

            
    $client->__setSoapHeaders($headers);

            
    $response $client->getVedbandayfirlitFasteignar(
                array
                (
                    
    "FastaNr" => "This is a test",
                    
    "bGeneratePDF" => false
                
    )
            );
        }
        catch (
    Exception $e)
        {
                 
    var_dump($e);
            }

  12. #12
    Member
    Join Date
    Jan 2009
    Posts
    40
    thanks bpat1434

    let me check

    i could not reply you earlier because i could not receive email alert of you message. otherwise i was waiting for your reply for many days

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •