0 Replies Latest reply on Apr 14, 2008 12:03 PM by 666705

    SOAP Message Handler

    666705
      I have a stand-alone java client which invokes a WSE enabled .NET web service. A custom policy file (no encryption or certificate. Just username token) is associated with the java client. I also include a SOAP handler to display the SOAP request. When I ran the client,
      the display of the SOAP request message was quite different between the console and the .NET server trace file. The statement "messageContext.getMessage().toString());" just display "weblogic.xml.saaj.SOAPMessageImpl@502e15"
      Could some one please tell me why the SOAP handler did not display the rest of the SOAP message like the .NET server trace file (shown below)?

      Here is a snippet of my SOAP Handler handleRequest implementation:
      public boolean handleRequest(MessageContext context) {

      System.out.println("handle request...");
      SOAPMessageContext messageContext = (SOAPMessageContext) context;
      System.out.println("** Request: " + messageContext.getMessage().toString());

      SOAPHeader sh = null;
      try {
      sh = messageContext.getMessage().getSOAPHeader();
      } catch (SOAPException se) {
      }

      Iterator it = sh.examineAllHeaderElements();
      while (it.hasNext()) {
      System.out.println("*** There are SOAP Headers.....");
      SOAPHeaderElement elem = (SOAPHeaderElement)it.next();
      System.out.println("header ==> " + elem.getElementName().getQualifiedName());
      }

      return true;
      ------------------------------------------------------------------
      Here is the display on the console:
      run:
      [java] in class digimarc.foto.webservice.clientstub.ClientHandler init()
      [java] in class digimarc.foto.webservice.clientstub.ClientHandler init()
      [java] in class digimarc.foto.webservice.clientstub.ClientHandler init()
      [java] handle request...
      [java] ** Request: weblogic.xml.saaj.SOAPMessageImpl@502e15
      [java] *** There are SOAP Headers.....
      [java] header ==> wsse:Security
      [java] <11-Apr-2008 2:14:04 o'clock PM ADT> <Info> <WebService-LogHandler> <BEA-000000> <weblogic.xml.saaj.SOAPMessageImpl@502e15>
      [java] ** Fault: weblogic.xml.saaj.SOAPMessageImpl@57b10b
      [java] <11-Apr-2008 2:14:06 o'clock PM ADT> <Info> <WebService-LogHandler> <BEA-000000> <weblogic.xml.saaj.SOAPMessageImpl@57b10b>
      [java] fetchMostRecent() Failed...
      --------------------------------------------------------------
      .NET web server trace:
      <inputMessage utc="3/28/2008 3:05:43 PM" messageId="urn:uuid:23052686-df58-4144-9ec9-52617e5b5cd6">
      <processingStep description="Unprocessed message">
      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" env:mustUnderstand="1">
      <wsse:UsernameToken wsu:Id="unt_R4qflJg2MR0no0AY" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <wsse:Username>nbddls\john</wsse:Username>
      <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">G0ggin!</wsse:Password>
      </wsse:UsernameToken>
      </wsse:Security>
      </env:Header>
      <env:Body>
      <m:ImagingFolioFetchMostRecent xmlns:m="urn:digimarc.com:ImageServer:WebServices">
      <m:personID>1001917</m:personID>
      </m:ImagingFolioFetchMostRecent>
      </env:Body>
      </env:Envelope>
      </processingStep>
      ......
      ......
      </inputMessage>