Invoke a call to Muse in Axis

2006-08-16 Thread ZHAO
Hello,I want to add identification function and maintain sessions in the Muse service. Now I have deployed one Muse service and one Axis service. I invoke a call to Muse service from Axis implemention file.(e.g
. Once the Axis service receives a GetResourceProperty soap request, it will do the invocation to Muse service to get the required resource property.) 
The following is the code of method getResourceProperty in the Axis generated impl file. But it dose not work, it returns a NullPointer Exception. I don't know where the problem is. Can anyone help?Thanks in advance.
I attach as well the WSDL file,  the GetResourceProperty.soap and GetResourceProperty.xml.    public org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse getResourceProperty(
javax.xml.namespace.QName getResourcePropertyRequest) throws java.rmi.RemoteException, org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.InvalidResourcePropertyQNameFaultType, org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.ResourceUnknownFaultType

 {        try{        String endpoint="http://localhost:8080/muse/services/router5
";        String uri = "
http://example.org/services/Router5";        InputStream is =ClassLoader.getSystemResourceAsStream("C:/axis-1_4/samples/AxisTest1/requests/GetResourceProperty.xml");        System.err.print

("input stream: "+is.toString());        ServiceFactory sfactory = (org.apache.axis.client.ServiceFactory)ServiceFactory.newInstance();                URL wsdlURL = new URL("

http://localhost:8080/muse/services/router5?wsdl");    QName serviceQname = new QName("
http://example.org/services/Router5", "RouterService");
    Service service = (org.apache.axis.client.Service)sfactory.createService(wsdlURL, serviceQname);    //the port name becomes the service name in the wsdd generated by Wsdl2Java    QName portQname = new QName("
http://example.org/services/Router5", "router5");            Call call = (Call)service.createCall (portQname,"GetResourceProperty");
    call.setTargetEndpointAddress(endpoint);    call.setProperty(Call.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);    call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);    
call.setProperty(Call.SOAPACTION_URI_PROPERTY, uri);    call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "");    call.setProperty(Call.OPERATION_STYLE_PROPERTY, "document");
    call.setOperationName(new QName("http://example.org/services/Router5","GetResourceProperty"));
        QName qn1=new QName("
http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl
","GetResourceProperty");
//    QName qn2=new QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl
","GetResourcePropertyResponse");    call.addParameter("ResourceId",qn1,ParameterMode.IN);//    call.setReturnType(qn2,org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse.class

);//    QName qn3=new QName("http://example.org/services/Router5","ResourceId");
//    String stri="ResourceId";//    Object[] ob=(stri);
//    org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse res=(org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse

)call.invoke(qn3,ob);           org.apache.axis.message.SOAPEnvelope envelope = new org.apache.axis.message.SOAPEnvelope();    org.apache.axis.message.SOAPBodyElement bodyelement = new 
org.apache.axis.message.SOAPBodyElement(is);       bodyelement.setNamespaceURI("http://example.org/services/Router5
");        
envelope.addBodyElement(bodyelement);    org.apache.axis.message.SOAPEnvelope elms = (org.apache.axis.message.SOAPEnvelope)call.invoke(envelope);    org.apache.axis.message.SOAPBodyElement elem = 
elms.getFirstBody
();    String str=elem.getAsString();    System.err.print(str);    }        catch(SOAPException se){            System.err.println("SOAPException: '" + se.getMessage

() + "'");    System.err.println("  Cause:  '" + se.getCause().getClass().getName() + "': " + se.getCause().getMessage());            return null;        }    catch (IOException ioe)
    {  System.err.println("IOException writing SOAPMessage:  '" + ioe.getMessage() + "'");  return null;    }    catch(Exception e){    e.printStackTrace

();    }     return null; }the exception posted in the server: java.lang.NullPointerException    at samples.AxisTest1.AxisTestSoapBindingImpl.getResourceProperty(AxisTes
tSoapBindingImpl.java:488)    at sampl

Invoke a call to Muse in Axis

2006-08-16 Thread ZHAO
Hello,I want to add identification function and maintain sessions in the Muse service. Now I have deployed one Muse service and one Axis service. I invoke a call to Muse service from Axis implemention file.(
e.g. Once the Axis service receives a GetResourceProperty soap request, it will do the invocation to Muse service to get the required resource property.) 
The following is the code of method getResourceProperty in the Axis generated impl file. But it dose not work, it returns a NullPointer Exception. I don't know where the problem is. Can anyone help?Thanks in advance.
I attach as well the WSDL file,  the GetResourceProperty.soap and GetResourceProperty.xml.    public org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse getResourceProperty(
javax.xml.namespace.QName getResourcePropertyRequest) throws java.rmi.RemoteException, org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.InvalidResourcePropertyQNameFaultType, org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.ResourceUnknownFaultType

 {        try{        String endpoint="http://localhost:8080/muse/services/router5
";        String uri = "
http://example.org/services/Router5";        InputStream is =ClassLoader.getSystemResourceAsStream("C:/axis-1_4/samples/AxisTest1/requests/GetResourceProperty.xml");        System.err.print

("input stream: "+is.toString());        ServiceFactory sfactory = (org.apache.axis.client.ServiceFactory)ServiceFactory.newInstance();                URL wsdlURL = new URL("

http://localhost:8080/muse/services/router5?wsdl");    QName serviceQname = new QName("
http://example.org/services/Router5", "RouterService");
    Service service = (org.apache.axis.client.Service)sfactory.createService(wsdlURL, serviceQname);    //the port name becomes the service name in the wsdd generated by Wsdl2Java    QName portQname = new QName("
http://example.org/services/Router5", "router5");            Call call = (Call)service.createCall (portQname,"GetResourceProperty");
    call.setTargetEndpointAddress(endpoint);    call.setProperty(Call.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);    call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);    
call.setProperty(Call.SOAPACTION_URI_PROPERTY, uri);    call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "");    call.setProperty(Call.OPERATION_STYLE_PROPERTY, "document");
    call.setOperationName(new QName("http://example.org/services/Router5","GetResourceProperty"));
        QName qn1=new QName("
http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl
","GetResourceProperty");
//    QName qn2=new QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl
","GetResourcePropertyResponse");    call.addParameter("ResourceId",qn1,ParameterMode.IN);//    call.setReturnType(qn2,org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse.class

);//    QName qn3=new QName("http://example.org/services/Router5","ResourceId");
//    String stri="ResourceId";//    Object[] ob=(stri);
//    org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse res=(org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse

)call.invoke(qn3,ob);           org.apache.axis.message.SOAPEnvelope envelope = new org.apache.axis.message.SOAPEnvelope();    org.apache.axis.message.SOAPBodyElement bodyelement = new 
org.apache.axis.message.SOAPBodyElement(is);       bodyelement.setNamespaceURI("http://example.org/services/Router5
");        
envelope.addBodyElement(bodyelement);    org.apache.axis.message.SOAPEnvelope elms = (org.apache.axis.message.SOAPEnvelope)call.invoke(envelope);    org.apache.axis.message.SOAPBodyElement elem = 
elms.getFirstBody
();    String str=elem.getAsString();    System.err.print(str);    }        catch(SOAPException se){            System.err.println("SOAPException: '" + se.getMessage

() + "'");    System.err.println("  Cause:  '" + se.getCause().getClass().getName() + "': " + se.getCause().getMessage());            return null;        }    catch (IOException ioe)
    {  System.err.println("IOException writing SOAPMessage:  '" + ioe.getMessage() + "'");  return null;    }    catch(Exception e){    e.printStackTrace

();    }     return null; }the exception posted in the server: java.lang.NullPointerException    at samples.AxisTest1.AxisTestSoapBindingImpl.getResourceProperty(AxisTes
tSoapBindingImpl.java:488)    at sampl

Invoke a call to Muse in Axis

2006-08-16 Thread ZHAO
Hello,I want to add identification function and maintain sessions in the Muse service. Now I have deployed one Muse service and one Axis service. I invoke a call to Muse service from Axis implemention file.(
e.g. Once the Axis service receives a GetResourceProperty soap request, it will do the invocation to Muse service to get the required resource property.) 
The following is the code of method getResourceProperty in the Axis generated impl file. But it dose not work, it returns a NullPointer Exception. I don't know where the problem is. Can anyone help?Thanks in advance.
I attach as well the WSDL file,  the GetResourceProperty.soap and GetResourceProperty.xml.    public org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse getResourceProperty(
javax.xml.namespace.QName getResourcePropertyRequest) throws java.rmi.RemoteException, org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.InvalidResourcePropertyQNameFaultType, org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.ResourceUnknownFaultType

 {        try{        String endpoint="http://localhost:8080/muse/services/router5
";        String uri = "
http://example.org/services/Router5";        InputStream is =ClassLoader.getSystemResourceAsStream("C:/axis-1_4/samples/AxisTest1/requests/GetResourceProperty.xml");        System.err.print

("input stream: "+is.toString());        ServiceFactory sfactory = (org.apache.axis.client.ServiceFactory)ServiceFactory.newInstance();                URL wsdlURL = new URL("

http://localhost:8080/muse/services/router5?wsdl");    QName serviceQname = new QName("
http://example.org/services/Router5", "RouterService");
    Service service = (org.apache.axis.client.Service)sfactory.createService(wsdlURL, serviceQname);    //the port name becomes the service name in the wsdd generated by Wsdl2Java    QName portQname = new QName("
http://example.org/services/Router5", "router5");            Call call = (Call)service.createCall (portQname,"GetResourceProperty");
    call.setTargetEndpointAddress(endpoint);    call.setProperty(Call.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);    call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);    
call.setProperty(Call.SOAPACTION_URI_PROPERTY, uri);    call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "");    call.setProperty(Call.OPERATION_STYLE_PROPERTY, "document");
    call.setOperationName(new QName("http://example.org/services/Router5","GetResourceProperty"));
        QName qn1=new QName("
http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl
","GetResourceProperty");
//    QName qn2=new QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl
","GetResourcePropertyResponse");    call.addParameter("ResourceId",qn1,ParameterMode.IN);//    call.setReturnType(qn2,org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse.class

);//    QName qn3=new QName("http://example.org/services/Router5","ResourceId");
//    String stri="ResourceId";//    Object[] ob=(stri);
//    org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse res=(org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse

)call.invoke(qn3,ob);           org.apache.axis.message.SOAPEnvelope envelope = new org.apache.axis.message.SOAPEnvelope();    org.apache.axis.message.SOAPBodyElement bodyelement = new 
org.apache.axis.message.SOAPBodyElement(is);       bodyelement.setNamespaceURI("http://example.org/services/Router5
");        
envelope.addBodyElement(bodyelement);    org.apache.axis.message.SOAPEnvelope elms = (org.apache.axis.message.SOAPEnvelope)call.invoke(envelope);    org.apache.axis.message.SOAPBodyElement elem = 
elms.getFirstBody
();    String str=elem.getAsString();    System.err.print(str);    }        catch(SOAPException se){            System.err.println("SOAPException: '" + se.getMessage

() + "'");    System.err.println("  Cause:  '" + se.getCause().getClass().getName() + "': " + se.getCause().getMessage());            return null;        }    catch (IOException ioe)
    {  System.err.println("IOException writing SOAPMessage:  '" + ioe.getMessage() + "'");  return null;    }    catch(Exception e){    e.printStackTrace

();    }     return null; }the exception posted in the server: java.lang.NullPointerException    at samples.AxisTest1.AxisTestSoapBindingImpl.getResourceProperty(AxisTes
tSoapBindingImpl.java:488)    at sampl