Sunday, December 23, 2007

[completeJava] Doubt on WSDL2Java

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

__._,_.___
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Search Ads

Get new customers.

List your web site

in Yahoo! Search.

Women of Curves

on Yahoo! Groups

see how women are

changing their lives.

.

__,_._,___

No comments: