aspose file tools*
The moose likes Java Micro Edition and the fly likes Problem connect to Web Service - CertificateException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Problem connect to Web Service - CertificateException" Watch "Problem connect to Web Service - CertificateException" New topic
Author

Problem connect to Web Service - CertificateException

burin utit
Greenhorn

Joined: Oct 15, 2009
Posts: 2
Hello,

I'm developing a J2ME application to communicate with a Web Service.
When I run the midlet, i got the error:
javax.xml.rpc.JAXRPCException: javax.microedition.pki.CertificateException: Subject alternative name did not match site name
at com.sun.j2mews.xml.rpc.OperationImpl.invoke(+220)
at service_now.incidents.ServiceNowSoap_Stub.getKeys(+540)
...

Following is my code:

protected void startApp() throws MIDletStateChangeException {
try {
ServiceNowSoap_Stub proxy = new ServiceNowSoap_Stub();
proxy._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, "https://demo.service-now.com/incident.do?SOAP");
proxy._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "abc");
proxy._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "abc");
proxy._setProperty(javax.xml.rpc.Stub.SESSION_MAINTAIN_PROPERTY, new Boolean(true));

GetKeys getInc = new GetKeys();
getInc.setActive(Boolean.TRUE);
getInc.setCategory("hardware");

GetKeysResponse resp = new GetKeysResponse();
resp = proxy.getKeys(getInc);

String[] keys = resp.getSys_id();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

The error appear at the line: resp = proxy.getKeys(getInc);

I tried to make an application in J2EE to communicate with this web service and everything was fine, I didn't have any error.
I set the same properties to the Stub such as: ENDPOINT_ADDRESS_PROPERTY, USERNAME_PROPERTY, PASSWORD_PROPERTY.

Could someone please tell me what is wrong?
I really need your help!


Thank you very much for replying.
Aleksandar Babic
Ranch Hand

Joined: May 30, 2007
Posts: 68
See if there is something useful on this topic
http://www.coderanch.com/t/459277/Java-Micro-Edition/Mobile/Ksoap-Error-expected-START-TAG
burin utit
Greenhorn

Joined: Oct 15, 2009
Posts: 2
Hi Aleksandar Babic,

Thank you very much for the useful link. It really helped me out.
Have a nice day!

Best regards,
Burinutit
Aleksandar Babic
Ranch Hand

Joined: May 30, 2007
Posts: 68
You're welcome ;)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem connect to Web Service - CertificateException
 
Similar Threads
WebServices NullPointerException when Client tried to get SOAP
Web Service in JBoss 4.2.2GA
Integrating J2EE application with SQL Server Reporting Services
Setting wsse:Security from Java swing client
Invoking a https webservice