facebook

[Closed] Web Service does not exist! Lifejacket is on!

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

    Russ
    Member

    First of all, the Web service I am working on has been working……..using another tool and running of several servers. I am updating to X-Fire and with the new MyEclipse 5.5M1. I am running into issues because MyEclipse is catching many more errors than the other tools…(that’s the good part). However, I am still not able to run the web service using X-Fire 1.2.4 and Web Service Explorer.

    This is what I am sending in the request:

    
    <soapenv:Envelope>
          <soapenv:Body>
        <ns0:getTaskDetails>
            <String_1>me_me_me</String_1>
            <String_2>blah_blah</String_2>
        </ns0:getTaskDetails>
         </soapenv:Body>
    </soapenv:Envelope>
    

    MY response from the server is:

    
    <soap:Envelope>
        <soap:Body>
        <soap:Fault>
                   <faultcode>soap:Client</faultcode>
          <faultstring>Parameter {http://webservice.prod.dept.company.com/WebServiceBean_SEI}getTaskDetails does not exist!</faultstring>
        </soap:Fault>
        </soap:Body>
    </soap:Envelope>
    

    My first thought is the

    
    <portType name="WebServiceBean_SEI">
    <operation name="getTaskDetails">
          <soap:operation soapAction="http://webservice.prod.dept.company.com/WebServiceBean_SEI/getTaskDetails" />
          <input>
            <soap:body use="literal" namespace="http://webservice.prod.dept.company.com/WebServiceBean_SEI/"/>
          </input>
          <output>
            <soap:body use="literal" namespace="http://webservice.prod.dept.company.com/WebServiceBean_SEI/"/>
          </output>
    </operation>
    .......
    </portType>
    

    When I go and look at the service definition in the WSDL, the URL is

    
    <service name="WebServiceBean">
        <port name="WebServiceBeanPort" binding="tns:WebServiceBean_SEIBinding">
          <soap:address location="http://localhost:8080/JBOSSWebService/services/WebServiceBean"/>
       </port>
    </service>
    

    When I define the web service in the WSDL, the URL is:

    
      targetNamespace="http://webservice.prod.dept.company.com/" 
       xmlns:tns="http://webservice.prod.dept.company.com" 
    

    My point in all this is the tool is a little more advance than the other tools I am using and I must ensure the namespaces and URL are right.. This is my point of confusion.

    Any suggesting in my case would be warmly received………..

    Russ

    #267604 Reply

    Riyad Kalla
    Member

    Russ,
    I’m confused… is something not working, or are you just asking for advice as to how to name name spaces?

    #267646 Reply

    Russ
    Member

    My first thought is the Client/Web Service Explorer are not able to find the service because the URLs are not aligning properly. When I started looking at the namespaces and URLS being created from the WSDL, this is where I became confused…..

    #267726 Reply

    Russ
    Member

    Okay, I started fresh in an attempt to figure out why the Web Service is not working. I created a new web service project and wsdl (single method call inside the WSDL). I used MyEclipse in the entire process. What is different between the two approaches (using MyEclipse’s WSDL/my WSDL) is I am not getting the method name classes (request/response) generated. Furthermore, the object factory and package-info classes are not generated. This is the noticeable difference in the build process between the two top-down approaches.

    What is interesting is my WSDL passes validation and BP-I inspection from MyEclipse.

    Can someone explain the process which prevents the method name classes from being created? I am sure my WSDL has another problem which has not been caught by the validation or BP-I inspection.

    Russ

    #267731 Reply

    Riyad Kalla
    Member

    Russ, this is way out of my league. I’ll ask someone from WS to follow up.

    #267735 Reply

    tomeksz
    Member

    You have different style/use combinations
    document/literal = no element with method name generate
    document/wrapped = method name generated

    #267751 Reply

    Russ
    Member

    The issue was the binding style. When I created the WSDL in MyEclipse I used the document as the style. When I changed the style to rpc, this stopped the tool from generating the request and response classes.

    #267768 Reply

    Russ
    Member

    Okay…….I’ve come full circle using MyEclipse.

    First of all, there is a difference between WSDLs when using JBOSS. My WSDL was created using “rpc” style binding, but JBoss will convert it to a “document” style binding when you test the WSDL using the URL. What I did was to re-generate the WSDL through MyEclipse using the “document” SOAP binding option. This allows the two WSDLs to be the same.

    
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
                      xmlns:tns="http://webservice.prod.dept.company.com/JBossWebService/" 
                      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                      name="JBossWebService" 
                      targetNamespace="http://webservice.prod.dept.company.com/JBossWebService/">
    <wsdl:types>
        <xsd:schema targetNamespace="http://webservice.prod.dept.company.com/JBossWebService/">
            <xsd:element name="getTaskDetails">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="userId" type="xsd:string"/>
                        <xsd:element name="taskId" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="getTaskDetailsResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="getTaskDetailsResults" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
    </wsdl:types>
    
    
    <wsdl:message name="getTaskDetailsRequest">
        <wsdl:part element="tns:getTaskDetails" name="parameters"/>
    </wsdl:message>
    
    <wsdl:message name="getTaskDetailsResponse">
        <wsdl:part element="tns:getTaskDetailsResponse" name="parameters"/>
    </wsdl:message>
    
    <wsdl:portType name="JBossWebService">
        <wsdl:operation name="getTaskDetails">
            <wsdl:input message="tns:getTaskDetailsRequest"/>
            <wsdl:output message="tns:getTaskDetailsResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    
    
    <wsdl:binding name="JBossWebServiceSOAP" type="tns:JBossWebService">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
            <wsdl:operation name="getTaskDetails">
                <soap:operation soapAction="http://webservice.prod.dept.company.com/JBossWebService/getTaskDetails"/>
                    <wsdl:input>
                        <soap:body use="literal"/>
                    </wsdl:input>
                    <wsdl:output>
                        <soap:body use="literal"/>
                    </wsdl:output>
            </wsdl:operation>
    </wsdl:binding>
    
    
    <wsdl:service name="JBossWebService">
        <wsdl:port binding="tns:JBossWebServiceSOAP" name="JBossWebServiceSOAP">
            <soap:address location="http://localhost:8080/JBOSSWebService/services/JBossWebService"/>
        </wsdl:port>
    </wsdl:service>
    
    </wsdl:definitions>
    

    Next, I created a separate Web Project and placed the client code (MyEclipse/XFire generated code) within this project. I re-deployed the application with the new Web Service created by MyEclipse. I verified the Web Service Project was working by touching the WSDL using the URL: http://localhost:8080/JBOSSWebService/services/JBossWebService?wsdl This works and I can see the WSDL.

    Now, I run the Client program while monitoring the ports using tcpmon….. and I am experiencing the same error I reported earlier………. When I try running the service using the Web Service Explorer, I get the same error:

    
    Mar 20, 2007 3:49:09 PM org.apache.commons.httpclient.HttpMethodBase writeRequest
    INFO: 100 (continue) read timeout. Resume sending the request
    Mar 20, 2007 3:49:10 PM org.apache.commons.httpclient.HttpMethodBase readResponse
    INFO: Discarding unexpected response: HTTP/1.1 100 Continue
    Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Parameter {http://webservice.prod.dept.company.com/JBossWebService/}getTaskDetails does not exist!
    org.codehaus.xfire.fault.XFireFault: Parameter {http://webservice.prod.dept.company.com/JBossWebService/}getTaskDetails does not exist!
        at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)
        at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28)
        at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:111)
        at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)
        at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.client.Client.onReceive(Client.java:382)
        at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
        at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
        at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
        at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
        at org.codehaus.xfire.client.Client.invoke(Client.java:335)
        at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
        at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
        at $Proxy8.getTaskDetails(Unknown Source)
        at com.company.dept.prod.webservice.client.JBossWebServiceClient.main(JBossWebServiceClient.java:143)
    

    The outgoing message is:

    
    POST /JBOSSWebService/services/JBossWebService HTTP/1.1
    SOAPAction: "http://webservice.prod.dept.company.com/JBossWebService/getTaskDetails"
    Content-Type: text/xml; charset=UTF-8
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client +http://xfire.codehaus.org)
    Host: localhost:8181
    Expect: 100-continue
    Content-Length: 478
    
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Body>
       <getTaskDetails xmlns="http://webservice.prod.dept.company.com/JBossWebService/">
              <userId xmlns="http://webservice.prod.dept.company.com/JBossWebService/">blah blah</userId>
              <taskId xmlns="http://webservice.prod.dept.company.com/JBossWebService/">1234567890</taskId>
        </getTaskDetails>
    </soap:Body>
    </soap:Envelope>
    

    The response is:

    
    HTTP/1.1 100 Continue
    
    HTTP/1.1 500 Internal Server Error
    Server: Apache-Coyote/1.1
    X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
    Content-Type: text/xml;charset=UTF-8
    Transfer-Encoding: chunked
    Date: Tue, 20 Mar 2007 20:49:10 GMT
    Connection: close
    
    185
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    
    <soap:Body>
      <soap:Fault>
             <faultcode>soap:Client</faultcode>
             <faultstring>Parameter {http://webservice.prod.dept.company.com/JBossWebService/}getTaskDetails does not exist!</faultstring>
       </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    0
    

    When I go looking at the definition of the Fault code I see this:

    
    The Client fault code signifies that the node that sent the SOAP message caused the error. Basically, if the receiver cannot process the SOAP message because there is something wrong with the message or its data, it's considered the fault of the client, the sender. The receiving node generates a Client fault if the message is not well formed, or contains invalid data, or ****lacks information that was expected, like a specific header ***.  
    

    Based upon this, I am leaning toward the conclusion there are issues involving web services unless someone can see something that I do not…….

    Russ

    #267780 Reply

    Russ
    Member

    Just to be sure I did not misunderstand you, I changed my services.xml to the following:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://xfire.codehaus.org/config/1.0">
        <service>
            <name>JBossWebService</name>
            <namespace>http://webservice.prod.dept.company.com/JBossWebService/</namespace>
            <serviceClass>com.company.dept.prod.webservice.JBossWebServiceImpl</serviceClass>
            <serviceFactory>org.codehaus.xfire.jaxb2.JaxbServiceFactory</serviceFactory>
            <style>document</style>
            <use>wrapped</use>
            <scope>application</scope>
        </service>
    </beans>
    

    When I do this and run the client code, I get the following error:

    
    Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.setParams(Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;)V
        at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.createClient(CommonsHttpMessageSender.java:198)
        at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.open(CommonsHttpMessageSender.java:113)
        at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:121)
        at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
        at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
        at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
        at org.codehaus.xfire.client.Client.invoke(Client.java:335)
        at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
        at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
        at $Proxy8.getTaskDetails(Unknown Source)
        at com.company.dept.prod.webservice.client.JBossWebServiceClient.main(JBossWebServiceClient.java:190)
    
    #267789 Reply

    tomeksz
    Member

    This error looks like classpath problem

    #267801 Reply

    Russ
    Member

    Well…..I have included the XFire Core, XFire HTTP Client, XFire JAXB2, XFire Miscellaneous, and XFire Security Libraries in the classpath…. Based on all the literature I think I have the client setup properly.

    Any suggestions what jar file is missing? I was under the impression this jar was within the XFire 1.2 HTTP Client Library, i.e. commons-httpclient-3.0.jar.

    #267803 Reply

    tomeksz
    Member

    Maybe you have duplicated jars ( commons-httpclient probably ) in your classpath.

    #267811 Reply

    Russ
    Member

    Okay, maybe I don’t understand………….but I am following the MyEclipse program model………. I am deploying to a JBoss server with standard configuration. Do we have an incompatibility issue here between MyEclipse and JBoss base on duplicate jar files?

    I don’t mean to be unappreciative, but it sounds like we are guessing now……..

    This thread is getting to big…going tostart a new one……….

    #267846 Reply

    Russ
    Member

    I have it working………thanks for your help!

    #268004 Reply

    Riyad Kalla
    Member

    Russ, can you give us a quick followup on how you got it working for anyone else that find this thread and need it for help?

Viewing 15 posts - 1 through 15 (of 17 total)
Reply To: [Closed] Web Service does not exist! Lifejacket is on!

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