Java - Accessing webservice problem

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Hi,

I'm trying to consume a webservice, without success so far.

I'm using Websphere Studio Application Developer 5.1.2, and I successfully created a webservice, deployed it on a test server environment. I can see it's working, because I created a web project with a webservice client proxy, and I can successfully call the methods of the webservice.

But what I'm trying to do now, is to access it through a regular Java project. I created a new Java project, added a weservice client (it created a proxy from the wsdl provided through url), I also added a class and start coding on the "main". When I try to access the web the same way I do with the webproject (the way it works), I get the following error:

Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:176)
at com.ibm.ws.webservices.engine.encoding.DefaultTypeMappingImpl.class$(DefaultTypeMappingImpl.java:128)
at com.ibm.ws.webservices.engine.encoding.DefaultTypeMappingImpl.<init>(DefaultTypeMappingImpl.java:311)
at com.ibm.ws.webservices.engine.encoding.DefaultTypeMappingImpl.getSingleton(DefaultTypeMappingImpl.java:138)
at com.ibm.ws.webservices.engine.encoding.TypeMappingRegistryImpl.<init>(TypeMappingRegistryImpl.java:206)
at com.ibm.ws.webservices.engine.configuration.SimpleEngineConfigurationProvider.getTypeMappingRegistry(SimpleEngineConfigurationProvider.java:201)
at com.ibm.ws.webservices.engine.configuration.SimpleEngineConfigurationProvider.getTypeMappingRegistry(SimpleEngineConfigurationProvider.java:197)
at com.ibm.ws.webservices.engine.WebServicesEngine.getTypeMappingRegistry(WebServicesEngine.java:426)
at com.ibm.ws.webservices.engine.client.Stub.getTypeMapping(Stub.java:617)
at pt.tap.webservice.ResourceBrokerSoapBindingStub.initTypeMapping(ResourceBrokerSoapBindingStub.java:27)
at pt.tap.webservice.ResourceBrokerSoapBindingStub.<init>(ResourceBrokerSoapBindingStub.java:20)
at pt.tap.webservice.ResourceBrokerServiceLocator.getResourceBroker(ResourceBrokerServiceLocator.java:44)
at pt.tap.webservice.ResourceBrokerServiceLocator.getResourceBroker(ResourceBrokerServiceLocator.java:39)
at pt.tap.webservice.ResourceBrokerProxy._initResourceBrokerProxy(ResourceBrokerProxy.java:24)
at pt.tap.webservice.ResourceBrokerProxy.<init>(ResourceBrokerProxy.java:9)
at RunAirportWeather.doResourceBroker(RunAirportWeather.java:30)
at RunAirportWeather.main(RunAirportWeather.java:42)
Caused by: java.lang.IllegalArgumentException: Unterminated quote
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:712)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:511)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:460)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:441)
at at com.ibm.ws.webservices.engine.types.Time.<clinit>(Time.java:89).null(Unkn
wn Source)
... 18 more

Don't know if I have to include any more classes, just need some helpl on understanding why it doesn't work ... google isn't helping much either ...

Thanks
 

lordex

Member
Feb 7, 2002
133
0
0
Caused by: java.lang.IllegalArgumentException: Unterminated quote
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:712)

Are you specifying a date format string somewhere which is missing a closing quote within the pattern?
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Yup, check your "RunAirportWeather.doResourceBroker(RunAirportWeather.java:30)". And write some unit tests
 

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Hi, thanks for the answers,

Well, I cannot see what's wrong with the code ... I'm included the code for RunAirportWeather class.

Debugging the application fails on the first line of doResourceBroker.

Don't have a clue on why ... if I paste the code within doResourceBroker into a jsp scriptlet (on a web project), it works without problems ... no change needed ...

ANy help appreciated.

Thanks.
 

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Hi,

I'm including the class from which the webservice was generated ... so only simple types are being used (int and String).

No clue yet ...

Help!
 

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Originally posted by: znaps
Got any XML config files? Check those for typos.

No XML config files on my Java project. I have some on the Webservice project, but since the service works ok when accessed from a web project, the config files must be ok then.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |