You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Håkon T Sønderland <ht...@antares.no> on 2005/12/09 14:02:02 UTC

Web service client: need help

Hi,

I'm trying to develop a web service client to consume an existing web
service using Axis 1.3/Java 1.4.

I generate the stub code using wsdl2java (classes are "InfoXMLStub"
etc).

When I try to call the web service using this code:


Header header
    = new Header(user,pass,subuser,custid,version);
InfoXML service = new InfoXMLLocator();
InfoXMLSoap port = service.getInfoXMLSoap();
Stub stub = (Stub)port;
stub.setHeader("https://www.creditinform.no/creditinform.standardwebservice.ws2005207/InfoXML","Header",header);
ReportPersonResponseReportPersonResult person
   = port.reportPerson("", strSocSecNumber, "", "", "", "", "");
MessageElement[] message = person.get_any();


I get exceptions in the log thus (from the port.reportPerson call):

12.09 13:52:16 DEBUG org.apache.axis.ConfigurationException - Exception:
org.apache.axis.ConfigurationException: No service named InfoXMLSoap is 
available
org.apache.axis.ConfigurationException: No service named InfoXMLSoap is 
available
	at 
org.apache.axis.configuration.FileProvider.getService(FileProvider.java:233)
	at org.apache.axis.AxisEngine.getService(AxisEngine.java:311)
	at org.apache.axis.MessageContext.setTargetService(MessageContext.java:755)
	at org.apache.axis.client.Call.invoke(Call.java:2690)
	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 
com.antares.creditinform.standardwebservice.InfoXMLSoapStub.reportPerson(Unknown 
Source)
	at 
com.antares.creditinform.standardwebservice.client.WSClient.getPersonResult(Unknown 
Source)

What can be the problem here?

Many thanks for any help
Håkon
-- 
We shall fight on the beaches,
we shall fight on the landing grounds,
we shall fight in the fields and in the streets,
we shall fight in the hills;
we shall never surrender
http://www.getfirefox.com/

Re: Web service client: need help

Posted by Håkon T Sønderland <ht...@antares.no>.
Håkon T Sønderland wrote:
> Thanks a lot, I need to take a look at the next exception in the log then,
> because it certainly isn't working ;)
> I was assuming this was the problem since it is the first exception that
> is cast.  I thought the rest was just follow-ons from this one and thus
> ignored them.
> 

OK, next try. I'm seeing this exception further down in the log file:

12.09 13:52:17 DEBUG org.apache.axis.utils.NSStack - NSPop (empty)
AxisFault
  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
  faultSubcode:
  faultString: javax.net.ssl.SSLHandshakeException: 
sun.security.validator.ValidatorException: No trusted certificate found
  faultActor:
  faultNode:
  faultDetail:
	{http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLHandshakeException: 
sun.security.validator.ValidatorException: No trusted certificate found
	at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275)
	at 
org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
	at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
	at 
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
	at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
	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)

and:

javax.net.ssl.SSLHandshakeException: 
sun.security.validator.ValidatorException: No trusted certificate found
	at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
	at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
	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)

This sort of sounds to me that the certificate at the web-service end is
broken, but since this is a web-service used by many customers that does
not sound plausible.

Any ideas on what can be wrong on my end for this to happen?

Thanks,
Håkon




-- 
We shall fight on the beaches,
we shall fight on the landing grounds,
we shall fight in the fields and in the streets,
we shall fight in the hills;
we shall never surrender
http://www.getfirefox.com/

Re: Web service client: need help

Posted by Håkon T Sønderland <ht...@antares.no>.
Ron Reynolds wrote:
> i see this "error" (notice it's logged at the DEBUG level) even when things
> are running normally.  do you get any exceptions thrown in your client code
> when you try to use the stub?
> 
> the reason this is logged is because this code (AxisEngine:308):
>     public SOAPService getService(String name) throws AxisFault
>     {
>         try {
>             return config.getService(new QName(null, name));
>         } catch (ConfigurationException e) {
>             try {
>                 return config.getServiceByNamespaceURI(name);
>             } catch (ConfigurationException e1) {
>                 throw new AxisFault(e);
>             }
>         }
>     }
> depends on an exception being thrown on the first attempt (line 311 in your
> stack trace) to then try a different method of finding the service (which
> probably succeeds since you see no log of that AxisFault on line 316).  the
> reason you see a log entry is because in ConfigurationException's ctor the
> exception object logs itself (at debug level) to its own log category.  this
> part is questionable (i've never seen an exception log itself) since in this
> case the exception is "normal" and you're not the first person to be a bit
> concerned by an exception showing up in your logs...
> 

Thanks a lot, I need to take a look at the next exception in the log then,
because it certainly isn't working ;)
I was assuming this was the problem since it is the first exception that
is cast.  I thought the rest was just follow-ons from this one and thus
ignored them.

Thanks again Ron , you are most helpful.

Håkon


Re: Web service client: need help

Posted by Ron Reynolds <Ro...@RonReynolds.com>.
i see this "error" (notice it's logged at the DEBUG level) even when things
are running normally.  do you get any exceptions thrown in your client code
when you try to use the stub?

the reason this is logged is because this code (AxisEngine:308):
    public SOAPService getService(String name) throws AxisFault
    {
        try {
            return config.getService(new QName(null, name));
        } catch (ConfigurationException e) {
            try {
                return config.getServiceByNamespaceURI(name);
            } catch (ConfigurationException e1) {
                throw new AxisFault(e);
            }
        }
    }
depends on an exception being thrown on the first attempt (line 311 in your
stack trace) to then try a different method of finding the service (which
probably succeeds since you see no log of that AxisFault on line 316).  the
reason you see a log entry is because in ConfigurationException's ctor the
exception object logs itself (at debug level) to its own log category.  this
part is questionable (i've never seen an exception log itself) since in this
case the exception is "normal" and you're not the first person to be a bit
concerned by an exception showing up in your logs...

> Hi,
>
> I'm trying to develop a web service client to consume an existing web
> service using Axis 1.3/Java 1.4.
>
> I generate the stub code using wsdl2java (classes are "InfoXMLStub"
> etc).
>
> When I try to call the web service using this code:
>
>
> Header header
>     = new Header(user,pass,subuser,custid,version);
> InfoXML service = new InfoXMLLocator();
> InfoXMLSoap port = service.getInfoXMLSoap();
> Stub stub = (Stub)port;
> stub.setHeader("https://www.creditinform.no/creditinform.standardwebservice.ws2005207/InfoXML","Header",header);
> ReportPersonResponseReportPersonResult person
>    = port.reportPerson("", strSocSecNumber, "", "", "", "", "");
> MessageElement[] message = person.get_any();
>
>
> I get exceptions in the log thus (from the port.reportPerson call):
>
> 12.09 13:52:16 DEBUG org.apache.axis.ConfigurationException - Exception:
> org.apache.axis.ConfigurationException: No service named InfoXMLSoap is
> available
> org.apache.axis.ConfigurationException: No service named InfoXMLSoap is
> available
> 	at
> org.apache.axis.configuration.FileProvider.getService(FileProvider.java:233)
> 	at org.apache.axis.AxisEngine.getService(AxisEngine.java:311)
> 	at org.apache.axis.MessageContext.setTargetService(MessageContext.java:755)
> 	at org.apache.axis.client.Call.invoke(Call.java:2690)
> 	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
> com.antares.creditinform.standardwebservice.InfoXMLSoapStub.reportPerson(Unknown
> Source)
> 	at
> com.antares.creditinform.standardwebservice.client.WSClient.getPersonResult(Unknown
> Source)
>
> What can be the problem here?
>
> Many thanks for any help
> Håkon
> --
> We shall fight on the beaches,
> we shall fight on the landing grounds,
> we shall fight in the fields and in the streets,
> we shall fight in the hills;
> we shall never surrender
> http://www.getfirefox.com/
>