Loading ...
Sorry, an error occurred while loading the content.
 

doubt on wsdl2java

Expand Messages
  • cinthia.menon
    Hi all, I need some help w.r.t web services in java. I have a wsdl file and i need to send and receive calls to this wsdl url or file through java program.
    Message 1 of 2 , Dec 24 9:18 AM
      Hi all,

      I need some help w.r.t web services in java. I have a wsdl file and i
      need to send and receive calls to this wsdl url or file through java
      program. This url needs authentication (user name and pwd). So for
      this, i have used the wsdl2java tool(by downloading xerces,axis and
      installing tomcat) to convert the wsdl into java classes and i wrote a
      small client program to call this java classes. I am having a problem
      now. The client program compiles succesfully but the when i run it, it
      gives a "missing authentication header" exception. Actually from the
      wsdl file i have, there is a class called AuthenticationHeader.java
      also generated. I called setUsername and setPassword methods available
      on this class to set the username and password for the wsdl url but
      this does not help. I don't understand if this is the right way to do
      it. The complete exception details are:



      Exception in thread "main" AxisFault
      faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
      faultSubcode:
      faultString: Missing authentication header.
      faultActor:
      faultNode:
      faultDetail:
      {http://xml.apache.org/axis/}stackTrace:Missing authentication
      header.
      at
      org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
      .java:222)
      at
      org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
      java:129)
      at
      org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
      ationContext.java:1087)
      at
      org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source
      )
      at
      org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
      n Source)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
      Dispatcher.dispatch(Unknown Source)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
      known Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
      Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
      Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
      Source)
      at
      org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour
      ce)
      at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
      at
      org.apache.axis.encoding.DeserializationContext.parse(Deserialization
      Context.java:227)
      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
      at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
      at
      org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
      tandChecker.java:62)
      at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
      at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
      at org.apache.axis.client.Call.invoke(Call.java:2767)
      at org.apache.axis.client.Call.invoke(Call.java:2443)
      at org.apache.axis.client.Call.invoke(Call.java:2366)
      at org.apache.axis.client.Call.invoke(Call.java:1812)
      at
      new5.wsdl.VMware_x0020_Lab_x0020_Manager_x0020_SOAP_x0020_interface
      Soap_BindingStub.getTemplateByName
      (VMware_x0020_Lab_x0020_Manager_x0020_SOAP_x
      0020_interfaceSoap_BindingStub.java:2132)
      at Client.main(Client.java:57)

      {http://xml.apache.org/axis/}hostname:supraja-win

      Missing authentication header.
      at
      org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
      .java:222)
      at
      org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
      java:129)
      at
      org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
      ationContext.java:1087)
      at
      org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source
      )
      at
      org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
      n Source)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
      Dispatcher.dispatch(Unknown Source)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
      known Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
      Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
      Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
      Source)
      at
      org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour
      ce)
      at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
      at
      org.apache.axis.encoding.DeserializationContext.parse(Deserialization
      Context.java:227)
      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
      at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
      at
      org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
      tandChecker.java:62)
      at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
      at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
      at org.apache.axis.client.Call.invoke(Call.java:2767)
      at org.apache.axis.client.Call.invoke(Call.java:2443)
      at org.apache.axis.client.Call.invoke(Call.java:2366)
      at org.apache.axis.client.Call.invoke(Call.java:1812)
      at
      new5.wsdl.VMware_x0020_Lab_x0020_Manager_x0020_SOAP_x0020_interface
      Soap_BindingStub.getTemplateByName
      (VMware_x0020_Lab_x0020_Manager_x0020_SOAP_x
      0020_interfaceSoap_BindingStub.java:2132)
      at Client.main(Client.java:57)


      Any help would be really appreciated regardng this. Many thanks in
      advance
    • Anne Thomas Manes
      I suggest you ask your question on the axis-user discussion list. Please also attach your WSDL to your question. My guess is that you need to specify your user
      Message 2 of 2 , Dec 25 4:46 AM
        I suggest you ask your question on the axis-user discussion list.
        Please also attach your WSDL to your question.

        My guess is that you need to specify your user name and password in a
        SOAP header rather than in the HTTP header, but I can't tell without
        seeing the WSDL.

        Anne

        On Dec 24, 2007 12:18 PM, cinthia.menon <cinthia.menon@...> wrote:
        >
        >
        >
        >
        >
        >
        > Hi all,
        >
        > I need some help w.r.t web services in java. I have a wsdl file and i
        > need to send and receive calls to this wsdl url or file through java
        > program. This url needs authentication (user name and pwd). So for
        > this, i have used the wsdl2java tool(by downloading xerces,axis and
        > installing tomcat) to convert the wsdl into java classes and i wrote a
        > small client program to call this java classes. I am having a problem
        > now. The client program compiles succesfully but the when i run it, it
        > gives a "missing authentication header" exception. Actually from the
        > wsdl file i have, there is a class called AuthenticationHeader.java
        > also generated. I called setUsername and setPassword methods available
        > on this class to set the username and password for the wsdl url but
        > this does not help. I don't understand if this is the right way to do
        > it. The complete exception details are:
        >
        > Exception in thread "main" AxisFault
        > faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
        > faultSubcode:
        > faultString: Missing authentication header.
        > faultActor:
        > faultNode:
        > faultDetail:
        > {http://xml.apache.org/axis/}stackTrace:Missing authentication
        > header.
        > at
        > org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
        > .java:222)
        > at
        > org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
        > java:129)
        > at
        > org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
        > ationContext.java:1087)
        > at
        > org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source
        > )
        > at
        > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
        > n Source)
        > at
        > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
        > Dispatcher.dispatch(Unknown Source)
        > at
        > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
        > known Source)
        > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
        > Source)
        > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
        > Source)
        > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
        > Source)
        > at
        > org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour
        > ce)
        > at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
        > at
        > org.apache.axis.encoding.DeserializationContext.parse(Deserialization
        > Context.java:227)
        > at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
        > at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
        > at
        > org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
        > tandChecker.java:62)
        > at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
        > at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        > at org.apache.axis.client.Call.invoke(Call.java:2767)
        > at org.apache.axis.client.Call.invoke(Call.java:2443)
        > at org.apache.axis.client.Call.invoke(Call.java:2366)
        > at org.apache.axis.client.Call.invoke(Call.java:1812)
        > at
        > new5.wsdl.VMware_x0020_Lab_x0020_Manager_x0020_SOAP_x0020_interface
        > Soap_BindingStub.getTemplateByName
        > (VMware_x0020_Lab_x0020_Manager_x0020_SOAP_x
        > 0020_interfaceSoap_BindingStub.java:2132)
        > at Client.main(Client.java:57)
        >
        > {http://xml.apache.org/axis/}hostname:supraja-win
        >
        > Missing authentication header.
        > at
        > org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
        > .java:222)
        > at
        > org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
        > java:129)
        > at
        > org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
        > ationContext.java:1087)
        > at
        > org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source
        > )
        > at
        > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
        > n Source)
        > at
        > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
        > Dispatcher.dispatch(Unknown Source)
        > at
        > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
        > known Source)
        > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
        > Source)
        > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
        > Source)
        > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
        > Source)
        > at
        > org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour
        > ce)
        > at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
        > at
        > org.apache.axis.encoding.DeserializationContext.parse(Deserialization
        > Context.java:227)
        > at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
        > at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
        > at
        > org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
        > tandChecker.java:62)
        > at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
        > at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        > at org.apache.axis.client.Call.invoke(Call.java:2767)
        > at org.apache.axis.client.Call.invoke(Call.java:2443)
        > at org.apache.axis.client.Call.invoke(Call.java:2366)
        > at org.apache.axis.client.Call.invoke(Call.java:1812)
        > at
        > new5.wsdl.VMware_x0020_Lab_x0020_Manager_x0020_SOAP_x0020_interface
        > Soap_BindingStub.getTemplateByName
        > (VMware_x0020_Lab_x0020_Manager_x0020_SOAP_x
        > 0020_interfaceSoap_BindingStub.java:2132)
        > at Client.main(Client.java:57)
        >
        > Any help would be really appreciated regardng this. Many thanks in
        > advance
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.