Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5381

wsdl2Java: operation location doesn't concatenate with address location (or with endpoint)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.2
    • Fix Version/s: None
    • Component/s: wsdl
    • Labels:
    • Environment:
      Axis2 1.6.2 (wsdl2java)
      VacalPassword.wsdl (from the VacalPassword WS Server - www.nuance.com)

      Description

      Hello,

      Using the wsdl2java utility we generate from the VocalPassword.wsdl the Java source code files (VocalPasswordServer.java, VocalPasswordServerCallbackHandler.java, VocalPasswordServerStub.java) which contains the code for binding to the VocalPassword web service, sending the request and receiving the response. But then we are trying to use these Java stubs to invoke request to the VocalPassword web service – we get the “exception org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found”

      Root cause:

      According to the Web Services Description Language (WSDL) speciation (http://www.w3.org/TR/wsdl) part 4.5 http:operation, http:operation location is combined with the URI specified in the http:address element to form the full URI for the HTTP request.
      Initial VocalPassword.wsdl includes
      <http:operation location="/StartSession" />
      and
      <http:address location="http://localhost/VocalPassword/VocalPasswordServer.asmx" />

      But when we are trying to send the POST request to the VocalPassword web service, instead of the

      POST /VocalPassword/VocalPasswordServer.asmx/StartSession HTTP/1.1
      Host: 192.168.108.119
      Content-Type: application/x-www-form-urlencoded
      Content-Length: length
      configSetName=string

      the following request

      POST /StartSession HTTP/1.1
      Host: 192.168.108.119
      Content-Type: application/x-www-form-urlencoded
      Content-Length: length
      configSetName=string

      is received by the VocalPassword ws server.
      i.e. “/VocalPassword/VocalPasswordServer.asmx” (http:address location) is missed in the POST request.

      Here are our steps:

      1) GenerateVocalPassword Java stubs using the VocalPassword.wsdl
      wsdl2java -uri VocalPassword.wsdl -o . -p httppost -pn VocalPasswordServerHttpPost -uw -uon -u –Eosv

      2) Compile created Java stubs by Ant
      ant

      This command will invoke JDK to compile created Java stubs. The compiled files will be packed into JAR file and placed to \build\lib\ subdirectory

      3) Set VocalPassword operation name (in our case - StartSession) , pass to the VocalPasswordServerStub (VocalPasswordServerStub.java) constructor your endpoint (in our case - “http:// 192.168.108.119/VocalPassword/VocalPasswordServer.asmx”) and send request to VocalPassword ws server.
      !!! In your case, for problem reproducing use your own system with configured sniffer tool (e.g. Wireshark) instead of the VocalPassword ws server (i.e. configured ws server is not needed).

      Expected result:

      POST /VocalPassword/VocalPasswordServer.asmx/StartSession HTTP/1.1
      Host: 192.168.108.119
      Content-Type: application/x-www-form-urlencoded
      Content-Length: length
      configSetName=string

      is received by the ws server

      Actual result:

      POST /StartSession HTTP/1.1
      Host: 192.168.108.119
      Content-Type: application/x-www-form-urlencoded
      Content-Length: length
      configSetName=string

      is received by the ws server and exception org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found occurs.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mkuzmin Mikhail Kuzmin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: