Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception thrown while invoke .NET service from Java client

 
Pene charl
Greenhorn
Posts: 21
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had post the exception while to invoke .NET web service from java client.
Cant able to find out what is the exact problem behind this exception.
Please help me to resolved.

"SOAPException: faultCode=SOAP-ENV:IOException; msg=ModuleException thrown by HTTPClient while posting.HTTPClient.AuthSchemeNotImplException: NTLM; targetException=java.io.IOException: ModuleException thrown by HTTPClient while posting.HTTPClient.AuthSchemeNotImplException: NTLM"
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly how did you construct this client software?

Specific toolkit? Are you starting with a WSDL provided by the service?

Bill
 
Vijay Rajagopal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your client code snippet...

Re: If you're calling a .NET webservice, whats the return type of the exposed webmethod?

As a general advice, you need a build request XML using a parser and hit the webservice and also get the object from the webservice, and parse it back again.

 
Pene charl
Greenhorn
Posts: 21
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not using any tool like AXIS.
Just using JDeveloper to create client stub and also got the WSDL service discription from server side,that WSDL generated based on .net.So it had used document style.
Is there any interoperability problem between .net and java?
When i make request to "https" service that's showed the exception.

I put my code snippet of client stub here:



//Initialization
m_httpConnection = new OracleSOAPHTTPConnection();
props.put(OracleSOAPHTTPConnection.PROXY_AUTH_TYPE, "basic");
props.put(OracleSOAPHTTPConnection.PROXY_USERNAME, "username");
props.put(OracleSOAPHTTPConnection.PROXY_PASSWORD, "password");
props.put(OracleSOAPHTTPConnection.PROXY_HOST, "host address");
props.put(OracleSOAPHTTPConnection.PROXY_PORT, "port no");
m_httpConnection.setProperties(props);
private String _endpoint = "https://URL/URN";

public String getEndpoint()
{
return _endpoint;
}

public void setEndpoint(String endpoint)
{
_endpoint = endpoint;
}

public String functionName(String Parameters) throws Exception
{
URL endpointURL = new URL(_endpoint);

Envelope requestEnv = new Envelope();
Body requestBody = new Body();
Vector requestBodyEntries = new Vector();

String wrappingName = "functionName";
String targetNamespace = "https: URL";
Vector requestData = new Vector();
requestData.add(new Object[] {"WSDL element", parameter passed by function});
requestData.add(new Object[] {"WSDL element", parameter passed by function});
......
requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
requestBody.setBodyEntries(requestBodyEntries);
requestEnv.setBody(requestBody);

Message msg = new Message();
msg.setSOAPTransport(m_httpConnection);
msg.send(endpointURL, "https://URL/URN(ie.functionName)", requestEnv);

Envelope responseEnv = msg.receiveEnvelope();
Body responseBody = responseEnv.getBody();
Vector responseData = responseBody.getBodyEntries();
return (String)fromElement((Element)responseData.elementAt(0), java.lang.String.class);
}


Please help me to resolve.
 
Pene charl
Greenhorn
Posts: 21
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pene charl wrote:I am not using any tool like AXIS.
Just using JDeveloper to create client stub and also got the WSDL service discription from server side,that WSDL generated based on .net.So it had used document style.
Is there any interoperability problem between .net and java?
When i make request to "https" service that's showed the exception.

I put my code snippet of client stub here:



//Initialization
m_httpConnection = new OracleSOAPHTTPConnection();
props.put(OracleSOAPHTTPConnection.PROXY_AUTH_TYPE, "basic");
props.put(OracleSOAPHTTPConnection.PROXY_USERNAME, "username");
props.put(OracleSOAPHTTPConnection.PROXY_PASSWORD, "password");
props.put(OracleSOAPHTTPConnection.PROXY_HOST, "host address");
props.put(OracleSOAPHTTPConnection.PROXY_PORT, "port no");
props.put("javax.net.ssl.trustStore", "/localdirectorypath");
props.put("javax.net.ssl.trustStorePassword", "password");
m_httpConnection.setProperties(props);
private String _endpoint = "https://URL/URN";

public String getEndpoint()
{
return _endpoint;
}

public void setEndpoint(String endpoint)
{
_endpoint = endpoint;
}

public String functionName(String Parameters) throws Exception
{
URL endpointURL = new URL(_endpoint);

Envelope requestEnv = new Envelope();
Body requestBody = new Body();
Vector requestBodyEntries = new Vector();

String wrappingName = "functionName";
String targetNamespace = "https: URL";
Vector requestData = new Vector();
requestData.add(new Object[] {"WSDL element", parameter passed by function});
requestData.add(new Object[] {"WSDL element", parameter passed by function});
......
requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
requestBody.setBodyEntries(requestBodyEntries);
requestEnv.setBody(requestBody);

Message msg = new Message();
msg.setSOAPTransport(m_httpConnection);
//Exception Occured here
msg.send(endpointURL, "https://URL/URN(ie.functionName)", requestEnv);
Envelope responseEnv = msg.receiveEnvelope();
Body responseBody = responseEnv.getBody();
Vector responseData = responseBody.getBodyEntries();
return (String)fromElement((Element)responseData.elementAt(0), java.lang.String.class);
}


Please help me to resolve.
 
Pene charl
Greenhorn
Posts: 21
Hibernate Java Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I resolved that problem..
That issue based on JDeveloper.
Thanks to all ..
 
sac jay
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Pene

I am facing a similar problem.
Could you please detail what problems were you facing using jDeveloper.
Could you please send your code as well so that i can refer to it.
Thanks.

Regards
Sachin
 
Pene charl
Greenhorn
Posts: 21
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sachin,
The problem arose because i missed out some Jdeveloper specific JAR files,which is needed for the web service development in JDeveloper.
So you should make sure to included all the JAR files.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic