• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Problem connect to Web Service - CertificateException

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See if there is something useful on this topic
https://coderanch.com/t/459277/Java-Micro-Edition/Mobile/Ksoap-Error-expected-START-TAG
 
burin utit
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome ;)
 
Skool. Stay in. Smartness. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic