facebook

Import WSDL and use Webservice

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #317904 Reply

    morth123
    Member

    Hi,

    I tried to import a WSDL file and consume the webservice from a JSP and I am getting following error. Import WSDL from URL was fine and all the necessary java files are generated without any errors. But when I try to invoke the webservice, I am getting the following error.

    Can somebody help if I am doing anything wrong. I’ve been struggling to fix this problem since last few days.

    IQueryAsAServiceSoapEndpoint.java – autogenerated by myecllipse.
    ———————————————————————————-
    package com.myproj.jaxws;

    import test.QaaWSHeader;
    import test.RunQueryAsAService;
    import test.RunQueryAsAServiceResponse;

    import javax.jws.soap.*;
    import javax.xml.ws.*;
    import javax.jws.*;

    /**
    */

    @WebService
    (wsdlLocation = “/wsdls/localhost_8081/wsdl=1&cuid=aqipo1racm5hnnxfmqjf4oq/biws/qaawsservices/dswsbobje/dswsbobje.wsdl”, targetNamespace = “test”, name = “QueryAsAServiceSoap”)
    public interface IQueryAsAServiceSoapEndpoint {

    /**
    */
    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE, use = SOAPBinding.Use.LITERAL, style = SOAPBinding.Style.DOCUMENT)
    @WebResult(targetNamespace = “test”, name = “runQueryAsAServiceResponse”)
    @WebMethod(action = “test/runQueryAsAService”, operationName = “runQueryAsAService”)
    public RunQueryAsAServiceResponse RunQueryAsAService(@WebParam(partName = “runQueryAsAServicePart”, mode = WebParam.Mode.IN, targetNamespace = “test”, name = “runQueryAsAService”) RunQueryAsAService runQueryAsAService, @WebParam(partName = “QaaWSHeaderPart”, mode = WebParam.Mode.IN, targetNamespace = “test”, name = “QaaWSHeader”) QaaWSHeader QaaWSHeader, @WebParam(partName = “QaaWSHeaderInputPart”, header = true, mode = WebParam.Mode.IN, name = “QaaWSHeaderInput”) QaaWSHeader QaaWSHeaderInput);
    }
    ———————————————————————————-
    JSP Code:

    <%@ page import=”com.myproj.QueryAsAServiceSoap” %>
    <%@ page import=”com.myproj.jaxws.IQueryAsAServiceSoapEndpoint” %>
    <%@ page import=”com.myproj.jaxws.QueryAsAServiceSoapClient” %>
    <%@ page import=”test.QaaWSHeader” %>
    <%@ page import=”test.RunQueryAsAService” %>
    <%@ page import=”test.RunQueryAsAServiceResponse” %>
    <%@ page import=”java.util.*” %>
    <% QueryAsAServiceSoapClient wsClient = new QueryAsAServiceSoapClient();

    IQueryAsAServiceSoapEndpoint service = wsClient.getService();
    QaaWSHeader a = null;
    QaaWSHeader b= null;
    RunQueryAsAService c = new RunQueryAsAService();
    c.setLogin(“admin”);
    c.setPassword(“password123”);
    RunQueryAsAServiceResponse outResponse = service.RunQueryAsAService(c,a,b);%>

    ———————————————————————————-
    Error:

    org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 40

    37: RunQueryAsAService c = new RunQueryAsAService();
    38: c.setLogin(“admin”);
    39: c.setPassword(“password123”);
    40: RunQueryAsAServiceResponse outResponse = service.RunQueryAsAService(c,a,b);%>
    41: </html>

    root cause

    javax.xml.ws.soap.SOAPFaultException: Can’t find resource for bundle java.util.PropertyResourceBundle, key toomuch.attribute
    org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:147)
    $Proxy61.RunQueryAsAService(Unknown Source)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    root cause

    org.apache.cxf.binding.soap.SoapFault: Can’t find resource for bundle java.util.PropertyResourceBundle, key toomuch.attribute
    org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)
    org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
    org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
    org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
    org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96)
    org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
    org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
    org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
    org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:665)
    org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2160)
    org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2043)
    org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1941)
    org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
    org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:629)
    org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
    org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:479)
    org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:309)
    org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:261)
    org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
    org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:127)
    $Proxy61.RunQueryAsAService(Unknown Source)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    #317939 Reply

    support-tony
    Keymaster

    morth123,

    Could you provide us with a bit more detail on the steps you took to generate the service and the client from the WSDL? Can you attach the WSDL file used? Also, are you using MyEclipse tools to generate the code or have you installed a separate plug-in?

    It looks like the error is in the application code or the generated code. If you haven’t used MyEclipse tools to generate the code, I’m afraid you’ll probably have to ask the developers of the other plug-in for assistance. However, without the details we can’t be sure.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Import WSDL and use Webservice

You must be logged in to post in the forum log in