Cannot invoke remote service with Context

Hi,

I have a problem and it’s very curious.
I’ll invoke a service from remote B2B.

It works in a browser:
[url]http://remoteserver:5555/invoke/package.interfaceName/service[/url]

I can access the other B2B over a browser and with wM Developer, but I get an error, when I invoke:
Context context=new Context();
context.connect(server, userName, password);
IData reply = context.invoke(interfaceName,serviceName, data);

Error:
com.wm.app.b2b.client.ServiceException
at com.wm.app.b2b.client.Context.invoke(Context.java:1003)
at com.wm.app.b2b.client.Context.invoke(Context.java:868)
at com.wm.app.b2b.client.Context.connect(Context.java:510)
at com.wm.app.b2b.client.Context.connect(Context.java:465)

Has anyone an idea?
Thanks in advance.

Joerg,

If you have not connected Context to a server, a ServiceException will be thrown.

Reasons for ServiceException:
If the specified service cannot be executed. This can happen if this Context is not connected to a server, the target server cannot be reached, or if the specified service cannot be located.

Please make sure this before remote invoking that particular service.

HTH,
RMG

Joerg,

It is good to have in try…catch block before invoke. This will help isolating the cause.

But, I suggest to restart the wM. Sometimes this happens in Windows environment and restart solves the issue.

HTH