This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem connect to Web Service - CertificateException

 
burin utit
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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.
 
Aleksandar Babic
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
You're welcome ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic