error call webservice to "Sun-Java-System/Application-Server"

Dear all

Please give me suggestion, regarding call webservice from webMethods 6.1

I try to generate webservices client using wsdl that others system generated.
successfully generate from webmethods developer.

but when i try to call always give me this error :

fault code : env:Server
fault string : JAXRPC.TIE.04: Internal Server Error (JAXRPCTIE01: caught exception while handling request: java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.TextImpl)

This is soapresponsedata from that webservices :

[highlight=xml]
<env:Envelope xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:enc=“http://schemas.xmlsoap.org/soap/encoding/” xmlns:ns0=“urn:fileNotification/types” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
env:Body
env:Fault
env:Server
JAXRPC.TIE.04: Internal Server Error (JAXRPCTIE01: caught exception while handling request: java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.TextImpl)
</env:Fault>
</env:Body>
</env:Envelope>

[/highlight]
This is wsdl file they provide :

[highlight=xml]

<?xml version="1.0" encoding="UTF-8"?>

[/highlight]

Can you post the soap request as well? For some reason the web service provider is not able to map your xml message to the underlying java objects. This is surprising since the message only contain string data types. It’s possible that your soap request message is not properly constructed.

Mark

hi Mark

I can’t do the post soap request as well, but if i using netbeans webservices testing i can call that servise correctly, but with webMethodsc cannot.

Any idea ? or how to create java service manualy to call that websevices ?

This is code from their server “actually only return back my input”:

[highlight=java]
public class fileNotificationImpl implements fileNotificationSEI {

// Enter web service operations here. (Popup menu: Web Service->Add Operation)
/**
 * Web service operation
 */
public java.lang.String receiveNotification(String fileInfo) throws java.rmi.RemoteException {
    // TODO implement operation 
    return "File Info: " + fileInfo;
}

}

package com.xybase.egag.espkb.gateway;

/**

  • This is the service endpoint interface for the fileNotificationweb service.
  • Created Mar 12, 2006 6:22:08 PM
  • @author farid
    */

public interface fileNotificationSEI extends java.rmi.Remote {
/**
* Web service operation
*/
public java.lang.String receiveNotification(String fileInfo) throws java.rmi.RemoteException;

}

package com.xybase.egag.espkb.gateway;

/**

  • This is the implementation for the fileNotificationWSLoggerSOAP Message Handler.

  • Created Mar 12, 2006 6:38:43 PM

  • @author farid
    */
    //
    import javax.xml.rpc.handler.MessageContext;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import javax.xml.namespace.QName;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPPart;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.soap.SOAPBody;
    import java.util.Date;
    //
    public class fileNotificationWSLogger extends javax.xml.rpc.handler.GenericHandler {
    // TODO Change and enhance the handle methods to suit individual needs.

    private QName[] headers;

    public void init(HandlerInfo config) {
    headers = config.getHeaders();
    }

    public javax.xml.namespace.QName[] getHeaders() {
    return headers;
    }

    // Currently prints out the contents of the SOAP body plus some date information.
    public boolean handleRequest(MessageContext context) {
    try{
    SOAPMessageContext smc = (SOAPMessageContext) context;
    SOAPMessage msg = smc.getMessage();
    SOAPPart sp = msg.getSOAPPart();
    SOAPEnvelope se = sp.getEnvelope();
    SOAPHeader shd = se.getHeader();

         SOAPBody sb = se.getBody();
         java.util.Iterator childElems = sb.getChildElements();
         SOAPElement child;
         StringBuffer message = new StringBuffer();
         while (childElems.hasNext()) {
             child = (SOAPElement) childElems.next();
             message.append(new Date().toString() + "--");
             formLogMessage(child, message);
         }
         
         System.out.println("Log message: " + message.toString());
     } catch(Exception e){
         e.printStackTrace();
     }
     return true;
    

    }

    public boolean handleResponse(MessageContext context) {
    return true;
    }

    public boolean handleFault(MessageContext context) {
    return true;
    }

    public void destroy() {
    }

    private void formLogMessage(SOAPElement child, StringBuffer message) {
    message.append(child.getElementName().getLocalName());
    message.append(child.getValue() != null ? “:” + child.getValue() + " " : " ");

     try{
         java.util.Iterator childElems = child.getChildElements();
         while (childElems.hasNext()) {
             Object c = childElems.next();
             if(c instanceof SOAPElement)
                 formLogMessage((SOAPElement)c, message);
         }
     }catch(Exception e){
         e.printStackTrace();
     }
    

    }
    }

[/highlight] Thank you

Fernand

You need to get a tool such as the PocketSoap TCPTrace utility or the Axis TCPMon or SoapMonitor utility and capture the soap message for the working and non-working request. A review of the two messages using your favorite Diff tool should be enlightening.

Mark